DPDK patches and discussions
 help / color / mirror / Atom feed
From: Arshdeep Kaur <arshdeep.kaur@intel.com>
To: dev@dpdk.org
Subject: [PATCH v1] dumpcap: fix select interface
Date: Fri, 14 Oct 2022 13:33:25 -0700	[thread overview]
Message-ID: <20221014203325.32418-1-arshdeep.kaur@intel.com> (raw)

The change to do argument process before EAL init broke
the support of select-interface option. Fix by setting flag
and doing select-interface later.

Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")

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

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index e0a3477d91..11a44ecce4 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -64,6 +64,8 @@ static const char *capture_comment;
 static uint32_t snaplen = RTE_MBUF_DEFAULT_BUF_SIZE;
 static bool dump_bpf;
 static bool show_interfaces;
+static bool select_interfaces;
+const char *interface_arg;
 
 static struct {
 	uint64_t  duration;	/* nanoseconds */
@@ -370,7 +372,8 @@ static void parse_opts(int argc, char **argv)
 			usage();
 			exit(0);
 		case 'i':
-			select_interface(optarg);
+			select_interfaces = true;
+			interface_arg = optarg;
 			break;
 		case 'n':
 			use_pcapng = true;
@@ -796,6 +799,9 @@ int main(int argc, char **argv)
 	if (rte_eth_dev_count_avail() == 0)
 		rte_exit(EXIT_FAILURE, "No Ethernet ports found\n");
 
+	if (select_interface)
+		select_interface(interface_arg);
+
 	if (filter_str)
 		compile_filter();
 
-- 
2.37.1


             reply	other threads:[~2022-10-14 20:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-14 20:33 Arshdeep Kaur [this message]
2022-10-14 20:38 ` Stephen Hemminger
2022-10-14 20:48 ` [PATCH v2] " Arshdeep Kaur
2022-10-17 11:56   ` [PATCH v3] " Arshdeep Kaur
2022-10-17 12:07     ` [PATCH v4] " Arshdeep Kaur
2022-10-17 15:12       ` Stephen Hemminger
2022-10-21 13:01         ` 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=20221014203325.32418-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).