[PATCH 23.11] net/mlx5: fix LSC skip on shared device
Maayan Kashani
mkashani at nvidia.com
Thu Nov 19 13:42:37 CET 2026
mlx5_dev_interrupt_nl_cb() walks every port registered on a shared
IB device to find the one whose netdev raised a link status event.
On a port that is configured without link status interrupts it
used "break", which ends the whole walk. A VF representor is often
configured without LSC, so when it sits ahead of the PF in the port
table the PF never receives the carrier event. Its cached link state
stays up while the kernel reports NO-CARRIER.
Use "continue" so only that port is skipped and the scan reaches the
port whose ifindex matches the event.
Initialize the interface index in the callback to silence Coverity
warnings about uninitialized variable usage.
Coverity issue: 915725
Fixes: 17f95513adca ("net/mlx5: fix link status change detection")
Cc: stable at dpdk.org
Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
drivers/net/mlx5/linux/mlx5_ethdev_os.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index 765697be612..d8e8b811428 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -803,7 +803,7 @@ mlx5_dev_interrupt_nl_cb(struct nlmsghdr *hdr, void *cb_arg)
{
struct mlx5_dev_ctx_shared *sh = cb_arg;
uint32_t i;
- uint32_t if_index;
+ uint32_t if_index = 0;
if (mlx5_nl_parse_link_status_update(hdr, &if_index) < 0)
return;
@@ -818,7 +818,7 @@ mlx5_dev_interrupt_nl_cb(struct nlmsghdr *hdr, void *cb_arg)
/* Probing may initiate an LSC before configuration is done. */
if (dev->data->dev_configured &&
!dev->data->dev_conf.intr_conf.lsc)
- break;
+ continue;
priv = dev->data->dev_private;
if (priv->if_index == if_index) {
/* Block logical LSC events. */
--
2.25.1
More information about the stable
mailing list