From: Simon Horman <horms@kernel.org>
To: Narcisa Vasile <narcisav.kernel@gmail.com>
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
Subject: Re: [PATCH net] eth: bnxt: split TX buffers that don't fit in a single BD
Date: Sat, 28 Nov 2026 14:29:52 +0000 [thread overview]
Message-ID: <20261128142952.GH31322@horms.kernel.org> (raw)
In-Reply-To: <awInrBIuavP3Z824@gmail.com>
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
> > <narcisav.kernel@gmail.com> 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!
prev parent reply other threads:[~2026-11-28 14:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 22:38 [PATCH net] eth: bnxt: split TX buffers that don't fit in a single BD Narcisa Vasile
2026-11-20 19:12 ` Michael Chan
2026-11-21 23:22 ` Narcisa Vasile
2026-11-28 14:29 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261128142952.GH31322@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=lixiaoyan@google.com \
--cc=michael.chan@broadcom.com \
--cc=narcisav.kernel@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=sdf@fomichev.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox