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 4B29FA0C41; Thu, 16 Sep 2021 11:13:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2FDDB4069E; Thu, 16 Sep 2021 11:13:25 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70059.outbound.protection.outlook.com [40.107.7.59]) by mails.dpdk.org (Postfix) with ESMTP id D1B954003F for ; Thu, 16 Sep 2021 11:13:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oLICmS0E1iNwKsws3Rnc9yTBtl9HB1PkdA7cksjccPVT+dIoIMACFxRI9Q8es0ggZ35trZQnEcxW7ObGbQNuK8srmH7dK9gafmYLCG7BghFkz7RmL8hFK+4ksfsd5THdSeB4xAo1lUZXQVa6VDSprc9h2hTNRRjgqtUYIPIkmVsVlRp3Y8J9ep8VEJy3TroL8qJdsAxu6wJ9jAP50BSW/aHsbTSq3hS3qfNhRK/nr78PB2d8ikjsiyFcSprh2j3ixKY2dmsQBCy3CM7GYQDQXJBsaOn+0Iy+1qAB69LJUqV0rIKtlmH0k8/jilCfRhEnAYdOqgMsbX9lDqit3eyDnw== 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=qZm446nVybmzmoyHFUvj6nXO+HXjeG8AacwOMOwm5H0=; b=TM9/GhngUvTvZXhRoVyT6nPBVWSY4mURdQuedGA3Bzhv0nhbUHwwHT3OP3iYGkjC73PZPNlAn5dtWjiKX3i9nWC8IZeVnkm29+Gy76Gm069NM5ckCUl7/yObLwAw4G9hUKk/joT6M08txLjHHdm39o2osusHZBrDzVx5Fu0IKBZYxFbUYjlvIljOExVj09y/o6TTMpR64sMkuK+AmvwOqVR6JiuXMdDO+aK58aLfyCSoiJ7o7F3iTmOjXe6h2o1rOrQErigBcKFYHU8PEzNYo8aK7GRpt87ArB0WGZ+1ITBC8Ws43LF8mr41d+BgsluIUAGg7edvYV9HnlQsJSypXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qZm446nVybmzmoyHFUvj6nXO+HXjeG8AacwOMOwm5H0=; b=SkOLap7lkaFf0F0dzsTgYbP+pg/rDc8N7NAvUVYs/iSvVawviIG5cn+L1NSDcYorWRjDPl7CrnOa3JV69RIEYeGEELn1c5ZQEjmosArVN+n4fO6ZG1njLjXaVr2mG+ZAixWhzmAvShUZCTQsJLJr3yvmvz50nA+qMmKqwA4iOkc= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8741.eurprd04.prod.outlook.com (2603:10a6:10:2df::12) 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:13:22 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%3]) with mapi id 15.20.4523.016; Thu, 16 Sep 2021 09:13:22 +0000 To: Radu Nicolau , Akhil Goyal Cc: dev@dpdk.org, declan.doherty@intel.com References: <20210903112257.303961-1-radu.nicolau@intel.com> <20210915134522.1311843-1-radu.nicolau@intel.com> <20210915134522.1311843-5-radu.nicolau@intel.com> From: Hemant Agrawal Message-ID: Date: Thu, 16 Sep 2021 14:43:13 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <20210915134522.1311843-5-radu.nicolau@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-ClientProxiedBy: SGBP274CA0017.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::29) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.5] (122.161.79.209) by SGBP274CA0017.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Thu, 16 Sep 2021 09:13:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 84561c59-785c-4584-3e7f-08d978f23b47 X-MS-TrafficTypeDiagnostic: DU2PR04MB8741: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:164; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uGsoDwL4qYM7bYU7nbtTVpKOQBxyiWyo3uBojf9jwg8XJgJxYqV8LudW3EtcWcJnDML46YgASyC8MVfqyVxuUTrTDkyhr1JBSxkmK2QxW1pI1kzYuDjdk34tfPT22Fw2CbNPAZcuEaMG0/tv9wL9A88M6YH0QqjFxQZOS2l9u2DyGQ3ajlGFZYmRCqupODdqi3I0M2CNU87Fpe6vT214NyzZUSCsGOG8Mc7dcYJ3WTKLICvBV1F9ko2gVEK4OEeArN0X5KKamRkc7dj7LRHqHCLOIqSrCpbjj1L0CNFDPzQHhsb9oVg5n//vsnUeaZOEUZB7RsrTlHYFwgzFsJp5rNOOebtjp0j4+NLRt5SZqtDlWoR0wEjEdbPdmJxvG692tfB2Ia0ic/oLGDnWmrjEXdLmU6E+Si9q5/BmJEkSh26D59w8lwxLtD/hC+Gv6N+577v9003VAftAQtCJxEB8cNwS0m9Lt8Sox0rVrrnmFgmtWkLru9hJrOXTVS98ujbvMGdTk2z3aECmMMqQ9UwHq1vPtpjwEH2P1zI4o0sxPzwD7LxVG9j0qz8m1yginiKNU+BTghxELQ1vgtvfUqGsokjlglVMukalVByw+QrbBuT2Yb+9/QJwzPcAm6OCyobY7x23gV5IxmXpYZ3Z77E27bf/nxVU0oihGECLlM2SXi/WuSsW9Y0yb/3S+cw7V4Rg3RmHQc6E8IRSvmOzLZu0RI5OwbGos/v7jKQc8NXLgjjRvg3vCZsTJ4lurv1SUepTmy7hcfII/ZBxasXBOeZMIg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(39860400002)(396003)(136003)(346002)(376002)(8936002)(83380400001)(86362001)(186003)(31696002)(956004)(2616005)(31686004)(2906002)(110136005)(6666004)(53546011)(66556008)(66946007)(66476007)(4326008)(55236004)(5660300002)(26005)(38100700002)(6486002)(8676002)(52116002)(478600001)(38350700002)(16576012)(316002)(44832011)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NlBxWXRWVjhhM0k2cWJxOTBZN3hiQ3JiZHN3dXV2MzVlYmlPVEY3Y01PNU5V?= =?utf-8?B?a2M1VmdMUFV1NnBzUUc3Vk9oOXozOWxSZlhWZWVCd0p5RGQrdXp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 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2021 09:13:22.3142 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FqrOnCM0VoaJdBybFtYLb/jLGTJ+4IhEBMx8qH/c0eBqj8sGt1NfWeKTShM6P01TuCAy3s6L5sgULi18i50t7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8741 Subject: Re: [dpdk-dev] [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: , Reply-To: hemant.agrawal@nxp.com Errors-To: dev-bounces@dpdk.org Sender: "dev" On 9/15/2021 7:15 PM, Radu Nicolau wrote: > Add -t for stats screen update interval, disabled by default. > > 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(-) > > 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. > > +* ``-t``: specifies the statistics screen update interval. If set to zero 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 queues. > > 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 = RTE_MBUF_DEFAULT_BUF_SIZE; > static uint32_t mtu_size = RTE_ETHER_MTU; > static uint64_t frag_ttl_ns = MAX_FRAG_TTL_NS; > +static uint32_t stats_interval; > > /* application wide librte_ipsec/SA parameters */ > struct app_sa_prm app_sa_prm = { > @@ -292,7 +293,6 @@ adjust_ipv6_pktlen(struct rte_mbuf *m, const struct rte_ipv6_hdr *iph, > } > } > > -#if (STATS_INTERVAL > 0) > > /* Print out statistics on packet distribution */ > static void > @@ -352,9 +352,8 @@ print_stats_cb(__rte_unused void *param) > total_packets_dropped); > printf("\n====================================================\n"); > > - 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 */ > > 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) > > argvopt = argv; > > - while ((opt = getopt_long(argc, argvopt, "aelp:Pu:f:j:w:c:s:", > + while ((opt = getopt_long(argc, argvopt, "aelp:Pu:f:j:w:c:t:s:", > lgopts, &option_index)) != EOF) { > > switch (opt) { > @@ -1747,6 +1749,15 @@ parse_args(int32_t argc, char **argv, struct eh_conf *eh_conf) > } > app_sa_prm.cache_sz = ret; > break; > + case 't': > + ret = parse_decimal(optarg); > + if (ret < 0) { > + printf("Invalid interval value: %s\n", optarg); > + print_usage(prgname); > + return -1; > + } > + stats_interval = ret; > + break; > case CMD_LINE_OPT_CONFIG_NUM: > ret = parse_config(optarg); > if (ret) { > @@ -3350,11 +3361,11 @@ main(int32_t argc, char **argv) > > check_all_ports_link_status(enabled_port_mask); > > -#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"); > > /* 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 @@ > > #include > > -#ifndef STATS_INTERVAL > -#define STATS_INTERVAL 0 > -#endif > > #define NB_SOCKETS 4 > > @@ -144,38 +141,26 @@ is_unprotected_port(uint16_t port_id) > static inline void > core_stats_update_rx(int n) > { > -#if (STATS_INTERVAL > 0) > int lcore_id = rte_lcore_id(); > core_statistics[lcore_id].rx += n; > core_statistics[lcore_id].rx_call++; > if (n == MAX_PKT_BURST) > core_statistics[lcore_id].burst_rx += n; > -#else > - RTE_SET_USED(n); > -#endif /* STATS_INTERVAL */ > } > > static inline void > core_stats_update_tx(int n) > { > -#if (STATS_INTERVAL > 0) > int lcore_id = rte_lcore_id(); > core_statistics[lcore_id].tx += n; > core_statistics[lcore_id].tx_call++; > -#else > - RTE_SET_USED(n); > -#endif /* STATS_INTERVAL */ > } > > static inline void > core_stats_update_drop(int n) > { > -#if (STATS_INTERVAL > 0) > int lcore_id = rte_lcore_id(); > core_statistics[lcore_id].dropped += n; > -#else > - RTE_SET_USED(n); > -#endif /* STATS_INTERVAL */ > } > > /* helper routine to free bulk of packets */ Acked-by: Hemant Agrawal