[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250624163114.712a9c43@kernel.org>
Date: Tue, 24 Jun 2025 16:31:14 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Jason Xing <kerneljasonxing@...il.com>
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 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
again.
For the ZC case the true budget is set by the driver's NAPI loop.
--
pw-bot: cr
Powered by blists - more mailing lists