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 A5350A00C2; Wed, 4 Jan 2023 17:19:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E707142D33; Wed, 4 Jan 2023 17:18:43 +0100 (CET) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id A6DB842D33 for ; Wed, 4 Jan 2023 17:18:42 +0100 (CET) Received: by mail-pf1-f171.google.com with SMTP id x26so16945805pfq.10 for ; Wed, 04 Jan 2023 08:18:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=nKdx4E7be6RYvYc+RsRu5IIpCtYpUBwrXJUSqFEYgCo=; b=iTIfOA6Phoft6Q4qxPC9moXdsztdyJALpyX+BODNy0DKThQwXvZpll5wDPWAX+6nhz 2jSmwEVmgWLiSkPD54/iBbFlKVWCK4/ruzc/hMwo+8GZOcXefiZvky0ZWwIPbg735kzB qmXUcf7kDHysa+IArxpbT93xl9wyoW8ABGM4ccHkZIfCFbGzjcUf6AhI1VwNC7Bc1ib0 QFDm3WhouqiFEaEShiOtuaE80E8cNLXBmx8ruDgytbOpTslwdYTwY/YpU15gEnm8QHo2 UsfNCXWLNeavmE7tCByJ7gVGxva/Cin6GtmN/5iRbctjQBpTA2JcYPuUzVpMBTtUtNoe hRlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nKdx4E7be6RYvYc+RsRu5IIpCtYpUBwrXJUSqFEYgCo=; b=b7k6B4icYm+rdIbTmmrokBsAZJ/2g/F3OdzfCGdMOty8N/SEBnqOkv/rfMRnf6kJBa +qyLjThbkNCF1Wzcr6M0J7glet/Hs6iujlZwLh+v7UJSm3smKX/iBkAAJaKpEcztb7SE O8cF2o62NWQqOwkKBML45bme+/j1rBIBkbaIDcRxcvxCDbxf7B9eV690BrDzZq+GC/jm qV5YUnGJk4cnnZczbd2WfAe1q9kYr238f9RpKmfW2BVFdLivQF4z0u3tcgo1cEMsqQeI hdsWSRwxayXWdxgTid7j1b3JgwuYMIYAqXlaOSFN1vCJOHgqaF2ohNoEHR1pVPeJNH5u jyGw== X-Gm-Message-State: AFqh2kr67maCrz8IfAKIRBOj9ZLnAhLjUqhJVzVh99/vXIiGScrRkDSn 7smVLpUXw3ejrduSy945m8l4Qw== X-Google-Smtp-Source: AMrXdXujIdn/vCuaDS2WRXdaHyLhpbzTafb+oGE83m/ZLpdQ3eZE5f+6MYPhQwOWjrmEyoNicdp7pg== X-Received: by 2002:aa7:8209:0:b0:581:3328:b468 with SMTP id k9-20020aa78209000000b005813328b468mr30289019pfi.6.1672849121908; Wed, 04 Jan 2023 08:18:41 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id i123-20020a625481000000b00574ebfdc721sm23505962pfb.16.2023.01.04.08.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 08:18:41 -0800 (PST) Date: Tue, 3 Jan 2023 19:01:29 -0800 From: Stephen Hemminger To: Ben Magistro Cc: dev@dpdk.org, ben.magistro@trinitycyber.com, arshdeep.kaur@intel.com, stable@dpdk.org Subject: Re: [PATCH 4/6] app/dumpcap: fix capturing on multiple interfaces Message-ID: <20230103190129.2fc7d7b1@hermes.local> In-Reply-To: <20230102162441.6205-4-koncept1@gmail.com> References: <20230102162441.6205-1-koncept1@gmail.com> <20230102162441.6205-4-koncept1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Mon, 2 Jan 2023 16:24:39 +0000 Ben Magistro wrote: > When selecting interfaces to capture traffic on, only the last interface > specified was being preserved for selection. This turns the interface > argument into an array allowing multiple interfaces to be selected. > > This also adds checks for the capture format so that if multiple interfaces > are selected, the interface information is included in the capture file. > > Fixes: 7f3623a ("app/dumpcap: fix select interface") > Cc: arshdeep.kaur@intel.com > Cc: stephen@networkplumber.org > Cc: stable@dpdk.org > > Signed-off-by: Ben Magistro > --- > app/dumpcap/main.c | 47 +++++++++++++++++++++++++++++++++------------- > 1 file changed, 34 insertions(+), 13 deletions(-) > > diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c > index 26c641df61..dc4d69ff6b 100644 > --- a/app/dumpcap/main.c > +++ b/app/dumpcap/main.c > @@ -65,8 +65,8 @@ static const char *file_prefix; > 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 uint8_t interface_arg_count = 0; /* count of interfaces configured via -i */ > +static const char *interface_arg[RTE_MAX_ETHPORTS]; /*array of interface parameters */ I think it is simpler to just use the existing interfaces array rather than introducing a new data structure. PS: run you patches through check patch, lots of little style issues especially in #1