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 0474CA00C2; Wed, 4 Jan 2023 17:18:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B08242D15; Wed, 4 Jan 2023 17:18:40 +0100 (CET) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by mails.dpdk.org (Postfix) with ESMTP id B658542D28 for ; Wed, 4 Jan 2023 17:18:38 +0100 (CET) Received: by mail-pg1-f172.google.com with SMTP id d10so22538410pgm.13 for ; Wed, 04 Jan 2023 08:18:38 -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=37wqToc71ByGqz7ip1LTx59k51rEWlegfn/AM2zW8+I=; b=MfV9s6xhGDZDZFza0oZBoIvZpDeGl85+bdekPtluHGr9mLinwz/21hKspG/xQvwdyS MGc6f98+tTY8/7cQimrSwJgjYLgy969R0LfSSWq8pQGI31wAphIuNA750BQjgKrChHg6 hplzspswQVVGKVQoOFXWwNOsq3PuoTDrR3V1oamq7KYwrnxoHQDRY3xrxv+ihd0Ih7Z9 YWekZQYdtKXJHR3JkqOIRJutoZPK8SChuXgRKkc2Q5StdHH3jJln+QFvt445ZHfuEi01 bjrK9a3VpXmUz0Jx44MGDK6KQ3BJgA7mODZdV7iIGK4ZtJTv+WIp1tJPl1hIVQOu8VjN InMQ== 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=37wqToc71ByGqz7ip1LTx59k51rEWlegfn/AM2zW8+I=; b=HWDc8/PEkrBonB4ZMD2XM+abOHmaZuhsmDZcP42px6z0kPvzf4syKzRSj+VfkDKCVB 8jb3KtKDTIP/ZEwqfbh7qaCT7hrXmY2itu7HJHuGi/MNB/DG8V2ygueMCF/tXwyK3dVa +YiOK607yhmZX6a8mAqzli8id5iwsfRQBlPSViU50mTVUubpM77dr3tT0IIhJpKfJswN F2g/0zzm3yC1W1HRa++NjNMiSEAG0Q6wsGPjuirjLjMVceHE6pufoylLF8t2u1hzCYMH 8AhX524GN8NYa0hvau9Fx+XKcl6EIaay8HuWXq5s5XZ85t1Q3iUXvwmn/LULxW/HSC2d emhw== X-Gm-Message-State: AFqh2kpsduGXTPFtnZqx7K0xpyni19qi2vtUqLI4DiuezCsBYyhd62vv e2ws2gaokrx2uHDJ6KZ3Rwi//zzNeGwds73mJhY= X-Google-Smtp-Source: AMrXdXsBMoEgINCa9vEDqAvOLtnKh9V7cJw2+UeKeR+I8UZI82ZfyKaGBlLuxHTGxIdsrx8ZCu3I1g== X-Received: by 2002:a62:6345:0:b0:580:cfbc:2902 with SMTP id x66-20020a626345000000b00580cfbc2902mr34948121pfb.1.1672849117902; Wed, 04 Jan 2023 08:18:37 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 08:18:37 -0800 (PST) Date: Tue, 3 Jan 2023 19:04:18 -0800 From: Stephen Hemminger To: Ben Magistro Cc: dev@dpdk.org, ben.magistro@trinitycyber.com Subject: Re: [PATCH 5/6] app/dumpcap: improve per interface arg parsing Message-ID: <20230103190418.22ed1fce@hermes.local> In-Reply-To: <20230102162441.6205-5-koncept1@gmail.com> References: <20230102162441.6205-1-koncept1@gmail.com> <20230102162441.6205-5-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:40 +0000 Ben Magistro wrote: > + > +/* struct representing args for each interface */ > +struct interface_opts { > + const char *intf_arg; > + const char *filter_str; > + bool promiscuous_mode; > + uint32_t snaplen; > +}; > +/* default parameters for interfaces */ > +static struct interface_opts interface_defaults = { > + .promiscuous_mode = true, > + .snaplen = RTE_MBUF_DEFAULT_BUF_SIZE > +}; > +//TODO this can be specified per interface but there are a few places > +// that need more review and possibly refactoring so leaving this one out > +uint32_t snaplen = RTE_MBUF_DEFAULT_BUF_SIZE; > +/* array of interface parameters */ > +static struct interface_opts interface_args[RTE_MAX_ETHPORTS]; There is no need to split the interface_opts into a new data structure. See my fixes patch.