summaryrefslogtreecommitdiff
path: root/net/bridge/br_switchdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge/br_switchdev.c')
-rw-r--r--net/bridge/br_switchdev.c36
1 files changed, 9 insertions, 27 deletions
diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c
index 36d75fd4a80c..6bf518d78f02 100644
--- a/net/bridge/br_switchdev.c
+++ b/net/bridge/br_switchdev.c
@@ -312,23 +312,16 @@ static void nbp_switchdev_unsync_objs(struct net_bridge_port *p,
/* Let the bridge know that this port is offloaded, so that it can assign a
* switchdev hardware domain to it.
*/
-int switchdev_bridge_port_offload(struct net_device *brport_dev,
- struct net_device *dev, const void *ctx,
- struct notifier_block *atomic_nb,
- struct notifier_block *blocking_nb,
- bool tx_fwd_offload,
- struct netlink_ext_ack *extack)
+int br_switchdev_port_offload(struct net_bridge_port *p,
+ struct net_device *dev, const void *ctx,
+ struct notifier_block *atomic_nb,
+ struct notifier_block *blocking_nb,
+ bool tx_fwd_offload,
+ struct netlink_ext_ack *extack)
{
struct netdev_phys_item_id ppid;
- struct net_bridge_port *p;
int err;
- ASSERT_RTNL();
-
- p = br_port_get_rtnl(brport_dev);
- if (!p)
- return -ENODEV;
-
err = dev_get_port_parent_id(dev, &ppid, false);
if (err)
return err;
@@ -348,23 +341,12 @@ out_switchdev_del:
return err;
}
-EXPORT_SYMBOL_GPL(switchdev_bridge_port_offload);
-void switchdev_bridge_port_unoffload(struct net_device *brport_dev,
- const void *ctx,
- struct notifier_block *atomic_nb,
- struct notifier_block *blocking_nb)
+void br_switchdev_port_unoffload(struct net_bridge_port *p, const void *ctx,
+ struct notifier_block *atomic_nb,
+ struct notifier_block *blocking_nb)
{
- struct net_bridge_port *p;
-
- ASSERT_RTNL();
-
- p = br_port_get_rtnl(brport_dev);
- if (!p)
- return;
-
nbp_switchdev_unsync_objs(p, ctx, atomic_nb, blocking_nb);
nbp_switchdev_del(p);
}
-EXPORT_SYMBOL_GPL(switchdev_bridge_port_unoffload);