From: sashiko-bot@kernel.org
To: wei.fang@oss.nxp.com
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH v3 net-next 14/15] net: enetc: add PSI-to-VSI link status notification support for VF
Date: Tue, 01 Sep 2026 03:23:59 +0000 [thread overview]
Message-ID: <20260901032400.59E611F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260831025441.635045-15-wei.fang@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Race condition in `enetc_vf_probe` causes permanent loss of carrier state if the interface is brought UP immediately by userspace.
--
commit 14cc725fe4ebcb6942ed2c3904878d85a508f30f
Author: Wei Fang <wei.fang@nxp.com>
net: enetc: add PSI-to-VSI link status notification support for VF
This commit adds infrastructure for ENETC v4 VFs to track PF link
status changes via the PSI-to-VSI messaging channel. It implements
a dedicated MSI-X vector and workqueue to parse notifications and
update the carrier state accordingly.
[ ... ]
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc_vf.c b/drivers/net/ethernet/freescale/enetc/enetc_vf.c
> --- a/drivers/net/ethernet/freescale/enetc/enetc_vf.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc_vf.c
[ ... ]
> @@ -520,15 +718,33 @@ static int enetc_vf_probe(struct pci_dev *pdev,
> goto err_alloc_msix;
> }
>
> + err = enetc_vf_wq_task_init(si);
> + if (err) {
> + dev_err(&pdev->dev, "Failed to init workqueue\n");
> + goto err_wq_init;
> + }
> +
> + err = enetc_vf_register_msg_msix(si);
> + if (err) {
> + dev_err(&pdev->dev, "Failed to register msg irq\n");
> + goto err_register_msg_msix;
> + }
> +
> err = register_netdev(ndev);
> if (err)
> goto err_reg_netdev;
>
> + /* Enable message received interrupt */
> + enetc_vf_enable_mr_int(si);
> netif_carrier_off(ndev);
[Severity: High]
This isn't a bug introduced by this patch, but this is a pre-existing
issue that appears to be exacerbated by the new asynchronous message
handling.
Could this sequence in enetc_vf_probe() cause a permanent loss of the
carrier state if the interface is brought up immediately by userspace?
Once register_netdev() exposes the device to userspace, the rtnl_lock
is dropped. If userspace reacts to the registration and brings the
interface up immediately, enetc_open() will run and successfully register
the link status notifier.
The PF then replies with the initial link status, queuing the msg_task
workqueue which calls netif_carrier_on().
Concurrently, enetc_vf_probe() resumes and unconditionally calls
netif_carrier_off(). If the workqueue wins the race, netif_carrier_off()
will overwrite the valid on state with off, severing the link without any
notification until the next physical link flap or a manual restart.
Should netif_carrier_off() be called before register_netdev() to prevent
this condition?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260831025441.635045-1-wei.fang@oss.nxp.com?part=14
next prev parent reply other threads:[~2026-09-01 3:24 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 2:54 [PATCH v3 net-next 00/15] net: enetc: SR-IOV improvements and ENETC v4 VF support wei.fang
2026-08-31 2:54 ` [PATCH v3 net-next 01/15] net: enetc: add trusted " wei.fang
2026-09-01 3:23 ` sashiko-bot
2026-09-01 6:13 ` Wei Fang (OSS)
2026-09-03 23:44 ` netdev-bot+sashiko
2026-09-04 6:29 ` Wei Fang
2026-08-31 2:54 ` [PATCH v3 net-next 02/15] net: enetc: move msg_task and msg_int_name to struct enetc_si wei.fang
2026-08-31 2:54 ` [PATCH v3 net-next 03/15] net: enetc: add link status message support to PF driver wei.fang
2026-08-31 12:00 ` Andrew Lunn
2026-09-01 2:31 ` Wei Fang
2026-09-01 3:05 ` Andrew Lunn
2026-09-01 3:40 ` Wei Fang
2026-09-01 3:23 ` sashiko-bot
2026-09-01 6:46 ` Wei Fang (OSS)
2026-09-03 23:44 ` netdev-bot+sashiko
2026-09-04 7:16 ` Wei Fang
2026-08-31 2:54 ` [PATCH v3 net-next 04/15] net: enetc: add link speed " wei.fang
2026-09-03 23:44 ` netdev-bot+sashiko
2026-09-04 7:52 ` Wei Fang
2026-08-31 2:54 ` [PATCH v3 net-next 05/15] net: enetc: use enetc_set_si_hw_addr() to set VF MAC address wei.fang
2026-08-31 2:54 ` [PATCH v3 net-next 06/15] net: enetc: relocate enetc_pf_set_vf_mac() for common PF support wei.fang
2026-08-31 2:54 ` [PATCH v3 net-next 07/15] net: enetc: add .ndo_set_vf_mac() to the enetc v4 driver wei.fang
2026-09-01 3:23 ` sashiko-bot
2026-09-01 6:59 ` Wei Fang (OSS)
2026-08-31 2:54 ` [PATCH v3 net-next 08/15] net: enetc: move mac_filter from struct enetc_pf to struct enetc_si wei.fang
2026-08-31 2:54 ` [PATCH v3 net-next 09/15] net: enetc: add MAC address filtering support for VFs of ENETC v4 wei.fang
2026-09-03 23:44 ` netdev-bot+sashiko
2026-08-31 2:54 ` [PATCH v3 net-next 10/15] net: enetc: simplify and rename PSIIER enable/disable helpers wei.fang
2026-08-31 2:54 ` [PATCH v3 net-next 11/15] net: enetc: restore VF MAC promiscuous mode after FLR for ENETC v4 wei.fang
2026-09-03 23:44 ` netdev-bot+sashiko
2026-09-04 8:40 ` Wei Fang
2026-08-31 2:54 ` [PATCH v3 net-next 12/15] net: enetc: add VF support for i.MX94 and i.MX95 wei.fang
2026-09-03 23:44 ` netdev-bot+sashiko
2026-09-04 9:05 ` Wei Fang
2026-08-31 2:54 ` [PATCH v3 net-next 13/15] net: enetc: implement ndo_set_rx_mode_async for ENETC v4 VF wei.fang
2026-09-03 23:44 ` netdev-bot+sashiko
2026-09-04 9:53 ` Wei Fang
2026-08-31 2:54 ` [PATCH v3 net-next 14/15] net: enetc: add PSI-to-VSI link status notification support for VF wei.fang
2026-09-01 3:23 ` sashiko-bot [this message]
2026-09-03 23:44 ` netdev-bot+sashiko
2026-09-04 10:47 ` Wei Fang
2026-08-31 2:54 ` [PATCH v3 net-next 15/15] net: enetc: add ndo_get_vf_config() support wei.fang
2026-09-03 23:44 ` netdev-bot+sashiko
2026-09-03 2:56 ` [PATCH v3 net-next 00/15] net: enetc: SR-IOV improvements and ENETC v4 VF support Jakub Kicinski
2026-09-03 3:24 ` Wei Fang (OSS)
2026-09-03 23:22 ` Jakub Kicinski
2026-09-04 2:02 ` Wei Fang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260901032400.59E611F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=imx@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wei.fang@oss.nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.