summaryrefslogtreecommitdiff
path: root/rust/helpers/pci.c
diff options
context:
space:
mode:
authorShay Drory <shayd@nvidia.com>2025-09-29 00:02:08 +0300
committerJakub Kicinski <kuba@kernel.org>2025-09-29 18:51:25 -0700
commit79a0e32b32ac4e4f9e4bb22be97f371c8c116c88 (patch)
treedb7ee3ffcaa7e9317df3d1ad5f03d4f4aa0ab4f2 /rust/helpers/pci.c
parentb1f0349bd6d320c382df2e7f6fc2ac95c85f2b18 (diff)
net/mlx5: pagealloc: Fix reclaim race during command interface teardown
The reclaim_pages_cmd() function sends a command to the firmware to reclaim pages if the command interface is active. A race condition can occur if the command interface goes down (e.g., due to a PCI error) while the mlx5_cmd_do() call is in flight. In this case, mlx5_cmd_do() will return an error. The original code would propagate this error immediately, bypassing the software-based page reclamation logic that is supposed to run when the command interface is down. Fix this by checking whether mlx5_cmd_do() returns -ENXIO, which mark that command interface is down. If this is the case, fall through to the software reclamation path. If the command failed for any another reason, or finished successfully, return as before. Fixes: b898ce7bccf1 ("net/mlx5: cmdif, Avoid skipping reclaim pages if FW is not accessible") Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'rust/helpers/pci.c')
0 files changed, 0 insertions, 0 deletions