diff options
author | Vlad Buslov <vladbu@nvidia.com> | 2021-10-19 17:45:28 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2021-10-25 22:51:20 +0200 |
commit | 3518c83fc96b46d10fcb9b185334d0a012241c16 (patch) | |
tree | deb5d4604cfc29d75c7b9fff3e612c35f138ef15 /drivers | |
parent | net/mlx5: Bridge, extract code to lookup and del/notify entry (diff) | |
download | linux-3518c83fc96b46d10fcb9b185334d0a012241c16.tar.xz linux-3518c83fc96b46d10fcb9b185334d0a012241c16.zip |
net/mlx5: Bridge, support replacing existing FDB entry
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c index 33d1d2ed4cd6..f690f430f40f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c @@ -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); |