From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796450837; b=cSDXuuziAS9D1Q+QGaH5Y5zkPH3eMQkf/VfGGoxA5jS6U4bTg8I/EeptYssxnr9ltYlt tF5rT1X+CKC28SN1I2kKez06bCarj9xvi5gpTsrnUOm1QknftfZ7gt5TcjkrYQUe5FOWN syg/tiD+/oDxGrMvVTsumD5hhyvAmoYcf+3pVNM33gQPTlKKtCrtqq7eac8ksPNtxejk5 0+E5f5fwa9xb0tOHEpCOxwI+EAaqBrrsw0OW5afXqCcTpkj/MDNDNrUeIEfdEQv8TH+DL 4R3WUOxKwWyOkXm2gKtXi6GZ/9zreXe3Eq3NTxQbugVxj3eh93P1FfOGWhW5EYM6CZg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796450837; 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=f8YbJi7RsQWETJ/Fhwr5bbHLVlnuBTdyNEb9PZsobUc=; b=awIm4zb2Qpt0t//80UOrPjV/0o6T9TB5eXWYpDq7GyK1mhB26BSbmPMqgdc5xvXCXXHP Ew505UCiqKHrf00rkHJOxaeaBqpBqJgKWqIhLEwzJdVAV7iSFNbVpuoISTF7sFgour/Ch ghsqyTMYixjBy+8VbDb6mZ71G5hQ8QCGQgnZH8fF0y+ecid+z8hS3tZkHVx58BHGdbGzt nUDNLslJImIjDDylZHcGh7NtLKMh3Qvs5XRalRMV1myKCniYYAFRhXe9L288Ph2Mg2dwM BP8Twy7CbXavWxmNDAILzWt8+APybhJfSsEXiAitYmz7QjTEhN8s1gy0zVg7H0R3VUQ== 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=okdvIc9v; arc=none smtp.remote-ip=100.103.45.18 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 03E80606A322; Sat, 5 Dec 2026 06:07:16 +0000 (UTC) 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=okdvIc9v Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5F941F0092B; Sat, 5 Dec 2026 06:07:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796450836; bh=f8YbJi7RsQWETJ/Fhwr5bbHLVlnuBTdyNEb9PZsobUc=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=okdvIc9v+/Xu7dx3nHb1fLXiqdt/nTbGBiS1G0SGSV+JIfvfbsZ076DIFV3gASEST 7kvN7ewWWf2mhf0S2uNCUvFMFdGc8O+fHnOK9XMyRxPOXbqgtn/cQTffzcdm70b8IG LRPW5YMs+xDKKpJXfYlqWjlCPdq4MlkQe0OjOgF2p+86OASHVNRciWRKBCtshtKo4A 1LqBVTm5XkJX+CQz441h4Ft9tCqXNN5gChKN+4M06v7IrVjsSD1GKCPqF24S9Nq4uC JSSHxEqhfNqG7mhs8OhmAeOYDxsfiNdt36X3btj2D43B3Rx3pvACRn7jEsD3it0mMu wJqgodYj9V2SQ== Subject: Re: [PATCH net v3] eth: bnxt: split TX buffers that don't fit in a single BD From: netdev-bot+sashiko@kernel.org To: narcisav.kernel@gmail.com Cc: michael.chan@broadcom.com, pavan.chebbi@broadcom.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, lixiaoyan@google.com, sdf@fomichev.me, joe@dama.to, netdev@vger.kernel.org, stable@vger.kernel.org Date: Sat, 05 Dec 2026 06:07:15 +0000 Message-ID: <179645083544.3146.15365685782946424915@kernel.org> In-Reply-To: <20261204060015.15576-1-narcisav.kernel@gmail.com> References: <20261204060015.15576-1-narcisav.kernel@gmail.com> X-sashiko-severity: High Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider. Critical: 0 · High: 1 · Medium: 0 · 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). - [High] When CONFIG_MAX_SKB_FRAGS is raised, the patch keeps an skb within the hardware's 32-BD-per-packet limit (TX_MAX_BD_CNT) with only… -- eth: bnxt: split TX buffers that don't fit in a single BD This patch splits TX buffers that are too long for the 16-bit BD length field into multiple BDs of 0xF000 bytes. It also raises the minimum TX ring size and the queue stop threshold to make room for the extra BDs. When CONFIG_MAX_SKB_FRAGS is raised, it clears the GSO features in bnxt_features_check() for skbs that would need more data BDs than one packet can have. > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c > index 85ce4b2e297ec..fae048021853d 100644 > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c [ ... ] > @@ -14351,6 +14420,12 @@ static netdev_features_t bnxt_features_check(struct sk_buff *skb, > > features = vlan_features_check(skb, features); > > +#if (BNXT_TX_MAX_SKB_BDS > TX_MAX_BD_CNT) > + /* Let the stack segment skbs that exceed the TX BD limit per packet. */ > + if (unlikely(bnxt_tx_nr_data_bds(skb) > TX_MAX_FRAGS)) > + features &= ~NETIF_F_GSO_MASK; > +#endif [Severity: High] Can the BD count taken here end up one lower than the count that bnxt_start_xmit() uses later? validate_xmit_skb() computes the features before the software VLAN insert: net/core/dev.c:validate_xmit_skb() { ... features = netif_skb_features(skb); skb = validate_xmit_vlan(skb, features); ... } TX VLAN insertion can be inactive on bnxt, either through ethtool -K txvlan off or because firmware reports VLAN_ACCELERATION_TX_DISABLED. In that case validate_xmit_vlan() calls __vlan_hwaccel_push_inside(), which ends in skb_push(skb, VLAN_HLEN). That makes skb_headlen() 4 bytes larger, after bnxt_features_check() has already counted the BDs. For example, take nr_frags == 30 and headlen == 65533. bnxt_tx_nr_data_bds() returns 30 here. That is not greater than TX_MAX_FRAGS, so GSO stays enabled. After the push, headlen is 65537 and bnxt_tx_buf_extra_bds() adds one more BD. netif_needs_gso() uses the stale features, so the skb is not segmented. In bnxt_start_xmit(), the linearize check only looks at nr_frags. The recomputed count is never compared with TX_MAX_FRAGS: nr_bds = bnxt_tx_nr_data_bds(skb); ... flags = (bnxt_tx_buf_first_bd_len(len) << TX_BD_LEN_SHIFT) | TX_BD_TYPE_LONG_TX_BD | TX_BD_CNT(nr_bds + 2); Here nr_bds is 31. TX_BD_CNT(33) is masked by TX_BD_FLAGS_BD_CNT (0x1f << 8), so the long BD reports a count of 1 while 33 BDs are posted for one packet. That is also more than the 32-BD limit per packet. Would this hand the NIC the same kind of malformed descriptor chain the patch is meant to prevent? The check is compiled in whenever CONFIG_MAX_SKB_FRAGS >= 23. For 23 to 30 frags, bnxt_features_check() is the only guard against overflow caused by splitting. The v2 changelog removed the bound check in bnxt_start_xmit() because it could not trigger. Should bnxt_features_check() add VLAN_HLEN when a hwaccel tag will be pushed in software? Or should that check come back in bnxt_start_xmit()? With the default MAX_SKB_FRAGS of 17, this path doesn't look reachable. An skb of up to GSO_MAX_SIZE needs at most 27 BDs. -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204060015.15576-1-narcisav.kernel%40gmail.com