[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aFvpumY2VrER7gDj@boxer>
Date: Wed, 25 Jun 2025 14:21:14 +0200
From: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
To: Jason Xing <kerneljasonxing@...il.com>
CC: Jakub Kicinski <kuba@...nel.org>, <davem@...emloft.net>,
<edumazet@...gle.com>, <pabeni@...hat.com>, <bjorn@...nel.org>,
<magnus.karlsson@...el.com>, <jonathan.lemon@...il.com>, <sdf@...ichev.me>,
<ast@...nel.org>, <daniel@...earbox.net>, <hawk@...nel.org>,
<john.fastabend@...il.com>, <joe@...a.to>, <willemdebruijn.kernel@...il.com>,
<bpf@...r.kernel.org>, <netdev@...r.kernel.org>, Jason Xing
<kernelxing@...cent.com>
Subject: Re: [PATCH net-next v4] net: xsk: introduce XDP_MAX_TX_BUDGET
setsockopt
On Wed, Jun 25, 2025 at 08:19:01AM +0800, Jason Xing wrote:
> On Wed, Jun 25, 2025 at 7:31 AM Jakub Kicinski <kuba@...nel.org> wrote:
> >
> > On Mon, 23 Jun 2025 10:13:45 +0800 Jason Xing wrote:
> > > @@ -424,7 +421,9 @@ bool xsk_tx_peek_desc(struct xsk_buff_pool *pool, struct xdp_desc *desc)
> > > rcu_read_lock();
> > > again:
> > > list_for_each_entry_rcu(xs, &pool->xsk_tx_list, tx_list) {
> > > - if (xs->tx_budget_spent >= MAX_PER_SOCKET_BUDGET) {
> > > + int max_budget = READ_ONCE(xs->max_tx_budget);
> > > +
> > > + if (xs->tx_budget_spent >= max_budget) {
> > > budget_exhausted = true;
> > > continue;
> > > }
> >
> > I still think you're mixing two very different things. In the generic
> > xmit path the value you're changing is a budget. But xsk_tx_peek_desc()
> > *does not* exit after the "per socket budget" gets spent. The per
> > socket budget only controls how many frames we pick from a single sock
> > before we move to the next. But if we run out of budget on all sockets
> > we give every socket a full budget again and start from the first one
On point. Thanks Jakub! Let's stick to generic xmit budget.
>
> Ah, my fault. Thanks for reminding me. I missed the 'refilling budget'
> process...
> For the record:
> xsk_tx_peek_desc()
> -> xs->tx_budget_spent = 0;
>
> > again.
> >
> > For the ZC case the true budget is set by the driver's NAPI loop.
>
> True.
>
> I will remove this one.
>
> Thanks,
> Jason
>
> > --
> > pw-bot: cr
Powered by blists - more mailing lists