DPDK patches and discussions
 help / color / mirror / Atom feed
From: Arshdeep Kaur <arshdeep.kaur@intel.com>
To: dev@dpdk.org
Subject: [PATCH v2] dumpcap: add the mutiprocess fileprefix support.
Date: Mon, 12 Sep 2022 05:43:09 -0700	[thread overview]
Message-ID: <20220912124309.233363-1-arshdeep.kaur@intel.com> (raw)
In-Reply-To: <20220829074821.283063-1-arshdeep.kaur@intel.com>

New optional parameter "-m <fileprefix>" added.
It will update the mp_socket path for multiprocess communication.
Default : '/var/run/dpdk/rte/mp_socket'
Updated : '/var/run/dpdk/<file-prefix>/mp_socket'

Note: Give -m as first argument.

Signed-off-by: Arshdeep Kaur <arshdeep.kaur@intel.com>
---
 app/dumpcap/main.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 8972c45a71..1aa43ad9c1 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -323,7 +323,7 @@ static void parse_opts(int argc, char **argv)
 	int option_index, c;
 
 	for (;;) {
-		c = getopt_long(argc, argv, "a:b:c:dDf:ghi:nN:pPqs:vw:",
+		c = getopt_long(argc, argv, "a:b:c:dDf:ghi:nN:m:pPqs:vw:",
 				long_options, &option_index);
 		if (c == -1)
 			break;
@@ -392,6 +392,9 @@ static void parse_opts(int argc, char **argv)
 		case 'v':
 			printf("%s\n", version());
 			exit(0);
+		case 'm':
+			/* Handled before dpdk_init */
+			break;
 		default:
 			fprintf(stderr, "Invalid option: %s\n",
 				argv[optind - 1]);
@@ -507,10 +510,10 @@ report_packet_stats(dumpcap_out_t out)
  * typical EAL command line arguments.
  * We don't want to expose all the DPDK internals to the user.
  */
-static void dpdk_init(void)
+static void dpdk_init(const char * const prefix)
 {
-	static const char * const args[] = {
-		"dumpcap", "--proc-type", "secondary",
+		const char * const args[] = {
+		"dumpcap", "--proc-type", "secondary", "--file-prefix", prefix,
 		"--log-level", "notice"
 
 	};
@@ -787,7 +790,17 @@ int main(int argc, char **argv)
 	progname = argv[0];
 
 	parse_opts(argc, argv);
-	dpdk_init();
+	char prefix[256];
+	strcpy(prefix, "rte");
+
+	printf("\nIMP:: Please provide -m file_prefix as first argument in case non-default mp_socket path is to be setup (e.g. ./dpdk-dumpcap -m wls_0)\n\n");
+	/* In order to use mp_socket path other than default, give -m as first argument. */
+	if (argc >= 3) {
+		if (strncmp(argv[1], "-m", 2) == 0)
+			strncpy(prefix, argv[2], sizeof(prefix));
+	}
+
+	dpdk_init(prefix);
 
 	if (filter_str)
 		compile_filter();
-- 
2.37.1


  parent reply	other threads:[~2022-09-12 12:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220829074821.283063-1-arshdeep.kaur@intel.com>
2022-09-06 16:31 ` [PATCH] SCSY-192443 Fix DPDK-dumpcap for XRAN Library Pattan, Reshma
     [not found] ` <20220907162659.260812-1-arshdeep.kaur@intel.com>
2022-09-12  8:54   ` [PATCH v2] dumpcap: add the mutiprocess fileprefix support Kaur, Arshdeep
2022-09-12 12:43 ` Arshdeep Kaur [this message]
2022-09-12 14:50   ` Stephen Hemminger
2022-09-12 19:03   ` [RFT] dumpcap: add file-prefix option Stephen Hemminger
2022-09-16  8:19     ` Kaur, Arshdeep
2022-09-16 12:51       ` Ben Magistro
2022-09-16 15:35         ` Stephen Hemminger
2022-09-19 11:19           ` Kaur, Arshdeep
2022-09-23 11:46       ` Kaur, Arshdeep
2022-10-17  5:08     ` Kaur, Arshdeep
2022-10-20 10:43       ` Kaur, Arshdeep
2022-10-20 15:40         ` Stephen Hemminger
2022-10-20 11:55     ` Kaur, Arshdeep
2022-10-21 13:07       ` 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=20220912124309.233363-1-arshdeep.kaur@intel.com \
    --to=arshdeep.kaur@intel.com \
    --cc=dev@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;
as well as URLs for NNTP newsgroup(s).