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 CB0F0A0C41; Thu, 16 Sep 2021 11:30:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 619ED4069E; Thu, 16 Sep 2021 11:30:36 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 8FA204003F for ; Thu, 16 Sep 2021 11:30:34 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18G99wms026682; Thu, 16 Sep 2021 02:30:33 -0700 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by mx0b-0016f401.pphosted.com with ESMTP id 3b3wft16mf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Sep 2021 02:30:31 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FPG3yUQBqoaGZZ0WTdHmmCKJ7z1rIl4zq95fxjBk9E9/wamzVU39VCPEe1fAL9sRB0yr0UBV6aLxy8g0INXTv5VlDjx6eosjo64THjUJTDiw8VmkCyx5eWp9uH9N+ytzhK4TrYDkfb3C2kpW9zK9B55YV039JDKSc2hWHQr4RLcsnYzSVzLkBcvDBLbXZBx+FsIA2lQqstOKkRuKBVwb8bnARYB/ggc6m0Z/kK/6O3gZybt5DQaGErbfLtnYByJubWlj5jK3YOl2cL8mvMIaRkC3kUyKXKej7KNj2xhpyItX9IDciyxC799DztV3iIfhZvHVQSsB0UJwOFNQ3CkIRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=aX6L8jL+2zDI09cxnv53WpUHUDL7Y5uq3pz3tenqWxM=; b=lxNiDiwJMWAelQnwm2sSqvl+KLDjRPfqVCbjuAHSwwdRUoRCP4HYRzELaORv5roedwl1PpmlpFnFkhwm7a/PT2jwKtGrHdhugtYGlRVJ3AIsNDTlogh6pU8EyfE8a/yTPdh/8ICTjYAY6sHUaiTlajMyE+mBLS/QNdapReYyqg1x0PfblLSDS8SJlW4PRXXGRLNR9x4yD9ZFaNxRYOaKDKxXu/Sj492kFbpRD05wVa7+i6F8h5xr5EuTxmdelgBv584X+HxAJhFqzxxR1IGU8pXg0Bkg+rx2LA1T2HoEPEPuB4dlLzd69LTyLqs2pUOxjPlRGcayabPEfR7PwYavNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aX6L8jL+2zDI09cxnv53WpUHUDL7Y5uq3pz3tenqWxM=; b=D4rK0Hp9vZCGGhOvu1POZcmaNGe8XGtpTFCXV6n6pp2mr/R6rrjQpFkFKQ5VYkE040qLjKChScq7SK0jmV8RnLAA8raT8xjbpCdfNzvan7A0K0yd+3Anhi2W+DUzREHsURedlzFE5KQQfwDXKwrtDXocuAAekilIPlDtRqEGSlo= Received: from PH0PR18MB4672.namprd18.prod.outlook.com (2603:10b6:510:c9::16) by PH0PR18MB4781.namprd18.prod.outlook.com (2603:10b6:510:ca::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Thu, 16 Sep 2021 09:30:19 +0000 Received: from PH0PR18MB4672.namprd18.prod.outlook.com ([fe80::85aa:3d01:94f6:984]) by PH0PR18MB4672.namprd18.prod.outlook.com ([fe80::85aa:3d01:94f6:984%4]) with mapi id 15.20.4523.016; Thu, 16 Sep 2021 09:30:18 +0000 From: Anoob Joseph To: Radu Nicolau CC: "dev@dpdk.org" , "declan.doherty@intel.com" , "hemant.agrawal@oss.nxp.com" , Akhil Goyal , "Ananyev, Konstantin" Thread-Topic: [EXT] [dpdk-dev] [PATCH v2 4/9] examples/ipsec-secgw: add stats interval argument Thread-Index: AQHXqjkVo8Z3BEbqDUCE6JkbJUxkkqumZCRw Date: Thu, 16 Sep 2021 09:30:18 +0000 Message-ID: References: <20210903112257.303961-1-radu.nicolau@intel.com> <20210915134522.1311843-1-radu.nicolau@intel.com> <20210915134522.1311843-5-radu.nicolau@intel.com> In-Reply-To: <20210915134522.1311843-5-radu.nicolau@intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 22870cbf-160c-4c04-9a1b-08d978f49952 x-ms-traffictypediagnostic: PH0PR18MB4781: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:374; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Zqmn+y59TwHpU3u2RVBmfcou+RaEYxj/J5TMBlf+OCh1nkzdj2FnoI3xYtvKr81srHpaTQGQDb4qWGFrXxCxr/1OP1YZ4NCwQFCE4OHDkFuGkW4BVoQrgq5/NIHtjfzJ9Y/MopRYlNLH3Y49LA3TboN6GoyVmjpiGYbxSdZtgRqORgLzE/FHO3addzUW3gdMVJ0Mw66QyjW5TY9eSrP1Vfw6TLBWrAGd9KpKFVIdTQ89WAuNb8ypsNSS7OuF/aGXtLdSKG41yna9cds/zMtTiVmwU4DBi4Ovo2MdheZs5lcvlRvm4MraNSbnxieYITfrtbyMy6fdyS19Edzs8mZT6F5hnadD4y/FW+1GCthSzAWgn5Gr17IczwuUTNxgeQ8lw93W7bY+QT8LCmjQP1dcooLE/Zcxvj7sWoeKwZxnr7I94CoWyoY8sG7vCs3Qtb8PJRx0omTdJtt42hQGN5oy/LVMk091YpQPgyi5kvOiq026MwCaGWWAwzubtaG4fuDjVkDPG9H9/NyVYNmHwGwlb6pbiP+n2016YATDqnIVZ90rGMM/heiKlH4YtNPU1L3LwijcVfF9ii5o2HvndBJbguNlyDK4nyijd0WB0QwenwqK52V9KIUFteiJ/fLAouxH8zTJQyiLVpXJBNiNEj0CEu1nwoUeN4wqxjqxIeF98w38up2bo1YJuFEboRegbxxAXtD+vjunXukkkRHKf6GDkQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB4672.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(39850400004)(376002)(396003)(366004)(76116006)(55016002)(2906002)(86362001)(7696005)(9686003)(478600001)(66476007)(66556008)(64756008)(71200400001)(66946007)(6916009)(83380400001)(5660300002)(66446008)(8676002)(316002)(52536014)(6506007)(38070700005)(53546011)(26005)(38100700002)(122000001)(54906003)(186003)(33656002)(4326008)(8936002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?+RLTXcjN47a6z++klMI7YjMg/wZVUJp3M8L0z1G8s4FZPeWnRoZXQlvKphmU?= =?us-ascii?Q?baGdY9zaYXbL7n08fvE7DNftusH92mP6pGCQMaIOWZZ1cqrd++q9GHROy7Pb?= =?us-ascii?Q?ekS/aBC7/Susb0W3VorPHt7a/OWpURZ0Aah976wNx2asuaWyxUdHLarCkTZd?= =?us-ascii?Q?Oe35sFELUXesyTnKBSL1QzoNN75z+5J5lIOTVwyDJhrGG6M5DVdzZVBo1V82?= =?us-ascii?Q?OnD7jZdldrk+dj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/FDXPUnGRuVLjTgKLWE?= =?us-ascii?Q?Mn0isYQx1GOe9VSPEzXev8h8xdbqwu56h5D8Wv/t6hxBngP2YBlgLV+sk506?= =?us-ascii?Q?CYKjdRsksotWfit6JSd0wvAW3WR8UODEsLqJpNVsaLDNjA4gtQgcXtPXoQnz?= =?us-ascii?Q?3D0x/pBU9LJ+PmSm2CORJ8nQiVjtgMAQjPgb4xjkLgClXzz8Tbbai9rQ5Bux?= =?us-ascii?Q?/aw=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB4672.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22870cbf-160c-4c04-9a1b-08d978f49952 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Sep 2021 09:30:18.7872 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 4qkO9fBU7dhUt3ZwzofMK4u+cebK515t32mSb4PFU5XL06AHsM5jU3xf5+7cUw1VoDzGmp3bETiZT44RRWg/Bg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR18MB4781 X-Proofpoint-ORIG-GUID: Ti6oNXuDWJJjiVyJtYMbtSVJn2aZRFv2 X-Proofpoint-GUID: Ti6oNXuDWJJjiVyJtYMbtSVJn2aZRFv2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-16_03,2021-09-15_01,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] [PATCH v2 4/9] examples/ipsec-secgw: add stats interval argument 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 Sender: "dev" Hi Radu, Making stats dynamic would have a perf cost. That was the reason it was int= roduced as a compile time option. Why do we need it changed? Also, it looks like this patch is only disabling stats printing when timeou= t is 0. I don't see stats collection being conditional. Stats collection wo= uld also have perf impact, right? Thanks, Anoob > -----Original Message----- > From: dev On Behalf Of Radu Nicolau > Sent: Wednesday, September 15, 2021 7:15 PM > To: Radu Nicolau ; Akhil Goyal > > Cc: dev@dpdk.org; declan.doherty@intel.com; > hemant.agrawal@oss.nxp.com > Subject: [EXT] [dpdk-dev] [PATCH v2 4/9] examples/ipsec-secgw: add stats > interval argument >=20 > External Email >=20 > ---------------------------------------------------------------------- > Add -t for stats screen update interval, disabled by default. >=20 > Signed-off-by: Radu Nicolau > --- > doc/guides/sample_app_ug/ipsec_secgw.rst | 5 ++++ > examples/ipsec-secgw/ipsec-secgw.c | 29 ++++++++++++++++-------- > examples/ipsec-secgw/ipsec-secgw.h | 15 ------------ > 3 files changed, 25 insertions(+), 24 deletions(-) >=20 > diff --git a/doc/guides/sample_app_ug/ipsec_secgw.rst > b/doc/guides/sample_app_ug/ipsec_secgw.rst > index 20bc1e6bc4..0d55e74022 100644 > --- a/doc/guides/sample_app_ug/ipsec_secgw.rst > +++ b/doc/guides/sample_app_ug/ipsec_secgw.rst > @@ -127,6 +127,7 @@ The application has a number of command line > options:: > -p PORTMASK -P -u PORTMASK -j FRAMESIZE > -l -w REPLAY_WINDOW_SIZE -e -a > -c SAD_CACHE_SIZE > + -t STATISTICS_INTERVAL > -s NUMBER_OF_MBUFS_IN_PACKET_POOL > -f CONFIG_FILE_PATH > --config (port,queue,lcore)[,(port,queue,lcore)] > @@ -176,6 +177,10 @@ Where: > Zero value disables cache. > Default value: 128. >=20 > +* ``-t``: specifies the statistics screen update interval. If set to z= ero or > + omitted statistics screen is disabled. > + Default value: 0. > + > * ``-s``: sets number of mbufs in packet pool, if not provided number = of > mbufs > will be calculated based on number of cores, eth ports and crypto qu= eues. >=20 > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec- > secgw/ipsec-secgw.c > index 265fff4bef..60b25be872 100644 > --- a/examples/ipsec-secgw/ipsec-secgw.c > +++ b/examples/ipsec-secgw/ipsec-secgw.c > @@ -181,6 +181,7 @@ static uint32_t frag_tbl_sz; static uint32_t > frame_buf_size =3D RTE_MBUF_DEFAULT_BUF_SIZE; static uint32_t mtu_size > =3D RTE_ETHER_MTU; static uint64_t frag_ttl_ns =3D MAX_FRAG_TTL_NS; > +static uint32_t stats_interval; >=20 > /* application wide librte_ipsec/SA parameters */ struct app_sa_prm > app_sa_prm =3D { @@ -292,7 +293,6 @@ adjust_ipv6_pktlen(struct rte_mbuf > *m, const struct rte_ipv6_hdr *iph, > } > } >=20 > -#if (STATS_INTERVAL > 0) >=20 > /* Print out statistics on packet distribution */ static void @@ -352,9= +352,8 > @@ print_stats_cb(__rte_unused void *param) > total_packets_dropped); >=20 > printf("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D\n"); >=20 > - rte_eal_alarm_set(STATS_INTERVAL * US_PER_S, print_stats_cb, > NULL); > + rte_eal_alarm_set(stats_interval * US_PER_S, print_stats_cb, NULL); > } > -#endif /* STATS_INTERVAL */ >=20 > static inline void > prepare_one_packet(struct rte_mbuf *pkt, struct ipsec_traffic *t) @@ - > 1435,6 +1434,7 @@ print_usage(const char *prgname) > " [-e]" > " [-a]" > " [-c]" > + " [-t STATS_INTERVAL]" > " [-s NUMBER_OF_MBUFS_IN_PKT_POOL]" > " -f CONFIG_FILE" > " --config (port,queue,lcore)[,(port,queue,lcore)]" > @@ -1459,6 +1459,8 @@ print_usage(const char *prgname) > " -a enables SA SQN atomic behaviour\n" > " -c specifies inbound SAD cache size,\n" > " zero value disables the cache (default value: 128)\n" > + " -t specifies statistics screen update interval,\n" > + " zero disables statistics screen (default value: 0)\n" > " -s number of mbufs in packet pool, if not specified > number\n" > " of mbufs will be calculated based on number of cores,\n" > " ports and crypto queues\n" > @@ -1666,7 +1668,7 @@ parse_args(int32_t argc, char **argv, struct > eh_conf *eh_conf) >=20 > argvopt =3D argv; >=20 > - while ((opt =3D getopt_long(argc, argvopt, "aelp:Pu:f:j:w:c:s:", > + while ((opt =3D getopt_long(argc, argvopt, "aelp:Pu:f:j:w:c:t:s:", > lgopts, &option_index)) !=3D EOF) { >=20 > switch (opt) { > @@ -1747,6 +1749,15 @@ parse_args(int32_t argc, char **argv, struct > eh_conf *eh_conf) > } > app_sa_prm.cache_sz =3D ret; > break; > + case 't': > + ret =3D parse_decimal(optarg); > + if (ret < 0) { > + printf("Invalid interval value: %s\n", optarg); > + print_usage(prgname); > + return -1; > + } > + stats_interval =3D ret; > + break; > case CMD_LINE_OPT_CONFIG_NUM: > ret =3D parse_config(optarg); > if (ret) { > @@ -3350,11 +3361,11 @@ main(int32_t argc, char **argv) >=20 > check_all_ports_link_status(enabled_port_mask); >=20 > -#if (STATS_INTERVAL > 0) > - rte_eal_alarm_set(STATS_INTERVAL * US_PER_S, print_stats_cb, > NULL); > -#else > - RTE_LOG(INFO, IPSEC, "Stats display disabled\n"); > -#endif /* STATS_INTERVAL */ > + if (stats_interval > 0) > + rte_eal_alarm_set(stats_interval * US_PER_S, > + print_stats_cb, NULL); > + else > + RTE_LOG(INFO, IPSEC, "Stats display disabled\n"); >=20 > /* launch per-lcore init on every lcore */ > rte_eal_mp_remote_launch(ipsec_launch_one_lcore, eh_conf, > CALL_MAIN); diff --git a/examples/ipsec-secgw/ipsec-secgw.h > b/examples/ipsec-secgw/ipsec-secgw.h > index f3082a1037..de9f382742 100644 > --- a/examples/ipsec-secgw/ipsec-secgw.h > +++ b/examples/ipsec-secgw/ipsec-secgw.h > @@ -6,9 +6,6 @@ >=20 > #include >=20 > -#ifndef STATS_INTERVAL > -#define STATS_INTERVAL 0 > -#endif >=20 > #define NB_SOCKETS 4 >=20 > @@ -144,38 +141,26 @@ is_unprotected_port(uint16_t port_id) static inlin= e > void core_stats_update_rx(int n) { -#if (STATS_INTERVAL > 0) > int lcore_id =3D rte_lcore_id(); > core_statistics[lcore_id].rx +=3D n; > core_statistics[lcore_id].rx_call++; > if (n =3D=3D MAX_PKT_BURST) > core_statistics[lcore_id].burst_rx +=3D n; -#else > - RTE_SET_USED(n); > -#endif /* STATS_INTERVAL */ > } >=20 > static inline void > core_stats_update_tx(int n) > { > -#if (STATS_INTERVAL > 0) > int lcore_id =3D rte_lcore_id(); > core_statistics[lcore_id].tx +=3D n; > core_statistics[lcore_id].tx_call++; > -#else > - RTE_SET_USED(n); > -#endif /* STATS_INTERVAL */ > } >=20 > static inline void > core_stats_update_drop(int n) > { > -#if (STATS_INTERVAL > 0) > int lcore_id =3D rte_lcore_id(); > core_statistics[lcore_id].dropped +=3D n; -#else > - RTE_SET_USED(n); > -#endif /* STATS_INTERVAL */ > } >=20 > /* helper routine to free bulk of packets */ > -- > 2.25.1