DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>, stable@dpdk.org
Subject: [PATCH v2 1/6] ethdev: reject hairpin queue in add first Rx callback
Date: Fri, 27 Nov 2026 13:07:03 -0800	[thread overview]
Message-ID: <20261127210806.318387-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20261127210806.318387-1-stephen@networkplumber.org>

rte_eth_add_rx_callback() and rte_eth_add_tx_callback() refuse
hairpin queues, but rte_eth_add_first_rx_callback() was missed.
A callback installed on a hairpin queue is never invoked.

Fixes: cf5516696d77 ("ethdev: add hairpin queue")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/ethdev/rte_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 13c82a2783..60dc8aa2c8 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -6234,6 +6234,11 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
 		return NULL;
 	}
 
+	if (rte_eth_dev_is_rx_hairpin_queue(&rte_eth_devices[port_id], queue_id)) {
+		rte_errno = EINVAL;
+		return NULL;
+	}
+
 	struct rte_eth_rxtx_callback *cb = rte_zmalloc(NULL, sizeof(*cb), 0);
 
 	if (cb == NULL) {
-- 
2.53.0


  reply	other threads:[~2026-11-27 21:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 14:16 [PATCH 0/4] pdump: fix capture on ports with hairpin queues Stephen Hemminger
2026-10-28 14:16 ` [PATCH 1/4] ethdev: reject hairpin queue in add first Rx callback Stephen Hemminger
2026-10-28 14:16 ` [PATCH 2/4] pdump: fix error code when adding callback fails Stephen Hemminger
2026-10-28 14:16 ` [PATCH 3/4] pdump: skip hairpin queues Stephen Hemminger
2026-10-28 14:16 ` [PATCH 4/4] pdump: undo partial enable on failure Stephen Hemminger
2026-11-27 21:07 ` [PATCH v2 0/6] pdump: fix bugs related to hairpin queues Stephen Hemminger
2026-11-27 21:07   ` Stephen Hemminger [this message]
2026-11-27 21:07   ` [PATCH v2 2/6] pdump: fix error code when adding callback fails Stephen Hemminger
2026-11-27 21:07   ` [PATCH v2 3/6] pdump: validate queues before installing callbacks Stephen Hemminger
2026-11-27 21:07   ` [PATCH v2 4/6] pdump: release BPF filter on error Stephen Hemminger
2026-11-27 21:07   ` [PATCH v2 5/6] pdump: report secondary process failures Stephen Hemminger
2026-11-27 21:07   ` [PATCH v2 6/6] app/dumpcap: disable capture on the interface that failed Stephen Hemminger
2026-12-01 19:31 ` [PATCH v3 0/8] pdump: fix error handling on failed enable Stephen Hemminger
2026-12-01 19:31   ` [PATCH v3 1/8] ethdev: reject hairpin queue in add first Rx callback Stephen Hemminger
2026-12-01 19:31   ` [PATCH v3 2/8] pdump: fix error code when adding callback fails Stephen Hemminger
2026-12-01 19:31   ` [PATCH v3 3/8] pdump: validate queues before installing callbacks Stephen Hemminger
2026-12-01 19:31   ` [PATCH v3 4/8] pdump: release BPF filter on error Stephen Hemminger
2026-12-01 19:31   ` [PATCH v3 5/8] eal: fix IPC request when no handler is registered Stephen Hemminger
2026-12-01 19:31   ` [PATCH v3 6/8] test/mp: check request with no registered handler Stephen Hemminger
2026-12-01 19:31   ` [PATCH v3 7/8] pdump: report secondary process failures Stephen Hemminger
2026-12-01 19:31   ` [PATCH v3 8/8] test/pdump: check secondary process result 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=20261127210806.318387-2-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox