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 79C70A0032; Mon, 12 Sep 2022 16:50:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1FF60400D4; Mon, 12 Sep 2022 16:50:49 +0200 (CEST) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id 741D54003C for ; Mon, 12 Sep 2022 16:50:47 +0200 (CEST) Received: by mail-pj1-f51.google.com with SMTP id d64-20020a17090a6f4600b00202ce056566so3140617pjk.4 for ; Mon, 12 Sep 2022 07:50:47 -0700 (PDT) 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; bh=CemG4ND2eVnrJolTcXoJvJAuytDGmdaENLvdI3mMlhQ=; b=bDkn1Pqwr3n+0+uuUWD09v+fPLytklp7Hv6qoqLT5YlDnDwd4rPkJK+7U93C7WcqG9 fY2PA+2hH5WJkWmpgmXMyfDLWAzXY73wWM10lnxM7Q6f38Gr4ae+Rd04rHL/QozrHR76 1+khCcN3f3P9RKPFS/F3ZClyAatyjR7qGqQypsp30boaOoJkycgZ0L0HSIgGKg1BjDPP cjGBbyomJ/6V2EDnHuqPpKz+EiAm1zwtT2jCZbw+1L7rxoVZtm7Ar9KOoe+ePGMWa0hh TEeVwf3Mq+Yce0S2N9qv0aZx+CV3GO+KaySqVjuxQQTUjKWb0HnchHIgLvHHPqRdc0mW M/wA== 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; bh=CemG4ND2eVnrJolTcXoJvJAuytDGmdaENLvdI3mMlhQ=; b=faZzg1Xlk+sPFx0YwGfvEiAs92EChNF2ayDr4X730tGecJYRWyEnsGLvypcj1QVeqq Qogp5dx0dGayXWsNqcp7HlJjZnqUa3Kd+bH4EA9bqHw8QMRKSMKjFiLM+5og4JfDlH8t SCBbDxmlGEY/M00fMAN0pMvFpq0JbPdivVsnWySmO63M2YC45RE/vdcc0sLOsNEXJVbX +ugyJ5/DqxVW8yJY2+IHlsZ7PGXyR0O+OGQP/jXdmWy5W+KqVdBZwNEG7uEOO2DOXjRt KpSHBNgjOkO+fR+VYRyDuFIpXlz5Kk0O9XZRAPZKhipSdnYvn4760lKty2GbLttFLd/I ROLQ== X-Gm-Message-State: ACgBeo1Zf3d2dtSTMJAy1oX749hKnrQkwxG2Oled7+tbouKaKwd0lk1N byUOpb5izatNCL0WmNPGztchtD5FaXLKqg== X-Google-Smtp-Source: AA6agR5R3uwbFIw28w/AV7BiGpp9ywoNHgfWxfuP5I6yI8ewPhfRqyYtdVNkmrx6zV5uoLVxl3tYug== X-Received: by 2002:a17:90b:4c0a:b0:202:54cc:6d5 with SMTP id na10-20020a17090b4c0a00b0020254cc06d5mr23934998pjb.121.1662994246539; Mon, 12 Sep 2022 07:50:46 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id n18-20020a170903111200b00174d4fabe76sm6091851plh.214.2022.09.12.07.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 07:50:46 -0700 (PDT) Date: Mon, 12 Sep 2022 07:50:44 -0700 From: Stephen Hemminger To: Arshdeep Kaur Cc: dev@dpdk.org Subject: Re: [PATCH v2] dumpcap: add the mutiprocess fileprefix support. Message-ID: <20220912075044.02b0a04a@hermes.local> In-Reply-To: <20220912124309.233363-1-arshdeep.kaur@intel.com> References: <20220829074821.283063-1-arshdeep.kaur@intel.com> <20220912124309.233363-1-arshdeep.kaur@intel.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, 12 Sep 2022 05:43:09 -0700 Arshdeep Kaur wrote: > New optional parameter "-m " added. > It will update the mp_socket path for multiprocess communication. > Default : '/var/run/dpdk/rte/mp_socket' > Updated : '/var/run/dpdk//mp_socket' > > Note: Give -m as first argument. > > Signed-off-by: Arshdeep Kaur The args to dumpcap are chosen to be the same as existing wireshark dumpcap. This probably should be long option only. Why not use an environment variable instead? > --- > app/dumpcap/main.c | 23 ++++++++++++++++++----- > 1 file changed, 18 insertions(+), 5 deletions(-) > > diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c > index 8972c45a71..1aa43ad9c1 100644 > --- a/app/dumpcap/main.c > +++ b/app/dumpcap/main.c > @@ -323,7 +323,7 @@ static void parse_opts(int argc, char **argv) > int option_index, c; > > for (;;) { > - c = getopt_long(argc, argv, "a:b:c:dDf:ghi:nN:pPqs:vw:", > + c = getopt_long(argc, argv, "a:b:c:dDf:ghi:nN:m:pPqs:vw:", > long_options, &option_index); > if (c == -1) > break; > @@ -392,6 +392,9 @@ static void parse_opts(int argc, char **argv) > case 'v': > printf("%s\n", version()); > exit(0); > + case 'm': > + /* Handled before dpdk_init */ > + break; > default: > fprintf(stderr, "Invalid option: %s\n", > argv[optind - 1]); > @@ -507,10 +510,10 @@ report_packet_stats(dumpcap_out_t out) > * typical EAL command line arguments. > * We don't want to expose all the DPDK internals to the user. > */ > -static void dpdk_init(void) > +static void dpdk_init(const char * const prefix) > { > - static const char * const args[] = { > - "dumpcap", "--proc-type", "secondary", > + const char * const args[] = { > + "dumpcap", "--proc-type", "secondary", "--file-prefix", prefix, > "--log-level", "notice" > > }; > @@ -787,7 +790,17 @@ int main(int argc, char **argv) > progname = argv[0]; > > parse_opts(argc, argv); > - dpdk_init(); > + char prefix[256]; Slightly short. > + strcpy(prefix, "rte"); > + > + printf("\nIMP:: Please provide -m file_prefix as first argument in case non-default mp_socket path is to be setup (e.g. ./dpdk-dumpcap -m wls_0)\n\n"); Error message should look like other code. > + /* In order to use mp_socket path other than default, give -m as first argument. */ > + if (argc >= 3) { > + if (strncmp(argv[1], "-m", 2) == 0) > + strncpy(prefix, argv[2], sizeof(prefix)); > + } > + > + dpdk_init(prefix); > > if (filter_str) > compile_filter();