]> www.infradead.org Git - users/dwmw2/linux.git/commit
net/mlx5: E-switch, refactor eswitch mode change
authorPatrisious Haddad <phaddad@nvidia.com>
Thu, 7 Nov 2024 19:43:46 +0000 (21:43 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 12 Nov 2024 03:28:17 +0000 (19:28 -0800)
commitab85ebf437231ceaf359c2a4679bebd7e8d6bdb2
tree036d87e4aef7ccc60dbc7ca3e3e7c74631727759
parent7d3f3b4367f315a61fc615e3138f3d320da8c466
net/mlx5: E-switch, refactor eswitch mode change

The E-switch mode was previously updated before removing and re-adding the
IB device, which could cause a temporary mismatch between the E-switch mode
and the IB device configuration.

To prevent this discrepancy, the IB device is now removed first, then
the E-switch mode is updated, and finally, the IB device is re-added.
This sequence ensures consistent alignment between the E-switch mode and
the IB device whenever the mode changes, regardless of the new mode value.

Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20241107194357.683732-2-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c