Skip to content

Commit

Permalink
net: bridge: make nbp_switchdev_unsync_objs() follow reverse order of…
Browse files Browse the repository at this point in the history
… sync()

There may be switchdev drivers that can add/remove a FDB or MDB entry
only as long as the VLAN it's in has been notified and offloaded first.
The nbp_switchdev_sync_objs() method satisfies this requirement on
addition, but nbp_switchdev_unsync_objs() first deletes VLANs, then
deletes MDBs and FDBs. Reverse the order of the function calls to cater
to this requirement.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vladimir Oltean authored and David S. Miller committed Feb 16, 2022
1 parent 8d23a54 commit 263029a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/bridge/br_switchdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,11 +707,11 @@ static void nbp_switchdev_unsync_objs(struct net_bridge_port *p,
struct net_device *br_dev = p->br->dev;
struct net_device *dev = p->dev;

br_switchdev_vlan_replay(br_dev, dev, ctx, false, blocking_nb, NULL);
br_switchdev_fdb_replay(br_dev, ctx, false, atomic_nb);

br_switchdev_mdb_replay(br_dev, dev, ctx, false, blocking_nb, NULL);

br_switchdev_fdb_replay(br_dev, ctx, false, atomic_nb);
br_switchdev_vlan_replay(br_dev, dev, ctx, false, blocking_nb, NULL);
}

/* Let the bridge know that this port is offloaded, so that it can assign a
Expand Down

0 comments on commit 263029a

Please sign in to comment.