]> git.ipfire.org Git - thirdparty/linux.git/commit
net/mlx5: E-Switch, unwind only newly loaded representor types
authorMark Bloch <mbloch@nvidia.com>
Sun, 3 May 2026 20:27:25 +0000 (23:27 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 7 May 2026 02:03:37 +0000 (19:03 -0700)
commit8a6712925d382d03f9423dd38edf8a90f50aef44
tree9f030c07e601b10158cdaab5381aabf52fc539e5
parent32a72840ee300fe88e9f31dc55f9ae1dacdc8b8d
net/mlx5: E-Switch, unwind only newly loaded representor types

__esw_offloads_load_rep() may return success without invoking the
representor load callback when the representor type is already loaded.

On a later load failure, mlx5_esw_offloads_rep_load() unconditionally
unloaded all previously iterated representor types. This could unload
representor types that were already loaded before this load attempt.

Track which representor types were actually loaded by the current call and
unwind only those on error. Also restore the representor state back to
REP_REGISTERED when the load callback itself fails.

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