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=1795876197; b=ID9b48d35+Z0k+MPUf8/6TLcXrZ5JLMMKaoNQAbbfDUYvj/oTHOzFj9+Uxf3BxFm/LjW YmnsWrSwUadZSutbyTLuWY3ID4tJ2h9b6dHmaitdF1tF5pTZ0UXz8Ak+49sSJsAPhyZ9q v6HmYe848CIYfYoTvAa+OVXxIRUeCTFfbgC/TcKITg3BsgGqPBu71GXq93vNXyldvDcyJ BHwuWoJoDOrk4Vc50YSqbnR/Vv4owXzuhj0gGuOuMiOMrRt2C8yIAaU8NIWnUIFaaKtUm 5hYjDX6RIdXQp1ERJmQNBUGuNvwtWbA6aRlTQHuew/s1WoLRWv4lHwjE5CMLrMgYtog== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795876197; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=LkzrGzH08vIAU9H1Xuti9mApg1OmVyQ9u16MMsB9rPo=; b=RM+pnIjJAe7NHOY0bL0J3j2Ncw5YQG6z1CHm4Eja8yfV763trHzYNqKk3C/bptQs2g2M zup3LgT8fCRPMozoMMU++/JczqcRUlGdKDrnoUOovUbqFBZxrcLQ2em6QDFo7qi0mJ/iY +v9XXbN6U+Qlpr8m6h9ZbmQbgYB032UQo3IbwQ5kT81rzekOG8ljBdyXmVFOmFGmzc1Cm 6Zx5T94DU1Y+sjM2xPAeG9I6K6iragTuajJROWQSnpbv9Rprwggsdo7N+NQBhHtn8sU3i 4SbFfjjZlDn3DVnTEGXA4wXLZcr+SigqkRvfTFzRiHTB19ehCLwleam2DryXycypv4Q== 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=GrgUpI6p; 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 5633C606A31F for ; Sat, 28 Nov 2026 14:29:57 +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=GrgUpI6p Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6B991F0089C; Sat, 28 Nov 2026 14:29:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795876196; bh=LkzrGzH08vIAU9H1Xuti9mApg1OmVyQ9u16MMsB9rPo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=GrgUpI6pc5SkkwWijLiRtN8LvvOhxEVFKYgbP+u0gBgtZ96fNPf1ZIi8VLVdw8aBB 4RFFRNzk98j8533uxb0tsxvdQBVraM0l9aGYlAxFjoiT/GvnurzGJb9Z+WyGKyDf3l ubVzHpLZ/kkJ7Hg855YY0bqO1hr4mdcdFLg17t5kHDeukCHyATcce4L9invVHPf2FS 9MX+ksxSNLAn72iw/3IEUomuyVU1HB3aEvPzlrfkvuSYg0YFB/WHjX+imJS5YoMWj1 BARlMqXqfUpbEbzPHo4Syd2O8HSa8RdMdeaR9NfVzJ99MIANMn+M3Fk360NXfnj9+l 3I0lq/qY524Fw== Date: Sat, 28 Nov 2026 14:29:52 +0000 From: Simon Horman To: Narcisa Vasile Cc: Michael Chan , Pavan Chebbi , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Coco Li , Stanislav Fomichev , netdev@vger.kernel.org Subject: Re: [PATCH net] eth: bnxt: split TX buffers that don't fit in a single BD Message-ID: <20261128142952.GH31322@horms.kernel.org> References: <20261119223854.3050-1-narcisav.kernel@gmail.com> 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 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sat, Nov 21, 2026 at 03:22:20PM -0800, Narcisa Vasile wrote: > On Fri, Nov 20, 2026 at 11:12:28AM -0800, Michael Chan wrote: > > On Thu, Nov 19, 2026 at 2:39 PM Narcisa Vasile > > wrote: > > > > > @@ -546,8 +604,17 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) > > > goto tx_kick_pending; > > > } > > > > > > + /* Data BDs after the long BD and the extended BD */ > > > + nr_bds = bnxt_tx_nr_data_bds(skb); > > > + if (unlikely(nr_bds > TX_MAX_FRAGS)) { > > > + /* bnxt_features_check() makes the stack segment these */ > > > + netdev_warn_once(dev, "SKB needs too many (%d) TX BDs, max supported is %d\n", > > > + nr_bds, TX_MAX_FRAGS); > > > + goto tx_free; > > > + } > > > > Is this check just defensive or can it actually happen? > > It's defensive. It's covered by the check in bnxt_features_check() for > MAX_SKB_FRAGS > 22 and can't trigger for smaller MAX_SKB_FRAGS values. > It's there in case BNXT_TX_MAX_SKB_BDS is ever wrong, so the skb is dropped > instead of the NIC getting a wrong BD count. > Would you prefer I drop it in v2? > > > > @@ -90,6 +91,20 @@ struct tx_bd { > > > > > > #define TX_MAX_FRAGS (TX_MAX_BD_CNT - 2) > > > > > > +/* Largest length that fits in TX_BD_LEN. */ > > > +#define BNXT_TX_MAX_BD_LEN 0xffff > > > + > > > +/* BD length for split buffers, a multiple of 4K so that 64K frags don't > > > + * end with a 1-byte BD. > > > + */ > > > +#define BNXT_TX_SPLIT_BD_LEN (BNXT_TX_MAX_BD_LEN & ~(SZ_4K - 1)) > > > + > > > > 1-byte BD should be fine. Do you see better performance splitting it > > at 60K + 4K? > > Only marginally. With PCIe being the bottleneck, the 0xF000 split showed slightly > higher throughput than 0xFFFF: > TX payload Gbps throughput > 0xF000 0xFFFF difference > 1 flow 28.417 28.412 0.02% (noise) > 8 flows 28.444 28.431 +0.046% 0xF000 > > I used tcp_mmap with MSG_ZEROCOPY from a 2 MB hugepage and set the > MSS with tcp_mmap's -M option to keep every split buffer 4K-aligned. Hi Michael, Maybe things have moved on for some reason that isn't obvious to me. But I am wondering if you could offer some further guidance on the direction you'd like this patch to take? Thanks!