net/mlx5e: SD, Use correct mdev to build channel param
authorTariq Toukan <tariqt@nvidia.com>
Tue, 3 Dec 2024 20:49:19 +0000 (22:49 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 5 Dec 2024 03:43:46 +0000 (19:43 -0800)
commit31f114c3d158dacbeda33f2afb0ca41f4ec6c9f9
tree9f06cafd07bff53a78872b11a66b6abef3336c49
parentd04c81a3e3ced59f68018a7906c82e421bf748a5
net/mlx5e: SD, Use correct mdev to build channel param

In a multi-PF netdev, each traffic channel creates its own resources
against a specific PF.
In the cited commit, where this support was added, the channel_param
logic was mistakenly kept unchanged, so it always used the primary PF
which is found at priv->mdev.
In this patch we fix this by moving the logic to be per-channel, and
passing the correct mdev instance.

This bug happened to be usually harmless, as the resulting cparam
structures would be the same for all channels, due to identical FW logic
and decisions.
However, in some use cases, like fwreset, this gets broken.

This could lead to different symptoms. Example:
Error cqe on cqn 0x428, ci 0x0, qn 0x10a9, opcode 0xe, syndrome 0x4,
vendor syndrome 0x32

Fixes: e4f9686bdee7 ("net/mlx5e: Let channels be SD-aware")
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Lama Kayal <lkayal@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Link: https://patch.msgid.link/20241203204920.232744-6-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c