On Wed, Jun 25, 2025 at 7:31 AM Jakub Kicinski <kuba@xxxxxxxxxx> 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