]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: HWS, fix complex rules rehash error flow
authorYevgeny Kliteynik <kliteyn@nvidia.com>
Sun, 17 Aug 2025 20:23:19 +0000 (23:23 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:34:48 +0000 (16:34 +0200)
commit37d54bc28d092bc3b314da45d730f00e9d86ec2a
treee9a2c71b42c15e2d6a32cc5178ce67d033db737c
parent748528ffb877276574773947178a6d6a0cef76fe
net/mlx5: HWS, fix complex rules rehash error flow

[ Upstream commit 4a842b1bf18a32ee0c25dd6dd98728b786a76fe4 ]

Moving rules from matcher to matcher should not fail.
However, if it does fail due to various reasons, the error flow
should allow the kernel to continue functioning (albeit with broken
steering rules) instead of going into series of soft lock-ups or
some other problematic behaviour.

Similar to the simple rules, complex rules rehash logic suffers
from the same problems. This patch fixes the error flow for moving
complex rules:
 - If new rule creation fails before it was even enqeued, do not
   poll for completion
 - If TIMEOUT happened while moving the rule, no point trying
   to poll for completions for other rules. Something is broken,
   completion won't come, just abort the rehash sequence.
 - If some other completion with error received, don't give up.
   Continue handling rest of the rules to minimize the damage.
 - Make sure that the first error code that was received will
   be actually returned to the caller instead of replacing it
   with the generic error code.

All the aforementioned issues stem from the same bad error flow,
so no point fixing them one by one and leaving partially broken
code - fixing them in one patch.

Fixes: 17e0accac577 ("net/mlx5: HWS, support complex matchers")
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Vlad Dogaru <vdogaru@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/20250817202323.308604-4-mbloch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c