From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>, stable@dpdk.org
Subject: [PATCH v2 5/6] pdump: report secondary process failures
Date: Fri, 27 Nov 2026 13:07:07 -0800 [thread overview]
Message-ID: <20261127210806.318387-6-stephen@networkplumber.org> (raw)
In-Reply-To: <20261127210806.318387-1-stephen@networkplumber.org>
The primary broadcasts an enable to every secondary but ignored the
replies, so a secondary that could not install its callbacks only
logged the error. The client was told the enable succeeded and had
no reason to clean up.
Return the first error from the replies. Disable the processes that
did enable, so a failed request leaves nothing holding the ring.
Fixes: 278f945402c5 ("pdump: add new library for packet capture")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/pdump/rte_pdump.c | 44 ++++++++++++++++++++++++++++++++++++++-----
1 file changed, 39 insertions(+), 5 deletions(-)
diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 670ed1bb6a..7472b008e3 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -569,12 +569,13 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
return ret;
}
-static void
+static int
pdump_request_to_secondary(const struct pdump_request *req)
{
struct rte_mp_msg mp_req = { };
struct rte_mp_reply mp_reply;
struct timespec ts = {.tv_sec = MP_TIMEOUT_S, .tv_nsec = 0};
+ int ret = 0, i;
PDUMP_LOG_LINE(DEBUG, "forward req %s to secondary", pdump_opname(req->op));
@@ -582,14 +583,34 @@ pdump_request_to_secondary(const struct pdump_request *req)
strlcpy(mp_req.name, PDUMP_MP, sizeof(mp_req.name));
mp_req.len_param = sizeof(*req);
- if (rte_mp_request_sync(&mp_req, &mp_reply, &ts) != 0)
+ if (rte_mp_request_sync(&mp_req, &mp_reply, &ts) != 0) {
PDUMP_LOG_LINE(ERR, "rte_mp_request_sync failed");
+ return -rte_errno;
+ }
- else if (mp_reply.nb_sent != mp_reply.nb_received)
+ if (mp_reply.nb_sent != mp_reply.nb_received) {
PDUMP_LOG_LINE(ERR, "not all secondary's replied (sent %u recv %u)",
mp_reply.nb_sent, mp_reply.nb_received);
+ ret = -ETIMEDOUT;
+ }
+
+ /* Report the first failure, a secondary has already undone its own */
+ for (i = 0; i < mp_reply.nb_received; i++) {
+ const struct pdump_response *resp =
+ (const struct pdump_response *)mp_reply.msgs[i].param;
+
+ if (resp->err_value != 0) {
+ PDUMP_LOG_LINE(ERR, "secondary failed to %s: %s",
+ pdump_opname(req->op),
+ rte_strerror(-resp->err_value));
+ if (ret == 0)
+ ret = resp->err_value;
+ }
+ }
free(mp_reply.msgs);
+
+ return ret;
}
/* Allocate temporary storage for passing state to the alarm thread for deferred handling */
@@ -668,10 +689,23 @@ __pdump_request(void *param)
PDUMP_LOG_LINE(DEBUG, "primary pdump %s", pdump_opname(req->op));
ret = set_pdump_rxtx_cbs(req);
+ if (ret != 0)
+ goto respond;
/* Primary process is responsible for broadcasting request to all secondaries */
- if (ret == 0)
- pdump_request_to_secondary(req);
+ ret = pdump_request_to_secondary(req);
+
+ /* Undo the processes that did enable, disable ignores the rest */
+ if (ret != 0 && req->op == ENABLE) {
+ struct pdump_request undo = *req;
+
+ undo.op = DISABLE;
+ undo.prm = NULL; /* no filter needed to remove callbacks */
+ set_pdump_rxtx_cbs(&undo);
+ pdump_request_to_secondary(&undo);
+ }
+
+respond:
pdump_send_response(req, ret, bundle->peer);
free(bundle);
--
2.53.0
next prev parent 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 ` [PATCH v2 1/6] ethdev: reject hairpin queue in add first Rx callback Stephen Hemminger
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 ` Stephen Hemminger [this message]
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-6-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