DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: "Stephen Hemminger" <stephen@networkplumber.org>,
	"Sylvia Grundwürmer" <sylvia.grundwuermer@b-plus.com>,
	"Reshma Pattan" <reshma.pattan@intel.com>,
	"Anatoly Burakov" <anatoly.burakov@intel.com>,
	"Jianfeng Tan" <jianfeng.tan@intel.com>
Subject: [PATCH] pdump: do not allow enable/disable in primary process
Date: Wed, 19 Oct 2022 09:37:33 -0700	[thread overview]
Message-ID: <20221019163733.68137-1-stephen@networkplumber.org> (raw)
In-Reply-To: <1f5f87b63b94410fb651546d1b4a0937@b-plus.com>

Attempts to enable or disable pdump in primary process
will fail with core dump because it is not valid to call
rte_mp_request_sync() unless in a secondary process.

Trap the error in the common code used for both enable
and disable requests.

Reported-by: Sylvia Grundwürmer <sylvia.grundwuermer@b-plus.com>
Fixes: 660098d61f57 ("pdump: use generic multi-process channel")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/pdump/rte_pdump.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 98dcbc037bb8..a81544cb5772 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -537,6 +537,12 @@ pdump_prepare_client_request(const char *device, uint16_t queue,
 	struct pdump_request *req = (struct pdump_request *)mp_req.param;
 	struct pdump_response *resp;
 
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+		PDUMP_LOG(ERR,
+			  "pdump enable/disable not allowed in primary process\n");
+		return -EINVAL;
+	}
+
 	memset(req, 0, sizeof(*req));
 
 	req->ver = (flags & RTE_PDUMP_FLAG_PCAPNG) ? V2 : V1;
-- 
2.35.1


  parent reply	other threads:[~2022-10-19 16:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11 15:11 DPDK PDUMP pcapng usage Sylvia Grundwürmer
2022-10-12 15:16 ` Stephen Hemminger
2022-10-19 16:37 ` Stephen Hemminger [this message]
2022-10-21 13:08   ` [PATCH] pdump: do not allow enable/disable in primary process David Marchand

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=20221019163733.68137-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=reshma.pattan@intel.com \
    --cc=sylvia.grundwuermer@b-plus.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).