๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25084

Re: [PATCH net-next v2 3/3] net: wangxun: expose VF stats through ndo_get_stats64

#25084
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 08:36
98 lines
11545 bytes
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
Technical Details
Message-ID: <179611418656.3146.9225649982741060142@kernel.org>
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374851-linux-kernel-netdev=dewy.ru
References: <20261130083407.78429-4-mengyuanlou@net-swift.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374851-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <179611418656.3146.9225649982741060142@kernel.org>
References: <20261130083407.78429-4-mengyuanlou@net-swift.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1660961"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:uZyFfAcU9wamF4CoJIvC3VJaZ08= sha256:ebbLPRwUyJEH/Dd/gtQilpgV9GXFHwS2wnpDUj/+UZU=
	sha1:jOAapXPnklzfUB2Z2iyqGNhJ+KQ= sha256:x8qSsBbCnbKJbyetog/ctO8ol7yAQLKxi1v/uzM5jxo=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id B08C21172CC; Tue,  1 Dec 2026 11:36:49 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id NPgwjjIALLvY;
	Tue,  1 Dec 2026 11:36:46 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374851-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 059881172CE; Tue,  1 Dec 2026 11:36:36 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id D125A316EC; Tue,  1 Dec 2026 08:36:28 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796114188;
	b=2rTZuqxhc4CnlLwFO0N2TxkqtqjhUxTdMugmqwHTfA/caj15max8NY+QZGask9GyYhwa
	 CTS0CQQt62rqemMO9sKMFKAnQ6ZTqEX8Vtt1BUGgbhGSzyx6eSUGT/U5Q/znXEMkM6NAw
	 8UvhjCBM7Eu+yuBJzbkWqrP4QL4zxCTuS847jG5d17EFssj68R7G+cMOHd2/3zB85zwkX
	 lZwa7akRPfBnX012BfY45gSDcn9fYx69wOmGfpkPzNXFKfP/Uk7SYDzcuntqH4F34kb7U
	 fbhtqfRVuaUIsQYoNasKOWjw2HzOOrc4SiNEBhJfhpPCUb4Jk9UVTHZyhHgqPsAVbJA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796114188;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=CvDkbyOOF1QiQ1ZxA4OaRLYdSCIgoilgHGPb8hXMc28=;
	b=xOyn7fyjBLcpuXTqLtBn0SFUMiW5kM2g1bBJ+LRYxedKCY8QD1so3k7bX02/FGMjDovF
	 MYBhRnVtCDToeffNbdgeimbi4jaM9w8YE61M2l2Q3qwXwtkhjGXUuuzttRazrZq4VQgLk
	 Ot7Y88OT7ktUhsGzJUMSkrXbCxkBvs2L0nCotU/Vkz1J7nHVdM6sECQiao858asaiuPgx
	 JS2BZHH05dT3J/j9Kfsa80tRaSE65w95h7eZgmIQAFoIfWxTr2wJiLEA8hP1+QZ8VvKaA
	 7gZ77TBNnEK3YBjkCkjehfrWUhZfT6CEoSVCgFg1RMftN6Z04qja+7QZnBBPHuzJbWw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="NxU775/3";
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id A97C1606A333;
	Tue,  1 Dec 2026 08:36:28 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NxU775/3
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796114187;
	b=AsRhVp0zLktTDsz1OUbuKuaSG97z4rWcGMwEbOuCSyT0kWYu655Ts8wqEBY9LSgj//BS
	 McEPnxxVLH7UeLPGE/iJ4IaRFa6R2Tx2Sm+h61all4mGGT7Au1AWn7VkW7DhedCF4zuv1
	 zuxgiX+NekDtO/t0Px7smUWf+HXX+Kx1jH5uxrfFYILYvpiTYs9ZadLFr4VpG6gdj7Zac
	 2gWaINGvM3pzPx2Z7NQgqxs+Cyllc4a4/Sacs2i5UQpqQ92qaTxgD6OIsRNswuIoU5B+t
	 95/T3JBNnslCXN2jdb8trSunznGqKALfaxkBXNO6S80yiQq63Y1T6A29iW0uG+Am2FQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796114187;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=CvDkbyOOF1QiQ1ZxA4OaRLYdSCIgoilgHGPb8hXMc28=;
	b=CPUv7WCdRP40zznvZqimuG2VF5Sx5wIEzdUvhRWkDtRJ5I0K9EZg+QePuwaQmSuXUUTe
	 UmewcoNobKgl/JYO/2qK1cxI6mXYHXVCH59rl1+iGsQo9eHX+otEx3pauD257ZGjzCnf3
	 v8VDydc/6M76rezfmkZzM2ymWzSz8oN/qOyORIuEaOkABwlM6TMczstxNMN2uI1rYUdWT
	 1EutXt/OjgXSBctxSZlF8TVr7WcND3tf9mGGSsYubB6aOPSPBR7d5t1ajXehw5MshWv86
	 efmRM9F5ud+Fwsv/Sm0t60AEZxOz/XHghAyLdzxXMFBSE8qGxl6iqStRRha6JYlFrIA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="NxU775/3";
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id CABC9606A329
	for <netdev@vger.kernel.org>; Tue,  1 Dec 2026 08:36:27 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09E6B1F0089B;
	Tue,  1 Dec 2026 08:36:26 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796114187;
	bh=CvDkbyOOF1QiQ1ZxA4OaRLYdSCIgoilgHGPb8hXMc28=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=NxU775/3exPrzlot7XV5KZTzgPBh4fBeCkOEUzwHnGHrOy2bFOELStEzP9rJmMcQd
	 /WRJgwjv640nb2GQabSgK6SLM8HYuFRo2YxdKeMIrAVpMHTdk8p0oDxvdshY8TBIRV
	 LFjfSMqqia1voifvNtmvWFw9RrI7sjpI0brDYIdO479v2D8ufLEAoAD0Mpnl1oj7be
	 YTrKksyvsYWxqWi44UK2k8vShm60a0mEr4YBJj8v1Lc0tWvr2n25xQ8eJMPx7YeOxN
	 JdTQsKEx+tzGNDiJefyTM+2MPNPBJRzMMyIXCGWY5RuVhd8Imhd7gV+q6QbGnT4Vbk
	 bL324cCiOZKPQ==
X-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
X-In-Reply-To: <20261130083407.78429-4-mengyuanlou@net-swift.com>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list