RE: [PATCH v4 net-next 03/15] net: enetc: add link status message support to PF driver

From: Claudiu Manoil

Date: Fri Sep 11 2026 - 16:29:30 EST



NXP Confidential
> -----Original Message-----
> From: Wei Fang (OSS) <wei.fang@xxxxxxxxxxx>
> Sent: Wednesday, September 9, 2026 1:07 PM
[...]
> Subject: [PATCH v4 net-next 03/15] net: enetc: add link status message support
> to PF driver
>
> From: Wei Fang <wei.fang@xxxxxxx>
>
> Add a mechanism for VFs to learn the PF link state, using message class
> 0x80 (ENETC_MSG_CLASS_ID_LINK_STATUS) with three VSI-to-PSI commands:
>
> 1. ENETC_MSG_GET_CURRENT_LINK_STATUS: the VF queries the current PF link
> status synchronously. This is intended for DPDK-owned VFs and is not
> used by the Linux VF driver.
> 2. ENETC_MSG_REGISTER_LINK_CHANGE_NOTIFIER: the VF registers for link
> change notification. The PF then reports the current link status and
> notifies the VF on every later link change.
> 3. ENETC_MSG_UNREGISTER_LINK_CHANGE_NOTIFIER: the VF unregisters.
>
> The PSI-to-VSI notification is 16 bits wide: the upper 8 bits carry the
> class ID and the lower 8 bits the class code. Bit 0 of the class code
> indicates the link state (1 = down, 0 = up) and bit 1 indicates whether
> TX PAUSE is enabled on the PF. The TX PAUSE state is included so a VF
> can decide whether to enable congestion mode on its RX BD rings, which
> only works when the PF can actually send PAUSE frames.
>
> Notifications are sent through the ENETC_PSIMSGSR register. Since sending
> a notification may take a long time, as it polls the per-VF message
> status bits, the actual transmission is deferred to an ordered workqueue
> rather than running in the phylink link_up/link_down callbacks. The
> link_status_ms_mask tracks the VFs registered for notification and is
> cleared when SR-IOV is disabled.
>
> Export enetc_pf_notify_vf_link_up() and enetc_pf_notify_vf_link_down()
> for the PF phylink callbacks. Through this, VFs can perceive the link
> status and report it to upper layers such as the kernel network stack,
> containers and virtual machines.
>
> Currently only the ENETC v4 driver supports this feature; v1 does not.
> And the SR-IOV feature of ENETC v4 will be added by subsequent patches.
>
> Signed-off-by: Wei Fang <wei.fang@xxxxxxx>

Reviewed-by: Claudiu Manoil <claudiu.manoil@xxxxxxx>