From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 98F06A04F1; Mon, 6 Jan 2020 16:21:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BFF7D1D6C1; Mon, 6 Jan 2020 16:21:50 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A2CED1D6BE for ; Mon, 6 Jan 2020 16:21:49 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jan 2020 07:21:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,403,1571727600"; d="scan'208";a="210812783" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga007.jf.intel.com with ESMTP; 06 Jan 2020 07:21:48 -0800 Received: from orsmsx162.amr.corp.intel.com (10.22.240.85) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 6 Jan 2020 07:21:48 -0800 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX162.amr.corp.intel.com (10.22.240.85) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 6 Jan 2020 07:21:48 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.49) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 6 Jan 2020 07:21:47 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H5cTMhU/qen8xVo7Uencmmb+mKu91CLtB4xsLF+a3Zk2LWEv8f/NA+YweTvfe2uv7NnVSzRmP3O2YeoaGGHlK2WgvUk3TBxAFsJEuQpHVF7aYpyRlaVKSmwbJUjCjbiT4Re60K5MsYuXuiNvl4CQpiY7XQ6zxAc/DFQTK19PaX75TuNOv+EBsf5hjkSXDyHYCdu7B1c2FYLCd5pQKulWEDXW6/KRKQWLRpD/VqjjtWK2Td2+L94jKRQoFUj8uWS+awmc3XdrrT09rYVDPMnG6bWGeIRfCRgvUHxT6fCAzxt5P8ueYwy+NMt4HC4YFmzJ5cw61hN5ZMrGa8kQi/UD6A== 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:X-MS-Exchange-SenderADCheck; bh=FrSUEYjPj4LQbfrhWXP14a/CXxZjDUMLQw7xyTLtSB0=; b=WGc3IAGzqnuvmVDSDc0MV0tF6wlJnRKSpmqvB/ntN/R7pCF69/WhGifsyJSjBZmw3PeiBj3Grhg6b6RH64wY21CxK4/IWhgCRj+sKY6DUKNcKNLEoagraHwbMOJ68xtl487wa3xRNxLqxEqqrZtkOleK6bY6HbtJc4R2CP1yENgavi3SpRtTNIhxGLma+PUjzeA+LYPT8tboqzJsHFEPehj6BTRCpvT6FzPfw3Im2cDZ085stYL5vfI37e3WRdtPzhmSnSFtptL/ivfWSQOGdwVgMtriBXGIkbAVm5zu1yGq5feRIRGTZc11qzxRUd3KtcwtIQBY9BtYSaM2aWuNLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FrSUEYjPj4LQbfrhWXP14a/CXxZjDUMLQw7xyTLtSB0=; b=AD8s8jYSNG/iGwECSvEZtG2I1+WEs6OkNMdzri+YHYL1qL/gZpKyZrmZLx4VrOtr3q1K3dwTu/bATwrJRztznLxGKHyosyj06R3Je8ZB+JRQf5hX9OUpO8rmQgAlY1viGJ0cSCzvctahg2gl3cB6oCDbH2iIGoNGFKzKF4/iM6A= Received: from SN6PR11MB2558.namprd11.prod.outlook.com (52.135.94.19) by SN6PR11MB2669.namprd11.prod.outlook.com (52.135.90.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.12; Mon, 6 Jan 2020 15:21:46 +0000 Received: from SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::4d86:362a:13c3:8386]) by SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::4d86:362a:13c3:8386%7]) with mapi id 15.20.2602.015; Mon, 6 Jan 2020 15:21:46 +0000 From: "Ananyev, Konstantin" To: Anoob Joseph , Akhil Goyal , "Nicolau, Radu" , Thomas Monjalon CC: Lukas Bartosik , Jerin Jacob Kollanukkaran , Narayana Prasad Raju Athreya , Ankur Dwivedi , Archana Muniganti , Tejasree Kondoj , "Vamsi Krishna Attunuru" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 14/14] examples/ipsec-secgw: add cmd line option for bufs Thread-Index: AQHVwfimv1xqY2Iz1UWWsd2+sBjMaKfdw+rA Date: Mon, 6 Jan 2020 15:21:46 +0000 Message-ID: References: <1575808249-31135-1-git-send-email-anoobj@marvell.com> <1575808249-31135-15-git-send-email-anoobj@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2JlMzVhMzQtYjY2MC00ODQyLTkxMzUtZWI1ZDc5OTg1MGRkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibFlQbUdPaVVOWFFDK2NBdXFNbWNYdlh4Z1dXMWthNm1KSkhtRytDKzJVSUxmdlZ2WStNQzJGM2xXSTdvdDB4aSJ9 dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=konstantin.ananyev@intel.com; x-originating-ip: [192.198.151.163] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a407d9d7-9b62-4fd2-2272-08d792bc24ca x-ms-traffictypediagnostic: SN6PR11MB2669: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:660; x-forefront-prvs: 0274272F87 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(39860400002)(396003)(136003)(376002)(346002)(199004)(189003)(52536014)(5660300002)(478600001)(2906002)(4326008)(316002)(9686003)(55016002)(26005)(110136005)(54906003)(186003)(81166006)(81156014)(8936002)(33656002)(6506007)(7416002)(86362001)(66946007)(76116006)(66476007)(66556008)(66446008)(7696005)(64756008)(71200400001); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR11MB2669; H:SN6PR11MB2558.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: B1cSVOhCymh18dCDSJcqsYFQLzZz6a/6USGzNybfGCHOvk6PNkYcqVd7wxtIkurAo0FppBEFVprL74o0dFraN4LNzIecJcdnYbc/R3h8ltVLIg31VFBnrbtD4KPiyO8rRtCIXtLZMe47Zsxt8lBSGpSmslwtSKT7UOEgBEcgjznRjmnHmFh5yLzzf4vXimeIYgcWhuGXNilU/lVqMkGQ4aCuBXK4y1zmTxVyz2H46L93iBa5VgQuRbgp8rOz5lLtA7XBN5CUUiU8iQEtZc4F/OBRwWvCvTn8A/j4g34Fn4GytRVLk0M92NDoffzX0XW+HPVdZ6ELWE68+6h8pcMFvgvD6/NxDLY9yiVgA6BUPbFl+RY8ebWdaL7xFS6Qm3/zjsHxDC+x6x5aD1xgksCXSNmeI6GmGhcPL4dK3Ok72W6QmiNenrB4EvmL8E5jJppT Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a407d9d7-9b62-4fd2-2272-08d792bc24ca X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2020 15:21:46.3459 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: y7r5wiuTipmMIxuiYhP6GEtj6D4wscZlOTY+TzT1zDKYFj7h0NZDNYLbA5kTqpcBSbnLeSZnCECI9va4EsccdoRH90Kfgnu/C4X5KS8YL5Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2669 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 14/14] examples/ipsec-secgw: add cmd line option for bufs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" > > > > Add command line option -s which can be used to configure number of > > > > buffers in a pool. Default number of buffers is 8192. > > > > > > > > Signed-off-by: Anoob Joseph > > > > Signed-off-by: Lukasz Bartosik > > > > --- > > > > examples/ipsec-secgw/ipsec-secgw.c | 23 +++++++++++++++++++---- > > > > 1 file changed, 19 insertions(+), 4 deletions(-) > > > > > > > > diff --git a/examples/ipsec-secgw/ipsec-secgw.c > > > > b/examples/ipsec-secgw/ipsec-secgw.c > > > > index 76719f2..f8e28d6 100644 > > > > --- a/examples/ipsec-secgw/ipsec-secgw.c > > > > +++ b/examples/ipsec-secgw/ipsec-secgw.c > > > > @@ -59,8 +59,6 @@ volatile bool force_quit; > > > > > > > > #define MEMPOOL_CACHE_SIZE 256 > > > > > > > > -#define NB_MBUF (32000) > > > > - > > > > #define CDEV_QUEUE_DESC 2048 > > > > #define CDEV_MAP_ENTRIES 16384 > > > > #define CDEV_MP_NB_OBJS 1024 > > > > @@ -167,6 +165,7 @@ static int32_t numa_on =3D 1; /**< NUMA is > > enabled > > > > by default. */ static uint32_t nb_lcores; static uint32_t > > > > single_sa; static uint32_t single_sa_idx; > > > > +static uint32_t nb_bufs_in_pool =3D 8192; > > > > > > Why to change the default number (behavior) here? > > > Why not to keep existing one as default? > > > > Or, at least try to guess required number of mbufs (like l3fwd, etc., d= o)? >=20 > [Anoob] Existing code sets the default number of mbufs to 32k, which is l= eading to higher cache misses on our platform. Also, other > example applications have 8192 as the minimum. Hence the change. >=20 > Do you see any perf issues with lowering the default value? 8K is not much at all. Ipsec-secgw uses 1K as RXD/TXD num per queue. So just 4RX+4TX queues will already bring it to the edge. With 8+ RX queues app simply wouldn't be able to start. Looks like a change in behavior.=20 > Also, I'm fine with making the default one same as the ones in l2fwd & l3= fwd. Ok. >=20 > From l3fwd: >=20 > /* > * This expression is used to calculate the number of mbufs needed > * depending on user input, taking into account memory for rx and > * tx hardware rings, cache per lcore and mtable per port per lcore. > * RTE_MAX is used to ensure that NB_MBUF never goes below a minimum > * value of 8192 > */ > #define NB_MBUF(nports) RTE_MAX( \ > (nports*nb_rx_queue*nb_rxd + \ > nports*nb_lcores*MAX_PKT_BURST + \ > nports*n_tx_queue*nb_txd + \ > nb_lcores*MEMPOOL_CACHE_SIZE), \ > (unsigned)8192) >=20 > I do understand that we will have to rework the above logic a bit more to= handle the in-flight packets in cryptodev. Yes, plus also will need to take into account size of fragmentation table. > What's your suggestion? I think the best way is to calculate mumber of required mbufs as discussed = above, plus add ability to the user to overwrite this value (cmd-line option). > > > > > > > > /* > > > > * RX/TX HW offload capabilities to enable/use on ethernet ports. > > > > @@ -1261,6 +1260,7 @@ print_usage(const char *prgname) > > > > " [-w REPLAY_WINDOW_SIZE]" > > > > " [-e]" > > > > " [-a]" > > > > + " [-s NUMBER_OF_MBUFS_IN_PKT_POOL]" > > > > " -f CONFIG_FILE" > > > > " --config (port,queue,lcore)[,(port,queue,lcore)]" > > > > " [--single-sa SAIDX]" > > > > @@ -1284,6 +1284,7 @@ print_usage(const char *prgname) > > > > " size for each SA\n" > > > > " -e enables ESN\n" > > > > " -a enables SA SQN atomic behaviour\n" > > > > + " -s number of mbufs in packet pool (default 8192)\n" > > > > " -f CONFIG_FILE: Configuration file\n" > > > > " --config (port,queue,lcore): Rx queue configuration\n" > > > > " --single-sa SAIDX: Use single SA index for outbound > > traffic,\n" > > > > @@ -1534,7 +1535,7 @@ parse_args(int32_t argc, char **argv, struct > > > > eh_conf *eh_conf) > > > > > > > > argvopt =3D argv; > > > > > > > > - while ((opt =3D getopt_long(argc, argvopt, "aelp:Pu:f:j:w:", > > > > + while ((opt =3D getopt_long(argc, argvopt, "aelp:Pu:f:j:w:s:", > > > > lgopts, &option_index)) !=3D EOF) { > > > > > > > > switch (opt) { > > > > @@ -1568,6 +1569,19 @@ parse_args(int32_t argc, char **argv, struct > > eh_conf *eh_conf) > > > > cfgfile =3D optarg; > > > > f_present =3D 1; > > > > break; > > > > + > > > > + case 's': > > > > + ret =3D parse_decimal(optarg); > > > > + if (ret < 0) { > > > > + printf("Invalid number of buffers in a pool: " > > > > + "%s\n", optarg); > > > > + print_usage(prgname); > > > > + return -1; > > > > + } > > > > + > > > > + nb_bufs_in_pool =3D ret; > > > > + break; > > > > + > > > > case 'j': > > > > ret =3D parse_decimal(optarg); > > > > if (ret < RTE_MBUF_DEFAULT_BUF_SIZE || @@ - > > 2792,11 +2806,12 @@ > > > > main(int32_t argc, char **argv) > > > > if (socket_ctx[socket_id].mbuf_pool) > > > > continue; > > > > > > > > - pool_init(&socket_ctx[socket_id], socket_id, NB_MBUF); > > > > + pool_init(&socket_ctx[socket_id], socket_id, > > nb_bufs_in_pool); > > > > session_pool_init(&socket_ctx[socket_id], socket_id, > > sess_sz); > > > > session_priv_pool_init(&socket_ctx[socket_id], socket_id, > > > > sess_sz); > > > > } > > > > + printf("Number of mbufs in packet pool %d\n", nb_bufs_in_pool); > > > > > > > > RTE_ETH_FOREACH_DEV(portid) { > > > > if ((enabled_port_mask & (1 << portid)) =3D=3D 0) > > > > -- > > > > 2.7.4