]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net/mlx5: Bridge, support replacing existing FDB entry
authorVlad Buslov <vladbu@nvidia.com>
Tue, 19 Oct 2021 15:45:28 +0000 (18:45 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Mon, 25 Oct 2021 20:51:20 +0000 (13:51 -0700)
The SWITCHDEV_FDB_ADD_TO_DEVICE is used for both adding new and replacing
existing entry. Implement support for replacing existing FDB entries in
mlx5 offload code.

Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Reviewed-by: Paul Blakey <paulb@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c

index 33d1d2ed4cd6c4216dd49f2e4774054ed1e00b5e..f690f430f40f8047781c84a10b71ec681a210d6a 100644 (file)
@@ -1160,6 +1160,10 @@ mlx5_esw_bridge_fdb_entry_init(struct net_device *dev, u16 vport_num, u16 esw_ow
                        return ERR_CAST(vlan);
        }
 
+       entry = mlx5_esw_bridge_fdb_lookup(bridge, addr, vid);
+       if (entry)
+               mlx5_esw_bridge_fdb_entry_notify_and_cleanup(entry, bridge);
+
        entry = kvzalloc(sizeof(*entry), GFP_KERNEL);
        if (!entry)
                return ERR_PTR(-ENOMEM);