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 4EF32A04F3; Fri, 3 Jan 2020 06:42:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 282FB1C225; Fri, 3 Jan 2020 06:42:29 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id C86AF1C223 for ; Fri, 3 Jan 2020 06:42:27 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0035fH2I032596; Thu, 2 Jan 2020 21:42:27 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=qDhdThxd/DkbhJPQtpD0XLKsHhrJEoN8OEOu8WglbpE=; b=oLexfv5ZVhUGfbZbTDyh3JxGqVilevZwofD347m5faenc74G3ae8ctHyf/gpG3KpjYef LtAbhRk/l0q2F+9BxB8xuyTM2FNfvjx97yaUeUsupYb0H3oD/aRyxkRTMUDJZkyxwooI SlvDMXgW8iCZc+CTwOXyGFb/tg+PHhMo/l1ydf4QobWKmYUXTO213/dOh+N+5ib0wC+L 82k/QxnsGuWP5BAQIKxmD4hVuh8vB11Otbogs3nTgbZvXAdC7BM+JGriD1wCENJ0HSsI 9KO8Uh0ekidpBUAYbtEykoGCGjMkhaQDGfhwZb77EJez591O0/4ZMGDgVu7umFmAJurS xw== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2x67etqgsn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 02 Jan 2020 21:42:27 -0800 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 2 Jan 2020 21:42:24 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 2 Jan 2020 21:42:24 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fE1HDvytPCLhT7bflI+cXJ0QQZ6XwRC4EI8L8aLRwrriHgAe21xnjcyz614cWT4Fd9NKx1Olopwd3cIEWNKNjEIGVkf5L0ihMs9+lV7o57VmY/+KZNQicnIW+qj7ff3SOv6CMhTGyuobMkMi5QCjfi+CjDmfRMoJgLOkjuQ7h2arMtbhtDJkx6ZrP9JOSyrZ2jCxA4rWontU3svmZP+1r5sylwQ75wXhAfxXfeXC+W3bZ/fnW1HT9tfOKELy8aTBQXQxrUrWAK/VfMvcbGPGMJv0vVUO4inT+3BHnZjeGYrubNkJonwzxMTMUva+R8BfXu4SgkeV/RvoEzm5dz6DeA== 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=qDhdThxd/DkbhJPQtpD0XLKsHhrJEoN8OEOu8WglbpE=; b=gMKyfscgBBnqxq8u3qaraOgMiCI9wwo/ZdLnmfOJN5ZJiSQXLKbfrEEuekMCOk4oa96yEO4fvI6IGqo5ryD6EnizMZWVcXstURsDcWe6uUWetTbIA8bE0xKB2S9lEsv/VrnoCsFgN3JihN9WteyMGdGVHL+bdY5IsnI9VsfCo2isbZSLyD+3slUpqD0XRodexyDL6dAs4uVuDW4rtdo+TPY6AKIeC/vGNzMkIEPFry0+rY+pNng8fehnXZZktZ4fCe7Zl0f0J43VHb8ioI5pminiSHA/0kquVi+1MAGqHixkn9eaXFYmKZlHeb3TNv4d2Y05HN4D1w9b/hJSblpSWA== 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=qDhdThxd/DkbhJPQtpD0XLKsHhrJEoN8OEOu8WglbpE=; b=obYlqA7ubdQTVfI0N3z6MY/VDuCGH7s7UBz5S5YZLWTcF0spG8lxBcEiIpQtI/VoqLQ/fsKFkGNBjvti0GqVdYKNlQUsQUtFCq98Z+UkJpoI++puIl0eMyZ8RBeEYOs+FlqKpcHi8ngkxNCzH16leat1UZIXMOZfJi71WoC7tao= Received: from MN2PR18MB2877.namprd18.prod.outlook.com (20.179.20.218) by MN2PR18MB2591.namprd18.prod.outlook.com (20.179.82.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.12; Fri, 3 Jan 2020 05:42:23 +0000 Received: from MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::5db5:d179:8a01:4636]) by MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::5db5:d179:8a01:4636%7]) with mapi id 15.20.2602.012; Fri, 3 Jan 2020 05:42:23 +0000 From: Anoob Joseph To: "Ananyev, Konstantin" , 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: AQHVuax50+IEUvHlXEOF9Cpjli5IsafXIXqQ Date: Fri, 3 Jan 2020 05:42:23 +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-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.140.231.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 65a179d0-911c-43e8-7163-08d7900fb544 x-ms-traffictypediagnostic: MN2PR18MB2591: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1201; x-forefront-prvs: 0271483E06 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(136003)(396003)(376002)(39860400002)(366004)(199004)(189003)(13464003)(76116006)(2906002)(52536014)(26005)(66556008)(66476007)(53546011)(5660300002)(316002)(478600001)(71200400001)(64756008)(66446008)(8936002)(54906003)(81156014)(81166006)(86362001)(9686003)(55236004)(33656002)(186003)(110136005)(7696005)(66946007)(4326008)(55016002)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2591; H:MN2PR18MB2877.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ynYPbNiebusSZ4NoMI9wmYrKW8+P9nzkuPeYMc7rvBZ46TeddvzEw9UcyGFgRKKZDcLNjOjpZ3FmVucM8hdUUO19VOa4d/yAMYwMIq3YiWjTRDg8K7ReZCYGSzWMw/Kt4zzfD8STJfEijoutzg4G0yk3I8NQXxxLbhhCSn8aL38dA8MXt72j5+mDpbJXlobgLS+LKWfNz1QZAWy4/D4zriCjLke4sUUegjcgRa71dQt3tDTFmFA2DA36VYDp2DV5PE8GLNWu9BQPmdASg7TrX447hQ587B7R0NuIx1UFfcykZBmfWQYC4b69rqcm/iFUrxKfWB+bAEV670BnmvndN8DuBsvhRPDSBp1DPeqAKd5SNMdvrxDI3OUhweLbqBTa1K+6HVpWRz7UAKAmTp9T0Mq6axu6nUTG4VZh76QeducPbNZc9mK6WIcLKcTF0zQXTmlMnzQuExlwr391M6jXEfsts3M5KsOedSZJVeMFT+PZb7Q00zra6R1wlQNIynm1 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 65a179d0-911c-43e8-7163-08d7900fb544 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2020 05:42:23.4386 (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: /GtYdh7jyQxMV09r0tHPK7E1LcnG+R3YCpNP9xX5qXpogaCjb204CIG3/9/StL9HWiePPRQWidPlWfzl18GfxQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2591 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2020-01-02_08:2020-01-02,2020-01-02 signatures=0 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" Hi Konstantin, Please see inline. Thanks, Anoob > -----Original Message----- > From: dev On Behalf Of Ananyev, Konstantin > Sent: Monday, December 23, 2019 9:47 PM > 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 > Subject: Re: [dpdk-dev] [PATCH 14/14] examples/ipsec-secgw: add cmd line > option for bufs >=20 >=20 >=20 > > > 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? >=20 > Or, at least try to guess required number of mbufs (like l3fwd, etc., do)= ? [Anoob] Existing code sets the default number of mbufs to 32k, which is lea= ding to higher cache misses on our platform. Also, other example applicatio= ns have 8192 as the minimum. Hence the change. Do you see any perf issues with lowering the default value? Also, I'm fine = with making the default one same as the ones in l2fwd & l3fwd. >From l3fwd: /* * 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) I do understand that we will have to rework the above logic a bit more to h= andle the in-flight packets in cryptodev. What's your suggestion? =20 >=20 > > > > > > > > /* > > > * 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