From: netdev-bot+sashiko@kernel.org
To: mengyuanlou@net-swift.com
Cc: netdev@vger.kernel.org, jiawenwu@trustnetic.com,
duanqiangwen@net-swift.com, linglingzhang@net-swift.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com
Subject: Re: [PATCH net-next v2 3/3] net: wangxun: expose VF stats through ndo_get_stats64
Date: Tue, 01 Dec 2026 08:36:26 +0000 [thread overview]
Message-ID: <179611418656.3146.9225649982741060142@kernel.org> (raw)
In-Reply-To: <20261130083407.78429-4-mengyuanlou@net-swift.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] This patch fixes a real bug that users can hit today, but it
is packaged as part of a feature patch.
--
net: wangxun: expose VF stats through ndo_get_stats64
This registers wx_get_stats64() as ndo_get_stats64 for ngbevf and txgbevf,
and makes wx_update_stats() skip the PF-only statistics registers on a VF.
It also adds a wx->is_vf field that the VF drivers set at probe time. All
the pci_dev::is_virtfn checks in libwx are converted to use it.
> diff --git a/drivers/net/ethernet/wangxun/libwx/wx_hw.c b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
> index a367ed45fc127..5463ca426fc33 100644
> --- a/drivers/net/ethernet/wangxun/libwx/wx_hw.c
> +++ b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
[ ... ]
> @@ -2492,14 +2492,14 @@ int wx_sw_init(struct wx *wx)
> wx->oem_svid = pdev->subsystem_vendor;
> wx->oem_ssid = pdev->subsystem_device;
> wx->bus.device = PCI_SLOT(pdev->devfn);
> - if (pdev->is_virtfn)
> + if (wx->is_vf)
> wx->bus.func = PCI_FUNC(pdev->devfn);
> else
> wx->bus.func = FIELD_GET(WX_CFG_PORT_ST_LANID,
> rd32(wx, WX_CFG_PORT_ST));
>
> if (wx->oem_svid == PCI_VENDOR_ID_WANGXUN ||
> - pdev->is_virtfn) {
> + wx->is_vf) {
> wx->subsystem_vendor_id = pdev->subsystem_vendor;
> wx->subsystem_device_id = pdev->subsystem_device;
> } else {
[Severity: Medium]
Is this conversion part of the ndo_get_stats64 feature? It looks like a
standalone fix that could go to net with Fixes: tags.
pci_dev::is_virtfn is only set in pci_iov_add_virtfn(). So it is clear
for an ngbevf/txgbevf VF that is passed through to a guest. Before this
patch, a guest VF took the PF branch of every check converted here:
wx_sw_init() read WX_CFG_PORT_ST. Commit 694de316f607 ("net: libwx:
fix VF illegal register access") says that read hangs the system.
wx_sw_init() could also call wx_flash_read_dword() for non-Wangxun
subsystem vendors.
wx_intr_enable() wrote WX_PX_IMC(0/1) instead of WX_VXIMC.
wx_set_itr() and wx_set_coalesce() wrote WX_PX_ITR through
wx_write_eitr() instead of using wx_write_eitr_vf().
wx_init_interrupt_scheme() ran the PF wx_set_num_queues() instead of
the wx->set_num_queues callback.
wx_set_interrupt_capability() fell back to MSI/INTx instead of
returning the MSI-X error.
Most of these checks came from commit fd0a2e03bf6083 ("net: txgbevf: init
interrupts and request irqs"). The wx_sw_init() check came from
694de316f607.
The commit message describes this change as:
"Convert the other VF checks in libwx to the same field so that every
path agrees on the role."
It does not say that guest VFs currently hang or write the wrong
registers.
Only the new wx->is_vf check in wx_update_stats() depends on the
feature. Before this patch, wx_update_stats() was only called from
ngbe_service_task() and txgbe_service_task().
Could the is_virtfn to is_vf conversion be split into its own patch for
net? It could carry Fixes: 694de316f607, Fixes: fd0a2e03bf6083 and
Cc: stable, with the ndo_get_stats64 part sent to net-next. As it
stands, stable kernels that carry 694de316f607 keep the guest VF hang.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130083407.78429-1-mengyuanlou%40net-swift.com
prev parent reply other threads:[~2026-12-01 8:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 8:34 [PATCH net-next v2 0/3] net: wangxun: improve statistics support Mengyuan Lou
2026-11-30 8:34 ` [PATCH net-next v2 1/3] net: libwx: preserve queue stats across reconfiguration Mengyuan Lou
2026-12-01 8:36 ` netdev-bot+sashiko
2026-11-30 8:34 ` [PATCH net-next v2 2/3] net: wangxun: expose queue stats via netdev-genl Mengyuan Lou
2026-12-01 8:36 ` netdev-bot+sashiko
2026-11-30 8:34 ` [PATCH net-next v2 3/3] net: wangxun: expose VF stats through ndo_get_stats64 Mengyuan Lou
2026-12-01 8:36 ` netdev-bot+sashiko [this message]
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=179611418656.3146.9225649982741060142@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=duanqiangwen@net-swift.com \
--cc=edumazet@google.com \
--cc=jiawenwu@trustnetic.com \
--cc=kuba@kernel.org \
--cc=linglingzhang@net-swift.com \
--cc=mengyuanlou@net-swift.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox