All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Cc: Marat Khalili <qm2k21@gmail.com>,
	Konstantin Ananyev <konstantin.ananyev@huawei.com>,
	Ferruh Yigit <ferruh.yigit@amd.com>,
	dev@dpdk.org, stable@dpdk.org
Subject: Re: [PATCH v2 3/9] bpf: reject Tx callback installation with MT_LOCKFREE
Date: Mon, 19 Oct 2026 16:36:54 -0700	[thread overview]
Message-ID: <20261019163654.08198e1b@phoenix.local> (raw)
In-Reply-To: <a578685e-9312-4d30-8fca-58ba6ec91e94@yandex.ru>

On Mon, 19 Oct 2026 22:22:50 +0100
Konstantin Ananyev <konstantin.v.ananyev@yandex.ru> wrote:

> > The BPF ethdev packet callback synchronization mechanism expects only
> > one dataplane thread per port/queue pair at a time. When
> > RTE_ETH_TX_OFFLOAD_MT_LOCKFREE is enabled, multiple threads can invoke
> > rte_eth_tx_burst() concurrently on the same queue without locks. This
> > breaks the callback parity counter and can lead to use-after-free or
> > deadlocks during BPF program unload.
> >
> > Reject BPF Tx callback installation with -ENOTSUP when
> > RTE_ETH_TX_OFFLOAD_MT_LOCKFREE is enabled on the port or queue.
> > Add a unit test in test_bpf verifying this rejection.  
> 
> Should we be more generic here and reject any TX callbacks for 
> RTE_ETH_TX_OFFLOAD_MT_LOCKFREE devices?

The problem is the flag is poorly defined. Devices today advertise
the capability "sure go ahead and share a queue the PMD won't care"
but do not really treat it as a negotiation flag.


  reply	other threads:[~2026-10-19 23:37 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 18:21 [PATCH 0/9] bpf: clean up and document ethdev callback synchronization Marat Khalili
2026-10-11 18:21 ` [PATCH 1/9] bpf: document packet callback unload sequence Marat Khalili
2026-10-11 18:21 ` [PATCH 2/9] bpf: document ethdev callback threading limitations Marat Khalili
2026-10-11 18:21 ` [PATCH 3/9] bpf: reject Tx callback installation with MT_LOCKFREE Marat Khalili
2026-10-11 18:21 ` [PATCH 4/9] bpf: add callback flag to skip multi-thread check Marat Khalili
2026-10-11 19:48   ` Stephen Hemminger
2026-10-11 20:12     ` Marat Khalili
2026-10-11 18:21 ` [PATCH 5/9] bpf: remove redundant memory barrier on unload Marat Khalili
2026-10-11 19:50   ` Stephen Hemminger
2026-10-11 20:14     ` Marat Khalili
2026-10-11 18:21 ` [PATCH 6/9] bpf: simplify callback inuse tracking to boolean flag Marat Khalili
2026-10-11 19:51   ` Stephen Hemminger
2026-10-11 20:17     ` Marat Khalili
2026-10-11 18:21 ` [PATCH 7/9] bpf: reformat packet callback unload diagram Marat Khalili
2026-10-11 18:21 ` [PATCH 8/9] bpf: use relaxed stores for callback inuse tracking Marat Khalili
2026-10-11 19:52   ` Stephen Hemminger
2026-10-11 20:24     ` Marat Khalili
2026-10-11 18:21 ` [PATCH 9/9] bpf: make callback handle atomic with relaxed access Marat Khalili
2026-10-11 19:54   ` Stephen Hemminger
2026-10-11 20:31     ` Marat Khalili
2026-10-11 20:29 ` [RFC] bpf: fix callback unload with concurrent Tx burst Stephen Hemminger
2026-10-12 21:09 ` [PATCH v2 0/9] bpf: clean up and document ethdev callback synchronization Marat Khalili
2026-10-12 21:09   ` [PATCH v2 1/9] bpf: document packet callback unload sequence Marat Khalili
2026-10-19 20:44     ` Konstantin Ananyev
2026-10-12 21:09   ` [PATCH v2 2/9] bpf: document ethdev callback threading limitations Marat Khalili
2026-10-12 21:44     ` Stephen Hemminger
2026-10-19 21:10     ` Konstantin Ananyev
2026-10-19 23:35       ` Stephen Hemminger
2026-10-20  6:54         ` Konstantin Ananyev
2026-10-12 21:09   ` [PATCH v2 3/9] bpf: reject Tx callback installation with MT_LOCKFREE Marat Khalili
2026-10-19 21:22     ` Konstantin Ananyev
2026-10-19 23:36       ` Stephen Hemminger [this message]
2026-10-12 21:09   ` [PATCH v2 4/9] bpf: remove redundant memory barrier on unload Marat Khalili
2026-10-12 21:09   ` [PATCH v2 5/9] bpf: simplify callback inuse tracking to boolean flag Marat Khalili
2026-10-19 20:50     ` Konstantin Ananyev
2026-10-12 21:09   ` [PATCH v2 6/9] bpf: reformat packet callback unload diagram Marat Khalili
2026-10-12 21:09   ` [PATCH v2 7/9] bpf: use relaxed accesses for callback inuse tracking Marat Khalili
2026-10-12 21:09   ` [PATCH v2 8/9] bpf: make callback handle atomic with relaxed access Marat Khalili
2026-10-19 21:27     ` Konstantin Ananyev
2026-10-12 21:09   ` [PATCH v2 9/9] bpf: add callback flag to skip multi-thread check Marat Khalili
2026-10-13 16:55     ` Stephen Hemminger

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=20261019163654.08198e1b@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=konstantin.ananyev@huawei.com \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=qm2k21@gmail.com \
    --cc=stable@dpdk.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.