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 08227A00C2 for ; Wed, 4 Jan 2023 17:18:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CD26342D39; Wed, 4 Jan 2023 17:18:44 +0100 (CET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id AA83542D35 for ; Wed, 4 Jan 2023 17:18:42 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id b145so19094938pfb.2 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=pc1gKY1dXQwrUCxk43A+wXyCR2waNGjDkB7/F3yx1ioRWt0s2D/AN+eNiWMjBZDYqK vwMohW92oJAb1WULtyj8ALN99SzfRnHAp8IqLL2MUEwUu11GzYNCXPb7To0MhZqy38QR 0SBQJ5WL9P32uns+j87lqVZ/F0iMhQ6bPne8LzkjdxOSTQjKOs7k2upPzUvqU5O107Hm 08WrltDbagB8wN2ki9X34FcVyMEzZOQdiKThvE9c7h3mKOfiAHT8dfMjWZMg2RXU7a7l fXJV0le9tpLORIht7oX97y+Y1wYrhsnA/CgVtXNkU/x5zHpEeYVxNnNAfXDYCzgUYVAD dN/Q== X-Gm-Message-State: AFqh2koEk4jSkderRA4r7EC88pYA1pQuahyp3aOD86vlP+8KGDGpW33Y 1HMpXo/TbBCnJF92FDTBIQbI882lkoy0DDDTh+g= 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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