Commit 9ae9ff99 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Jakub Kicinski

net: bridge: split out the switchdev portion of br_mdb_notify

Similar to fdb_notify() and br_switchdev_fdb_notify(), split the
switchdev specific logic from br_mdb_notify() into a different function.
This will be moved later in br_switchdev.c.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 4a6849e4
......@@ -759,7 +759,7 @@ static void br_mdb_switchdev_host(struct net_device *dev,
br_mdb_switchdev_host_port(dev, lower_dev, mp, type);
}
void br_mdb_notify(struct net_device *dev,
static void br_switchdev_mdb_notify(struct net_device *dev,
struct net_bridge_mdb_entry *mp,
struct net_bridge_port_group *pg,
int type)
......@@ -771,11 +771,10 @@ void br_mdb_notify(struct net_device *dev,
.flags = SWITCHDEV_F_DEFER,
},
};
struct net *net = dev_net(dev);
struct sk_buff *skb;
int err = -ENOBUFS;
if (pg) {
if (!pg)
return br_mdb_switchdev_host(dev, mp, type);
br_switchdev_mdb_populate(&mdb, mp);
mdb.obj.orig_dev = pg->key.port->dev;
......@@ -795,9 +794,18 @@ void br_mdb_notify(struct net_device *dev,
switchdev_port_obj_del(pg->key.port->dev, &mdb.obj);
break;
}
} else {
br_mdb_switchdev_host(dev, mp, type);
}
}
void br_mdb_notify(struct net_device *dev,
struct net_bridge_mdb_entry *mp,
struct net_bridge_port_group *pg,
int type)
{
struct net *net = dev_net(dev);
struct sk_buff *skb;
int err = -ENOBUFS;
br_switchdev_mdb_notify(dev, mp, pg, type);
skb = nlmsg_new(rtnl_mdb_nlmsg_size(pg), GFP_ATOMIC);
if (!skb)
......
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