> -----Original Message-----
> From: Stephen Hemminger <[email protected]>
> Sent: Monday, November 2, 2026 9:08 AM
> To: Dariusz Sosnowski <[email protected]>
> Cc: Slava Ovsiienko <[email protected]>; Bing Zhao
> <[email protected]>; Ori Kam <[email protected]>; Suanming Mou
> <[email protected]>; Matan Azrad <[email protected]>;
> [email protected]
> Subject: Re: [PATCH v2 0/2] net/mlx5: improvements to link status handling
>
> On Fri, 30 Oct 2026 18:28:41 +0100
> Dariusz Sosnowski <[email protected]> wrote:
>
> > This series is a result of splitting patch:
> > https://patches.dpdk.org/project/dpdk/patch/20261026160400.1290443-1-
> d
> > [email protected]/
> >
> > Patch 1 - Fix for mlx5 link update function to query current link
> > carrier status, bypassing the delay introduced by linkwatch in Linux kernel.
> >
> > Patch 2 - Move to link status polling, in place of relying on netlink
> > events which can be delayed by linkwatch for up to 1s.
>
> Instead of polling is there a way to get the lsc directly from devx or ibv on
> mlx5? That would work around the issue and avoid the overhead.
>From DevX, unfortunately no.
In ibv there are 2 options:
- IBV_EVENT_PORT_ACTIVE/ERR - generated on up/down respectively;
On ethernet devices, these are generated from netdev carrier state, so they
are
subjected to the same linkwatch delay.
- IBV_EVENT_DEVICE_SPEED_CHANGE - generated on up and down;
Is generated immediately on FW event reception.
It is available from Linux kernel v7.0 and rdma-core v62.0.
IBV_EVENT_DEVICE_SPEED_CHANGE would be ideal here,
but there's no good way to discover whether currently running kernel supports
it.
Theoretically, this event was added alongside ibv_query_port_speed() IB verb.
Following logic could be implemented (for DPDK compiled with recent rdma-core)
- Call ibv_query_port_speed()
- If error:
- start listening on device speed change async event
- on event: query link status of DPDK ports on that device
- else if ENOTSUP:
- start link status poll loop
>
> Long term, it would be good if kernel had sysctl to set linkwatch per
> interface
> but it doesn't