Loading net/switchdev/switchdev.c +11 −4 Original line number Original line Diff line number Diff line Loading @@ -520,6 +520,8 @@ EXPORT_SYMBOL_GPL(switchdev_port_obj_del); * @id: object ID * @id: object ID * @obj: object to dump * @obj: object to dump * @cb: function to call with a filled object * @cb: function to call with a filled object * * rtnl_lock must be held. */ */ int switchdev_port_obj_dump(struct net_device *dev, struct switchdev_obj *obj, int switchdev_port_obj_dump(struct net_device *dev, struct switchdev_obj *obj, switchdev_obj_dump_cb_t *cb) switchdev_obj_dump_cb_t *cb) Loading @@ -529,6 +531,8 @@ int switchdev_port_obj_dump(struct net_device *dev, struct switchdev_obj *obj, struct list_head *iter; struct list_head *iter; int err = -EOPNOTSUPP; int err = -EOPNOTSUPP; ASSERT_RTNL(); if (ops && ops->switchdev_port_obj_dump) if (ops && ops->switchdev_port_obj_dump) return ops->switchdev_port_obj_dump(dev, obj, cb); return ops->switchdev_port_obj_dump(dev, obj, cb); Loading Loading @@ -1097,6 +1101,8 @@ static struct net_device *switchdev_get_dev_by_nhs(struct fib_info *fi) struct net_device *dev = NULL; struct net_device *dev = NULL; int nhsel; int nhsel; ASSERT_RTNL(); /* For this route, all nexthop devs must be on the same switch. */ /* For this route, all nexthop devs must be on the same switch. */ for (nhsel = 0; nhsel < fi->fib_nhs; nhsel++) { for (nhsel = 0; nhsel < fi->fib_nhs; nhsel++) { Loading Loading @@ -1327,10 +1333,11 @@ void switchdev_port_fwd_mark_set(struct net_device *dev, u32 mark = dev->ifindex; u32 mark = dev->ifindex; u32 reset_mark = 0; u32 reset_mark = 0; if (group_dev && joining) { if (group_dev) { ASSERT_RTNL(); if (joining) mark = switchdev_port_fwd_mark_get(dev, group_dev); mark = switchdev_port_fwd_mark_get(dev, group_dev); } else if (group_dev && !joining) { else if (dev->offload_fwd_mark == mark) if (dev->offload_fwd_mark == mark) /* Ohoh, this port was the mark reference port, /* Ohoh, this port was the mark reference port, * but it's leaving the group, so reset the * but it's leaving the group, so reset the * mark for the remaining ports in the group. * mark for the remaining ports in the group. Loading Loading
net/switchdev/switchdev.c +11 −4 Original line number Original line Diff line number Diff line Loading @@ -520,6 +520,8 @@ EXPORT_SYMBOL_GPL(switchdev_port_obj_del); * @id: object ID * @id: object ID * @obj: object to dump * @obj: object to dump * @cb: function to call with a filled object * @cb: function to call with a filled object * * rtnl_lock must be held. */ */ int switchdev_port_obj_dump(struct net_device *dev, struct switchdev_obj *obj, int switchdev_port_obj_dump(struct net_device *dev, struct switchdev_obj *obj, switchdev_obj_dump_cb_t *cb) switchdev_obj_dump_cb_t *cb) Loading @@ -529,6 +531,8 @@ int switchdev_port_obj_dump(struct net_device *dev, struct switchdev_obj *obj, struct list_head *iter; struct list_head *iter; int err = -EOPNOTSUPP; int err = -EOPNOTSUPP; ASSERT_RTNL(); if (ops && ops->switchdev_port_obj_dump) if (ops && ops->switchdev_port_obj_dump) return ops->switchdev_port_obj_dump(dev, obj, cb); return ops->switchdev_port_obj_dump(dev, obj, cb); Loading Loading @@ -1097,6 +1101,8 @@ static struct net_device *switchdev_get_dev_by_nhs(struct fib_info *fi) struct net_device *dev = NULL; struct net_device *dev = NULL; int nhsel; int nhsel; ASSERT_RTNL(); /* For this route, all nexthop devs must be on the same switch. */ /* For this route, all nexthop devs must be on the same switch. */ for (nhsel = 0; nhsel < fi->fib_nhs; nhsel++) { for (nhsel = 0; nhsel < fi->fib_nhs; nhsel++) { Loading Loading @@ -1327,10 +1333,11 @@ void switchdev_port_fwd_mark_set(struct net_device *dev, u32 mark = dev->ifindex; u32 mark = dev->ifindex; u32 reset_mark = 0; u32 reset_mark = 0; if (group_dev && joining) { if (group_dev) { ASSERT_RTNL(); if (joining) mark = switchdev_port_fwd_mark_get(dev, group_dev); mark = switchdev_port_fwd_mark_get(dev, group_dev); } else if (group_dev && !joining) { else if (dev->offload_fwd_mark == mark) if (dev->offload_fwd_mark == mark) /* Ohoh, this port was the mark reference port, /* Ohoh, this port was the mark reference port, * but it's leaving the group, so reset the * but it's leaving the group, so reset the * mark for the remaining ports in the group. * mark for the remaining ports in the group. Loading