Commit d0cf57f9 authored by Scott Feldman's avatar Scott Feldman Committed by David S. Miller

rocker: handle setting bridge ageing_time

The FDB cleanup timer will get rescheduled to re-evaluate FDB entries
based on new ageing_time.
Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c62987bb
...@@ -4361,6 +4361,18 @@ static int rocker_port_brport_flags_set(struct rocker_port *rocker_port, ...@@ -4361,6 +4361,18 @@ static int rocker_port_brport_flags_set(struct rocker_port *rocker_port,
return err; return err;
} }
static int rocker_port_bridge_ageing_time(struct rocker_port *rocker_port,
struct switchdev_trans *trans,
u32 ageing_time)
{
if (!switchdev_trans_ph_prepare(trans)) {
rocker_port->ageing_time = clock_t_to_jiffies(ageing_time);
mod_timer(&rocker_port->rocker->fdb_cleanup_timer, jiffies);
}
return 0;
}
static int rocker_port_attr_set(struct net_device *dev, static int rocker_port_attr_set(struct net_device *dev,
struct switchdev_attr *attr, struct switchdev_attr *attr,
struct switchdev_trans *trans) struct switchdev_trans *trans)
...@@ -4378,6 +4390,10 @@ static int rocker_port_attr_set(struct net_device *dev, ...@@ -4378,6 +4390,10 @@ static int rocker_port_attr_set(struct net_device *dev,
err = rocker_port_brport_flags_set(rocker_port, trans, err = rocker_port_brport_flags_set(rocker_port, trans,
attr->u.brport_flags); attr->u.brport_flags);
break; break;
case SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME:
err = rocker_port_bridge_ageing_time(rocker_port, trans,
attr->u.ageing_time);
break;
default: default:
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment