🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25446

Re: [PATCH net v2] eth: bnxt: split TX buffers that don't fit in a single BD

#25446
From: Joe Damato
Date: Tue, 01 Dec 2026 19:35
51 lines
14095 bytes
On Mon, Nov 30, 2026 at 07:01:58PM -0800, Narcisa Vasile wrote:
> The TX BD length field is 16 bits wide. Since BIG TCP raised
> tso_max_size to GSO_MAX_SIZE, skbs can exceed 64KB.
> A single frag can be 64KB or larger, e.g. with MSG_ZEROCOPY from a huge
> page or in the case of a frag filling a whole 64KB page on arm64.
> 
> The driver silently truncates the length of these oversized buffers.
> For example, a 65536 byte frag becomes a zero length BD, so the NIC sends
> malformed LSO packets or stalls the TX queue.
> 
> Split these buffers over multiple BDs, at the largest 4KB multiple that
> fits a BD (0xF000), so that a 64KB frag (e.g. a full page on 64KB-page
> systems) becomes 60KB + 4KB rather than ending with a 1-byte BD.
> 
> Splitting can add up to 8 BDs to a GSO_MAX_SIZE skb. Raise the minimum
> TX ring size (BNXT_MIN_TX_DESC_CNT) and the point at which the TX queue
> is stopped, so that a packet of the largest size always fits. With
> MAX_SKB_FRAGS at 17, the minimum TX ring size grows from 19 to 27 BDs.
> 
> With CONFIG_MAX_SKB_FRAGS raised above the default, an skb can need more
> data BDs than a packet can have, either because splitting added BDs or
> because it has more than TX_MAX_FRAGS frags. Clear the GSO features of
> such skbs in bnxt_features_check() so the stack segments them, instead
> of dropping or linearizing them in bnxt_start_xmit().

nit: is the commit message above stale since the v2 removed the check?
 
> Found by enabling BIG TCP on a Broadcom NIC host.
> Tested on x86_64 with the tso.py selftest and with tcp_mmap sending
> MSG_ZEROCOPY BIG TCP traffic with frags larger than 64KB.
> 
> Fixes: b6488b161ab2 ("bnxt: Use generic HBH removal helper in tx path")

idk how backports work but IIUC the patch relies on behavior introduced by
commit 3cb430e62c83 ("net: bnxt: Use dma_unmap_len for TX completion
unmapping"), so i think if this is backported to trees before that commit it
might introduce a new bug.

so i think (?) it can only be backported to 7.1 but not further back.

maybe the commit message should say that and add a CC line for stable to
let them know it can only be backported as far back as 7.1.

As an example check [1].

[1]: https://lore.kernel.org/netdev/20260518-b4-unix-recv-wait-hotfix-v2-1-83e29ce8ad31@google.com/

All the above said:

Reviewed-by: Joe Damato <joe@dama.to>
Technical Details
Message-ID: <aw8hd3g3MPOv72O2@devvm20253.cco0.facebook.com>
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375331-linux-kernel-netdev=dewy.ru
References: <20261201030158.28732-1-narcisav.kernel@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375331-linux-kernel-netdev=dewy.ru
From: joe@dama.to (Joe Damato)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2] eth: bnxt: split TX buffers that don't fit in a
 single BD
Date: Tue, 1 Dec 2026 11:35:19 -0800
Organization: Usenet Network
Message-ID: <aw8hd3g3MPOv72O2@devvm20253.cco0.facebook.com>
References: <20261201030158.28732-1-narcisav.kernel@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="1803770"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:4MeWBtOHZdtdkTDE00yjZYlYuq0= sha256:xhh0/m/ggwwAGFIIgfb98gsmLYsezLuuoV3pece33Qk=
	sha1:Gqb393KK2uo1zQ2efXSvtg8TIOA= sha256:3UV/Se3Xyeqd1prE7FCwwRKK7hRg83fQYo+shRKwaRQ=
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 58A05117482; Tue,  1 Dec 2026 22:35:40 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.95
X-Spam-Status: No, score=-2.95 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	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=dama-to.20260707.gappssmtp.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 CQQd_bwaBRUH;
	Tue,  1 Dec 2026 22:35:34 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375331-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=dama.to
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 30C2A11746B; Tue,  1 Dec 2026 22:35:25 +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 1AC9E292B9; Tue,  1 Dec 2026 19:35:23 +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=1796153723;
	b=OoJLhCc3qslQPDVkU1vm+UAfRdy+KXWiGptVNIx1Zmuk6uNfWRJuoNpSDyKHcZmOMLe7
	 M/IWAGGzKVmcPSucS4sLToulzCQssIk/6FenJKAob/MsyN9jYscY2kM91wZtJLW7Xz5ik
	 0ITb2CRw7J3JWBH/JhWRmM8WANnUR89Aov77rrFZ7huSQQs+KGF+l9C2kG5BnBh0+01z5
	 FNU/XbsGIG/gA00NWO0Vi40C9rwxY5bnQxWQ77EmdYSIIGQiXiUJ5tDK4nlaOC/HrRRdp
	 BNEFJdgXMbVrKMdM+OTEGXH6h9j3NB8ncLpYYsVJYhCYkifP7CRJNSHVIP3p/+KXjBg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796153723;
	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:
	 Mail-Followup-To:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=u1xrWIa1w7NYzs5qb1magNwJP2nrX+qrf4qknIwtAgg=;
	b=s5cp6kG2TOz8yC6VyRJpCBxYI4YfX3n7SRfhviZ1kKgj7TLHcFHXKVgqu25VhAeh6QvR
	 tX/2pO1ssO7fvcF6B1CYgPxNitMXkQIJKqUE02PISJ4sZNobpctcSCXdVQNu6/9yv4gos
	 RMG4yCYDV4oNJ5t/Dmh9sVXrYC6Q00PqWSets6clamc5aC27NlRlPsPKS6EAnFkXWVq7d
	 33NTZ0S2Ggxkzf4OYfaKxFrOaAdbfY5o4InuY4EJAlQurFmvk+jtNF2r815MFcaK1MYRQ
	 wLxRRlEHxm8iswjDDXPnCWJHZXtrvtJ9xNyvk3P7BNUVU3uvRxhlvfCfD7vLWg0MRiw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=gO11IBEY;
	dmarc=none header.from=dama.to;
	spf=none smtp.mailfrom=dama.to;
	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 E5A3E606A32C;
	Tue,  1 Dec 2026 19:35:22 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=gO11IBEY
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.173
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796153722;
	b=lhtn4dE7vsdNKi2YHFTdFqvfkJB9cSKTmLE1DUZlw6Dm025BR+5/uEX+dwBF58Iu5PDZ
	 y7rgVR8MNwC0n1+S0dtfEOqw88xAk88Rplotf3LbbWkTM8Wd9pq3MwGg8RpXHlqy1hRkl
	 a4VlnX+wBFqdqFF+aPBNPJUiuN3RlpOL2EF2uLQ5odDPU9xTqJwaFQavgZr+oW5aRPw0A
	 qpYzTWRS6wIMlrqmJ2iKy0naTUSBd9adrlIwYo0LmQBNy5aBK6SPi/H0IpTBxO554SsTL
	 FHI0GKxNch1ZBNZrYnzRekGOpD9qfn38Ctttz2RKwt7VL9ff3FBBL8+sn4nsJIV4EGw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796153722;
	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:Mail-Followup-To:References:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=u1xrWIa1w7NYzs5qb1magNwJP2nrX+qrf4qknIwtAgg=;
	b=mJcaaIBXOj57PcXKt3kUqnrdtQPmjIc+U7UDNxAi0iBZ3cUuWKY99HRlUXiDtN/lXVvX
	 tuPlICq07N9Ju1oYRX49pUOG7DRKZueld5MoEKN3jIbf+kxdLAAl7cKcfvX6LLvSVDL6g
	 BSMjBhlbArtzw3WdOrobCjjMDMFYEyrNWacQVEUcQV0UESIGGATcExv0NltpuOEfF22I1
	 0Hq8Y258o0d0G9T8JR1elqQA3m7NE/tzUFvyhvSjbH/BMNqHAzT1wDoS7B/Y2NTW5OKoY
	 /aSxxjibSzpJIkF31V2BmKRD8/AqBH8JkR4TYNNRwNBKuQ68iA9rxzZny2zSHn83wGQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=dama.to;
	spf=none smtp.mailfrom=dama.to;
	dkim=pass header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=gO11IBEY;
	arc=none smtp.remote-ip=209.85.210.173
X-Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173])
	(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 73148606A31A
	for <netdev@vger.kernel.org>; Tue,  1 Dec 2026 19:35:21 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 73148606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to
X-Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to
X-Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-8a06e79e152so5915042b3a.0
        for <netdev@vger.kernel.org>; Tue, 01 Dec 2026 11:35:21 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=dama-to.20260707.gappssmtp.com; s=20260707; t=1796153720; x=1796758520; darn=vger.kernel.org;
        h=in-reply-to:content-disposition:content-type:mime-version
         :references:mail-followup-to:message-id:subject:cc:to:from:date:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=u1xrWIa1w7NYzs5qb1magNwJP2nrX+qrf4qknIwtAgg=;
        b=gO11IBEYzB/iguRgz6icnj3pLwbEyaMais5gRLBv5vRR1F1J5DZGi7vcMBHp6RiA7O
         57ZTmM375kRATBQGUoqAQsYFUxV+JAi09tOdRUT3CMHYHIKWg6Hh1vNxurQmSjEQicUw
         rlKSi+nmdd6e5JNNY1GEoxPlVr9rUIf9UiL6VB+i+yHDTGpNfbZEYSbvIe0ruvOD95Zc
         7jI1dVH0Sub3tCOhG7Dj5d2XLR5l7oO3sIU6B7W4MULt2o2G20G0KUcJtywner/zxHHl
         FPjCzlmJfmDwOljp3iAH6ARxjrdtPZyAhTQN5+2pm9AjvfvYVV//XDwqjEE3QcwqCY/B
         KPBQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796153720; x=1796758520;
        h=in-reply-to:content-disposition:content-type:mime-version
         :references:mail-followup-to: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=u1xrWIa1w7NYzs5qb1magNwJP2nrX+qrf4qknIwtAgg=;
        b=znNkjsDqP6qM6P3mmialRdVrNg3MDXw+dSadBY+AzeEyaJwkrwEvcLcmw9zsDGUMyD
         VsnENf0+/U4VntM0yK6t7P4UTcj2k1amhmL55RB9TJf8OfajrR5QkUmwBP2AuM2OS9qL
         WMyfXOvd7khaWpt9dkw9Xt0yp5vKnKx9uimgdHTUyFrt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5PlboPqYy7LBOEt7GfoGA==
X-Received: by 2002:a05:6a00:14cc:b0:89f:9ea6:1ddb with SMTP id d2e1a72fcca58-8c87c09e5c9mr34387740b3a.23.1796153720533;
        Tue, 01 Dec 2026 11:35:20 -0800 (PST)
X-Received: from localhost ([2a03:2880:2ff:43::])
        by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c87285ccf4sm19749870b3a.12.2026.12.01.11.35.19
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 01 Dec 2026 11:35:19 -0800 (PST)
X-Cc: Michael Chan <michael.chan@broadcom.com>,
	Pavan Chebbi <pavan.chebbi@broadcom.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Coco Li <lixiaoyan@google.com>,
	Stanislav Fomichev <sdf@fomichev.me>, netdev@vger.kernel.org
X-Mail-Followup-To: Joe Damato <joe@dama.to>,
	Narcisa Vasile <narcisav.kernel@gmail.com>,
	Michael Chan <michael.chan@broadcom.com>,
	Pavan Chebbi <pavan.chebbi@broadcom.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Coco Li <lixiaoyan@google.com>,
	Stanislav Fomichev <sdf@fomichev.me>, netdev@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: <20261201030158.28732-1-narcisav.kernel@gmail.com>