All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Wang Liang <wangliang74@huawei.com>
Cc: bjorn@kernel.org, magnus.karlsson@intel.com,
	maciej.fijalkowski@intel.com, jonathan.lemon@gmail.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, ast@kernel.org,
	daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
	yuehaibing@huawei.com, zhangchangzhong@huawei.com,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] xsk: correct tx_ring_empty_descs count statistics
Date: Mon, 31 Mar 2025 15:03:03 -0700	[thread overview]
Message-ID: <Z-sRF0G43HpGiGwH@mini-arch> (raw)
In-Reply-To: <Z-qzLyGKskaqgFh5@mini-arch>

On 03/31, Stanislav Fomichev wrote:
> On 03/29, Wang Liang wrote:
> > The tx_ring_empty_descs count may be incorrect, when set the XDP_TX_RING
> > option but do not reserve tx ring. Because xsk_poll() try to wakeup the
> > driver by calling xsk_generic_xmit() for non-zero-copy mode. So the
> > tx_ring_empty_descs count increases once the xsk_poll()is called:
> > 
> >   xsk_poll
> >     xsk_generic_xmit
> >       __xsk_generic_xmit
> >         xskq_cons_peek_desc
> >           xskq_cons_read_desc
> >             q->queue_empty_descs++;
> > 
> > To avoid this count error, add check for tx descs before send msg in poll.
> > 
> > Fixes: df551058f7a3 ("xsk: Fix crash in poll when device does not support ndo_xsk_wakeup")
> > Signed-off-by: Wang Liang <wangliang74@huawei.com>
> 
> Acked-by: Stanislav Fomichev <sdf@fomichev.me>

Hmm, wait, I stumbled upon xskq_has_descs again and it looks only at
cached prod/cons. How is it supposed to work when the actual tx
descriptor is posted? Is there anything besides xskq_cons_peek_desc from
__xsk_generic_xmit that refreshes cached_prod?

  reply	other threads:[~2025-03-31 22:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-29  6:15 [PATCH net] xsk: correct tx_ring_empty_descs count statistics Wang Liang
2025-03-31 15:22 ` Stanislav Fomichev
2025-03-31 22:03   ` Stanislav Fomichev [this message]
2025-04-01  2:35     ` Wang Liang
2025-04-01  6:57       ` Magnus Karlsson
2025-04-01  7:39         ` Wang Liang
2025-04-01  7:43         ` Wang Liang
2025-04-01  8:12           ` Magnus Karlsson
2025-04-01  9:33             ` Wang Liang
2025-04-01 11:00               ` Magnus Karlsson
2025-04-02  2:38                 ` Wang Liang

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=Z-sRF0G43HpGiGwH@mini-arch \
    --to=stfomichev@gmail.com \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=wangliang74@huawei.com \
    --cc=yuehaibing@huawei.com \
    --cc=zhangchangzhong@huawei.com \
    /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.