๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #19619

Re: [PATCH net-next] eth: bnxt: report TX HW GSO queue stats

#19619
From: Narcisa Vasile
Date: Fri, 20 Nov 2026 04:48
71 lines
14157 bytes
On Wed, Nov 18, 2026 at 08:44:00AM +0000, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider.
> 
> Critical: 0 ยท High: 0 (1) ยท Medium: 1 ยท Low: 1
> 
> > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > index 6846a27bfef4c..1a7a93bf684ac 100644
> > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > @@ -869,6 +869,11 @@ static bool __bnxt_tx_int(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
> >  		cons = NEXT_TX(cons);
> >  		tx_pkts++;
> >  		tx_bytes += skb->len;
> > +		if (skb_is_gso(skb) && !tx_buf->is_sw_gso) {
> > +			txr->tx_hw_gso_packets++;
> > +			txr->tx_hw_gso_wire_packets +=
> > +				skb_shinfo(skb)->gso_segs;
> > +		}
> >  		tx_buf->skb = NULL;
> >  		tx_buf->is_ts_pkt = 0;
> 
> [Severity: Medium]
> Can this over-count wire packets for GSO skbs that were sent through the
> TX push path?
> 
> This block runs before the is_push early-out. It treats every completed
> skb with skb_is_gso() && !is_sw_gso as segmented by the hardware.
> However, the push path gate in bnxt_start_xmit() does not exclude GSO
> skbs:
> 
> 	if (free_size == bp->tx_ring_size && length <= bp->tx_push_thresh &&
> 	    skb_frags_readable(skb) && !lflags) {
> 
> The push BDs never set TX_BD_FLAGS_LSO or tx_bd_mss, so the NIC sends
> the skb as a single frame.
> 
> Take an idle ring with tx_push_thresh at 164 and a GSO skb of 164 bytes
> or less. Two examples are TCP with a peer-advertised MSS of 48 and 96
> bytes of payload, or UDP_SEGMENT with gso_size=8 and 80 bytes of
> payload. Either skb would be counted as 1 hw_gso_packet plus gso_segs
> hw_gso_wire_packets, even though only one frame went on the wire.
> 
> tso.py reads these counters, so could this give misleading results
> there? Fixing the push path issue described below would also fix this.
> 

This couldn't give misleading results there, since no GSO skb in tso.py
can be 164 bytes or less, so none can take the push path.

> [Severity: High]
> This is a pre-existing issue and was not introduced by this patch, but
> should bnxt_start_xmit() keep GSO skbs out of the push path?
>

This patch doesn't introduce the push path issue (the high severity one).
The medium severity issue is a symptom of this pre-existing high one.
Both need a GSO skb of 164 bytes or less sent on an idle TX ring to manifest.
If the preexisting push path bug is ever hit, the stats added by this patch
would cause hw_gso_wire_packets to be over-reported by gso_segs - 1 for the
skbs which take the push path.

I think this patch can be merged as is.
If it's worth fixing, the push path issue can be addressed independently
with a one line change in bnxt_start_xmit(). With that fix in place, the
stats would also report correctly, with no other change needed.

> 
> -- 
> Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116204313.23023-1-narcisav.kernel%40gmail.com
Technical Details
Message-ID: <av/RAwaDfiQnPmbF@gmail.com>
Path: mbox-mo1.pugleaf.net!news-lax.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-367639-linux-kernel-netdev=dewy.ru
References: <20261116204313.23023-1-narcisav.kernel@gmail.com> <179499144094.3136.198428718668517773@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.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-367639-linux-kernel-netdev=dewy.ru
From: narcisav.kernel@gmail.com (Narcisa Vasile)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next] eth: bnxt: report TX HW GSO queue stats
Date: Thu, 19 Nov 2026 20:48:03 -0800
Organization: Usenet Network
Message-ID: <av/RAwaDfiQnPmbF@gmail.com>
References: <20261116204313.23023-1-narcisav.kernel@gmail.com>
 <179499144094.3136.198428718668517773@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3064598"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ERM/ByUY8928rK+IVnclOZzL5Gg= sha256:OHaj/AZFQanoO2V/3GhuUIto4h+dZnRxESAti2UiFMo=
	sha1:KQv05BUR0DvJ875r8yChDzixTPQ= sha256:kvtyY5Pd/+Zxxs8mI4l4UfTm/y/Y097i3c0S58umUPI=
Content-Disposition: inline
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 479AF115858; Fri, 20 Nov 2026 07:49:04 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
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 RLzCsTkGRN9T;
	Fri, 20 Nov 2026 07:49:00 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-367639-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 0C0F41158AA; Fri, 20 Nov 2026 07:48:51 +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 337DD224138; Fri, 20 Nov 2026 04:48:49 +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=1795150129;
	b=MEP4loFe/OtCfdEAXXXWQTfyudtLZw7f0BxRve8DD4gbMNP/ZtqgDZZIm9YhK1vVRs9b
	 VkMQgBSkV6/xbZkq0JA2qPtFR2ArCnD78JlhybDKOTPH3W+UcmUYJXT4i1sGR0PXRGoQM
	 h5doBo4JDM4D4YDeaIuDhfcbkE3jGvJeE2rAjLVU3Q1I4Z1d1wr3OFSfooKmwr6P1lrxb
	 SzlXmxT6TtojZCjtHx2dxH2KnHQFrbyYAyVfp2CnEGpuepcCkt+LQHCoWl5aNoSFiClEv
	 +v6FxNv7RWNjdF4NBfYvUyf1P16Kq3Q28W2C8axwe2fS6OL1fcVrGgEpoeCPGa6sjfA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795150129;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:Date:From:To:Cc:Subject:Message-ID:
	 References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Disposition:Content-Transfer-Encoding:In-Reply-To;
	bh=DRQ8FJYGIZUkw4F+I+/Zgmh7s38pPQn6pzLuYXKpMfs=;
	b=e/blBEXSsFubmGz/Sk4qWFESsurOH4QQon5oeoiN4b9YJ5EIQkVt+3m2LswjCZpENmeO
	 VizYvplnIXUpGRcX3NBlBiZ8EaxKa1sjqBIbpnfAFoIN79Od/r2J24kY6wUumh4X/phLT
	 +qH/FrVfmjvUkmU2ClnyJ7L/MvtkXveeHQVMemxBNIxIUxmmzoxIrey32Ll+cfI9Y0Imb
	 CM1c9sXVDOuXixoGFNPrCIwEXBSdu2WvBYYlF6lDure1EeRKK9pVYjRGLxf2mFSUqiOM5
	 m9yV2ETTJO++EByso+v09f8qG4FZiWfRiZ1nKavKQBmYm99z1FOnQByUftApD0F1d3Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=a1eR9bRU;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	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 0B99F60A2611;
	Fri, 20 Nov 2026 04:48:49 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=a1eR9bRU
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.46
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795150128;
	b=lSF5iMF07kc6H/99SMD/hVM5fPHYQ9xpgas9Whca2Te5RjBlw9LXFNHxZ6J8J1rrYWuv
	 aF7TslbGi4JKP7/c+jzNM0RjhDej9E4wVxR2Qcam4z8p09w5FCKTlkKcjJKudB1v94xkY
	 R3+X8kwjfCOBrsgB3H4E+dm6Shmjsk9mJvhlSuQHHbxyOsXUlyR0SJe8Sjy0KThow3U8S
	 xFkHynRh57jgNtEY1/sPsMSc7Ld+8mWqRnMIeJvzAr7e0omVV4dAGyhKhewMZbzPWsKMW
	 kUPdALLiWDJrR5sWDgbqsVDcLubs9gISq5MLQBeEOtHM6JL+JDZoWjXCcyXaXvBd9DQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795150128;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:Content-Transfer-Encoding:
	 In-Reply-To;
	bh=DRQ8FJYGIZUkw4F+I+/Zgmh7s38pPQn6pzLuYXKpMfs=;
	b=k/fXWokYiqwpX/7BOcYaDGRIc8hCkZFe5kUfg4blrwrCCFbr7tuMLr0lvO55EO3IxNq5
	 FogNVVlQDISUfcPu3LnAx95mMBfCOs+Ixw7k4tSUkP4S+KIkVypSGwwPMnAPBC/+Xhj9y
	 0cgZs5cUSPdzePMMHpD8z4y7FIRv4+vrRa7QpF6ZLRKCZhvL1FzJEMVnS0t3ZvzmZw2mS
	 cNcEJTp2JByb0y87d8HIquQWKIKKOCabtZ4u7Tn2KSOhkMFVTMSphYaSoprxRvsq+KkA+
	 B54tt2GgDdbqtLxJPnX1Nv2JqQsl3SFkheJOZnDZfxYINp97JJvvY0zSd8Ld9z78ZoA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=a1eR9bRU;
	arc=none smtp.remote-ip=74.125.82.46
X-Received: from mail-dl1-f46.google.com (mail-dl1-f46.google.com [74.125.82.46])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id B586A606A33E
	for <netdev@vger.kernel.org>; Fri, 20 Nov 2026 04:48:47 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B586A606A33E
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dl1-f46.google.com with SMTP id a92af1059eb24-1b3b4944a0eso445541c88.0
        for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 20:48:47 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1795150127; x=1795754927; darn=vger.kernel.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :content-type:mime-version:references:message-id:subject:cc:to:from
         :date:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=DRQ8FJYGIZUkw4F+I+/Zgmh7s38pPQn6pzLuYXKpMfs=;
        b=a1eR9bRUgrHLFXzjPI0/J37qkzhcDJ6vQhaX0eYOSoBcAofQNz4LAWcL8koUKFBSCA
         UKTOHCsl/jFThHWhR3uOouyLaagiyrV1R5Bs5QJga2dYScelfvrHq+4nP6W2mxm+2yWa
         Ps3HEVjMpahzvtZgUrjHsbWVDck8ZN67Oxc+nxFd+x0pEze3L3Q0kTbQb9OepwZSt+4m
         rKmnPD+jt8yNoQ96ZzHSAix/ySc3o/gGPyQ/uMnkEdc+8/aYVXUAZFS1odFd7XEiCYUM
         4Vy2XVVghXdcJ9xjPNN0zNZfh+6bYi5XM/cOXqWYOOj4fWmmELmkos0okFeD0gJW8ZuV
         LMvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1795150127; x=1795754927;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :content-type:mime-version:references:message-id:subject:cc:to:from
         :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=DRQ8FJYGIZUkw4F+I+/Zgmh7s38pPQn6pzLuYXKpMfs=;
        b=TIzXPrVxDj7UE7ltkRWgShuMTlee9aG08bPkfjla+Sk1uEBo3bGmLsQV63LaWAGklU
         u8t3UKWdnEGtB+odj5i3kcAxnEc5sIxqSQEffyQpUyM5wcolhqAgtCPiiLL8CsW3ww/9
         cnUn30GT9S+/b3RnDZ9JblyZvZ4MG0q/LhibWOj8FXrPVOTtGBjaGNdRYNdbz0O9D6a6
         NdvbdWT43H4KVLjTeNIESHhlmHoQhOYy5UeJcJV+U8RuQHmddUNgiprmdy8n1CjWVBnR
         1VcrnkPthcyd4ktzKeg+g9G79kYqwhzIKjYc5mdlzs860OhX6+1kIYigWVh6Br+4uNQK
         bIQg==
X-Forwarded-Encrypted: i=1; AL+hErEaijjN1NQJkweY3/TnXF37Aivc0BcH22abAmEcWtSRmRiphpkyWIBF9+rfnB32vnr8szyrOZg=@vger.kernel.org
X-Gm-Message-State: APuU4Z8+EwFyQU6b7a/x33Isy/M/Gm5tJ3Iv6ir0l+M3JjGEUT/d5D2s
	EVcec/VbT0rOR25CfxoDTVe6C8KPQlan8eK8DuKVXvFWTR/WZawcW90O
X-Gm-Gg: AYBFou1VOgquIJsMeBf5uFmGEjdBkQdXiWREoPmSVxKIxX+zAe+dlScqPUvln4rWCZa
	p82M6TujdwBUFM2v3wk6sUXXfnbyG7zhE11yMa0+jpVyRP4UxNdAFp7szF8eu/IS5n2/aQbZPRo
	GoOTWVRIm/nW1dIo6wC3YjYzxvT+LN4+J/7Qcgddq+HU+YFngbSwjOirMOo2b6oMmwGtcWlQiLh
	YMXxFWxcxGIsta+hRQtkHPnBKAdIMEYgG4UarLm9DFMnNZJNv3nFCjWWBrt5+2cE1HFyyQDA3Z9
	qu0TSfagJuIvCSj4fPiBE5MUifzh82IoggkAuDfngFM8QtvOhb1nx9xIWKKdTlFiTpHvbLDL2EN
	5MefOO6Uyy12ao+W38SIMq10w/O63it5o6aRVqX84Kg/i7cIpPmAMYv/WA5tMVcYVSZJBzLGo1Q
	gG3uQxN4ovwvziBT09EcE5dMNFUGwliKWcnwRiT0YK3CUEsCaAVwfRjljsbJPEmdU0JazKfZsJW
	/iwNtoi/w7s6vL3IAw4ESicUnGUtcyfUeryH7K+B2r5MuF2aAO2EShA1tYnoEPE8oka50DseDDw
	FN1LDxziSX+LsIt7DDggAzE7FkHYtw==
X-Received: by 2002:a05:701b:2901:b0:143:3c9f:10a6 with SMTP id a92af1059eb24-1b5567b315cmr1736664c88.4.1795150126565;
        Thu, 19 Nov 2026 20:48:46 -0800 (PST)
X-Received: from gmail.com ([2a03:2880:9ff:64::])
        by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b556847fdasm3953343c88.13.2026.11.19.20.48.45
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 19 Nov 2026 20:48:46 -0800 (PST)
X-Cc: narcisav.kernel@gmail.com, michael.chan@broadcom.com,
	pavan.chebbi@broadcom.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
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
X-In-Reply-To: <179499144094.3136.198428718668517773@kernel.org>