All of lore.kernel.org
 help / color / mirror / Atom feed
From: Narcisa Vasile <narcisav.kernel@gmail.com>
To: Michael Chan <michael.chan@broadcom.com>
Cc: Narcisa Vasile <narcisav.kernel@gmail.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, 21 Nov 2026 15:22:20 -0800	[thread overview]
Message-ID: <awInrBIuavP3Z824@gmail.com> (raw)
In-Reply-To: <CACKFLinsQ6xLQMN9d_ZC+gy7S1PvXp2X6AXhwsMvqAeNs8BQ6w@mail.gmail.com>

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.



  reply	other threads:[~2026-11-21 23:23 UTC|newest]

Thread overview: 6+ 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 [this message]
2026-11-28 14:29     ` Simon Horman
2026-11-30 18:32       ` Michael Chan
2026-12-01  3:10         ` Narcisa Vasile

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=awInrBIuavP3Z824@gmail.com \
    --to=narcisav.kernel@gmail.com \
    --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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.