From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 576FEA00C2; Fri, 14 Oct 2022 22:35:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E59CA400D4; Fri, 14 Oct 2022 22:35:00 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 32C7C4003C for ; Fri, 14 Oct 2022 22:34:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665779699; x=1697315699; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=fBT7MS0Kx2GMjLzu0UDGQtCVg6GwMY0nsyYhpxWSk/o=; b=MT0sbLKcNsASCxA7zefdhCJFoU/Zdgwyvi2+s5V7M+WMT+cnrkAh9QbF KylfB9ssj5smGcN1X9rZ8J/ENcMC6X2tBpVvneARnVP60k/WU1n0yQE/r Zd1s9PKEOg1hUMgEqHnGZpn0H95YQsiq+1b5kyfM0k9pPVI+RiNL6GTi6 gx7DvZKxpn445PT8vT2qlcXSscPPN/WZUuMpfjXcPFTy4SusLWLD1/jMW WZTe20kCS2KXfGErHKsusJbL3WhwRFOo3/rDbWrbr1e5xtIBk0ttijzjj xxDJkvWlI+xORPVx+SeIplkzQWyXtn6nILyZ8nwa2TC90ceYImMViztbL w==; X-IronPort-AV: E=McAfee;i="6500,9779,10500"; a="285857248" X-IronPort-AV: E=Sophos;i="5.95,185,1661842800"; d="scan'208";a="285857248" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2022 13:34:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10500"; a="622650099" X-IronPort-AV: E=Sophos;i="5.95,185,1661842800"; d="scan'208";a="622650099" Received: from unknown (HELO skx-5gnr-sd6.localdomain) ([10.233.180.92]) by orsmga007.jf.intel.com with ESMTP; 14 Oct 2022 13:34:54 -0700 From: Arshdeep Kaur To: dev@dpdk.org Subject: [PATCH v1] dumpcap: fix select interface Date: Fri, 14 Oct 2022 13:33:25 -0700 Message-Id: <20221014203325.32418-1-arshdeep.kaur@intel.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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