[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL+tcoBQvDJO8n7npQjzKBd6HEZ8KhE08g4hRhqokU-bpTe6tw@mail.gmail.com>
Date: Wed, 25 Jun 2025 08:19:01 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
bjorn@...nel.org, magnus.karlsson@...el.com, maciej.fijalkowski@...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 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
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