All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	andrii@kernel.org, netdev@vger.kernel.org,
	magnus.karlsson@intel.com
Subject: Re: [PATCH bpf-next] xsk: avoid double checking against rx queue being full
Date: Thu, 19 Feb 2026 11:15:14 -0800	[thread overview]
Message-ID: <aZdhQv_VEc5VgsSU@mini-arch> (raw)
In-Reply-To: <20260218150000.301176-1-maciej.fijalkowski@intel.com>

On 02/18, Maciej Fijalkowski wrote:
> Currently non-zc xsk rx path for multi-buffer case checks twice if xsk
> rx queue has enough space for producing descriptors:
> 1.
> 	if (xskq_prod_nb_free(xs->rx, num_desc) < num_desc) {
> 		xs->rx_queue_full++;
> 		return -ENOBUFS;
> 	}
> 2.
> 	__xsk_rcv_zc(xs, xskb, copied - meta_len, rem ? XDP_PKT_CONTD : 0);
> 	-> err = xskq_prod_reserve_desc(xs->rx, addr, len, flags);
> 	  -> if (xskq_prod_is_full(q))
> 
> Second part is redundant as in 1. we already peeked onto rx queue and
> checked that there is enough space to produce given amount of
> descriptors.
> 
> Provide helper functions that will skip it and therefore optimize code.
> 
> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

Acked-by: Stanislav Fomichev <sdf@fomichev.me>

  reply	other threads:[~2026-02-19 19:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-18 15:00 [PATCH bpf-next] xsk: avoid double checking against rx queue being full Maciej Fijalkowski
2026-02-19 19:15 ` Stanislav Fomichev [this message]
2026-02-20  1:06 ` Jason Xing
2026-02-25  1:20 ` patchwork-bot+netdevbpf

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=aZdhQv_VEc5VgsSU@mini-arch \
    --to=stfomichev@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    /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.