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 60F97A0524; Thu, 30 Jan 2020 17:28:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3E4D01C045; Thu, 30 Jan 2020 17:28:37 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 0E0EC1C044 for ; Thu, 30 Jan 2020 17:28:35 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00UGK4Ct008610; Thu, 30 Jan 2020 08:28:35 -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=dkURHcHEn+l+5EmtM4y4delmQsyjUayNGw4wNKDFmRU=; b=K1olf+G5BVLql+wFE4x6Z0SYtKquxxDagaLjPrZHhjJvSNcE1INyeBVP35/wFU6Tkrrd Wb2C6oKmNsKQyYVtmVvLqwyTNybt2M50FJVwHH39rmcYA0jdw81sYrRTz8/KNhvEudkt rqzmGARzdKLHyY3i0GKvrxT6n2YlCDtlEJmkanQu051s8ePFhKk9NX+L+cQgjAeVQzm6 leP3NUpR/0MPjkReQ9eDJ1Eqn9qOiFC3VL/KnXZls8UAOTqWjH/MxrhbIir8K4os2EZb Q4yRbfi720KH+bZrGgbFdSM0dzEZyDQtmi1jHhK/61+xJ8q8oaa/47P5SG8GYL/Hbw8W /A== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2xupkhtw3m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 30 Jan 2020 08:28:35 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 30 Jan 2020 08:28:33 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 30 Jan 2020 08:28:33 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YKX2Q423P3ntH4Y1IxIeBK1HtNjpD+LYFbKlCdWmWFmkFddIyluBwxy1/inhC/IoByyKOnx+Ggdd7ewqh2eT9CCFin46HOsLOTpV2sX3XVnSwnvJqCfGdpPlFrTaShwzy5/zJYi9Zi0x2W/Fr0kiLZ/2gW8sWo56uC8dzFItuSts46FYH+EIaMPQPOC+EHQgw5ocvCvSRXU6BBPSHnK7H54Hv+eiRyME0DsQekWADmoJlqFCjug3Jl8F1e2KGFZKRHAJ3QnZVI7OUQ7OV5QjyfGcJY0CKLsRmC2Dve+HgOMgucicZiDWNmdBMDADe7bDlWdCykk3vnr3Fx4FWRZZkw== 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=dkURHcHEn+l+5EmtM4y4delmQsyjUayNGw4wNKDFmRU=; b=RnXTrGEW4SUt+uFkUpw/nrmuVX2ZC7aT3YvG0EA55rT/o2hNbUpBPyJ0VeK0Wpk5pJXxederC1U9Bgh7PyFfszmF4iJKncY15t3d1c96qjX0PU4eJbhOQOGo9hbr9hHQQqomA+dxiy7DYLYSnRX7VuttXzscfUORtzJv98VxA+2k6bHo6qptlrFHBbLs7VhwjsWF2Gg/j2IkYG2aQGkF47ij2OjrRB8nd3+rTRUuG1TWL9o8NpbZ5sANqhCxohHr9NKv7w3B+NhA8y6x0fK6C0I8qZhlSY348NsyvwheNVbQe/e3vITyml+WDgvrHzvBwHIA2ntZljs0lh0VG7z/7Q== 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=dkURHcHEn+l+5EmtM4y4delmQsyjUayNGw4wNKDFmRU=; b=RBRZuCAYkIqxQ/9NgkwHk2/WAR+pTK/0ebzLf2fTxLYaaedRQR8S8OacGe/WPStzn2vLim7LhuG+h/Mo9NgdulA2cKGinzEejua1KF3inPLKwwVkCHggHd65hQubtNCaXUxx41jQjMhWeQaTMYK0EcPCkciZcyib3eN6cAapEVI= Received: from MN2PR18MB2877.namprd18.prod.outlook.com (20.179.20.218) by MN2PR18MB3152.namprd18.prod.outlook.com (10.255.239.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2665.24; Thu, 30 Jan 2020 16:28:32 +0000 Received: from MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::e48d:494:fc46:3572]) by MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::e48d:494:fc46:3572%7]) with mapi id 15.20.2665.027; Thu, 30 Jan 2020 16:28:32 +0000 From: Anoob Joseph To: "Ananyev, Konstantin" , Akhil Goyal , "Nicolau, Radu" CC: Jerin Jacob Kollanukkaran , Lukas Bartosik , Narayana Prasad Raju Athreya , "dev@dpdk.org" Thread-Topic: [PATCH] examples/ipsec-secgw: increase number of qps to lcore_params Thread-Index: AQHVx8TYVDK8x5pEckiwirDv9/IQuKgCUt6AgAEuDPA= Date: Thu, 30 Jan 2020 16:28:32 +0000 Message-ID: References: <1578667598-18942-1-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: [27.34.250.227] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9e670bb8-e731-4c35-815e-08d7a5a17287 x-ms-traffictypediagnostic: MN2PR18MB3152: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1775; x-forefront-prvs: 02981BE340 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(396003)(376002)(346002)(136003)(39850400004)(189003)(199004)(81156014)(55016002)(33656002)(4326008)(8936002)(71200400001)(81166006)(9686003)(76116006)(53546011)(6506007)(110136005)(5660300002)(186003)(8676002)(316002)(26005)(86362001)(54906003)(478600001)(2906002)(64756008)(52536014)(66476007)(7696005)(66446008)(66946007)(66556008); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB3152; H:MN2PR18MB2877.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: kcBAE8GOBKy4Iz5EUHu8HsQP0pqGkgmW33dHDDZrxNhTaTaRJwb4jUQhBC4cAs/k4U/2d+UkohAq44EfyKt8CAQJUTrMwv9WY9vl7TxTZBnCv4piBbdk0pPN9jQN+ANHWM3wTbo14tJkYKZYMftw4cDUkc7vMto1dZB80g8JjEbeYSKWc8Yc4jIFpyfF/LivHokoWiYwkrATZSNnSZcklnwz7qqawM1wXLBHuKE7qGUCDV/QZl/WLCZ6alYBRsnUxLU6h+0+EYpR2n+/NUIiJ//WMXZZtBaJUdKJCV8PYvznPMUDWXbI174hqyIa6Bg377tdjNC4HJBft1Sw0zaUgLO+PMO7coo5vswnU70WWQRV92nHVX3771nacfH8ABUGpt+qm/SQUBC4htlUglBicSLMBH3YC27HnWmasczin4Y/vk9Dg3ZrkYzIoaN6X1Ti x-ms-exchange-antispam-messagedata: t1T/8Z7Az4N1yFPDx+i1nG/8ZC+nq4rlxMHtsOOirdKFOVgHmfNkNH4qFiY8EHkYTPK/7+cSKfOZ4Pu2VQmwTfeHEjc0sQaFzDWW8URVCh5l5iGlZnmbVjZG/j8D8bVI6Lo18oLntw4nB6HEuwVDMQ== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 9e670bb8-e731-4c35-815e-08d7a5a17287 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2020 16:28:32.5445 (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: yVzNERsa7ttQLSwxI1SVqvJ/bt5arZ9y8DmaM72iM6b11M3rAQ0NsOKf69xz78PrwWkuXvuUhiYZrWwEdikLmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3152 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-30_05:2020-01-28, 2020-01-30 signatures=0 Subject: Re: [dpdk-dev] [PATCH] examples/ipsec-secgw: increase number of qps to lcore_params 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: Ananyev, Konstantin > Sent: Thursday, January 30, 2020 3:43 AM > To: Anoob Joseph ; Akhil Goyal ; > Nicolau, Radu > Cc: Jerin Jacob Kollanukkaran ; Lukas Bartosik > ; Narayana Prasad Raju Athreya > ; dev@dpdk.org > Subject: [EXT] RE: [PATCH] examples/ipsec-secgw: increase number of qps t= o > lcore_params >=20 > External Email >=20 > ---------------------------------------------------------------------- >=20 >=20 > > > > Currently only one qp will be used for one core. The number of qps can > > be increased to match the number of lcore params. >=20 > I don't really understand the purpose of that patch.... > As I understand, all it does - unconditionally increases number of crypto= -queues > mapped to the same lcore. [Anoob] With the current code, we will have only crypto qp mapped to one lc= ore. So even if you have large number of crypto qps, you would be only usin= g as much as the number of lcores. This is an inefficient model as a fat flow(say with large packet sizes) on = one eth queue hitting one core can starve another flow which happens to hit= the same core, because both flows would get queued to the same qp. And, we= cannot just randomly submit to multiple qps from the same core as then the= ordering would be messed up. So the best possible usage model would be to = map one eth queue to one crypto qp. That way, the core wouldn't be unnecess= arily pipeline the crypto processing. =20 > The question is what for? > All these extra queues woulnd't be used by current poll mode data-path an= yway. > Plus in some cases hash_lookup() would fail to find existing mapping. [Anoob] It was an issue with v1 that we have addressed with v2. I'll send v= 2 shortly. Please do check that see if you have more comments. =20 > I understand that for your eventdev implementation you need one crypto qu= eue > for each eth device. > But I think it could be done in less intrusive way (see my previous mail = as one > possible option). [Anoob] If this suggestion is agreeable, then we can solve both qp number r= equirement (for inline) and default nb_mbuf calculation in a much more sens= ible way. If this doesn't fly, I'll probably go back to your suggestion, bu= t then there would be more code just to handle these cases. And the nb_mbuf= calculation could turn slightly complicated. =20 > Konstantin >=20 > > > > Signed-off-by: Anoob Joseph > > --- > > examples/ipsec-secgw/ipsec-secgw.c | 39 +++++++++++++++++++-----------= --- > ----- > > examples/ipsec-secgw/ipsec.h | 4 +++- > > 2 files changed, 23 insertions(+), 20 deletions(-) > > > > diff --git a/examples/ipsec-secgw/ipsec-secgw.c > > b/examples/ipsec-secgw/ipsec-secgw.c > > index 3b5aaf6..d8c435e 100644 > > --- a/examples/ipsec-secgw/ipsec-secgw.c > > +++ b/examples/ipsec-secgw/ipsec-secgw.c > > @@ -1709,6 +1709,8 @@ add_mapping(struct rte_hash *map, const char > *str, uint16_t cdev_id, > > unsigned long i; > > struct cdev_key key =3D { 0 }; > > > > + key.port_id =3D params->port_id; > > + key.queue_id =3D params->queue_id; > > key.lcore_id =3D params->lcore_id; > > if (cipher) > > key.cipher_algo =3D cipher->sym.cipher.algo; @@ -1721,23 > +1723,17 @@ > > add_mapping(struct rte_hash *map, const char *str, uint16_t cdev_id, > > if (ret !=3D -ENOENT) > > return 0; > > > > - for (i =3D 0; i < ipsec_ctx->nb_qps; i++) > > - if (ipsec_ctx->tbl[i].id =3D=3D cdev_id) > > - break; > > - > > - if (i =3D=3D ipsec_ctx->nb_qps) { > > - if (ipsec_ctx->nb_qps =3D=3D MAX_QP_PER_LCORE) { > > - printf("Maximum number of crypto devices assigned to > " > > - "a core, increase MAX_QP_PER_LCORE > value\n"); > > - return 0; > > - } > > - ipsec_ctx->tbl[i].id =3D cdev_id; > > - ipsec_ctx->tbl[i].qp =3D qp; > > - ipsec_ctx->nb_qps++; > > - printf("%s cdev mapping: lcore %u using cdev %u qp %u " > > - "(cdev_id_qp %lu)\n", str, key.lcore_id, > > - cdev_id, qp, i); > > + i =3D ipsec_ctx->nb_qps; > > + if (ipsec_ctx->nb_qps =3D=3D MAX_QP_PER_LCORE) { > > + printf("Maximum number of crypto devices assigned to a core, " > > + "increase MAX_QP_PER_LCORE value\n"); > > + return 0; > > } > > + ipsec_ctx->tbl[i].id =3D cdev_id; > > + ipsec_ctx->tbl[i].qp =3D qp; > > + ipsec_ctx->nb_qps++; > > + printf("%s cdev mapping: lcore %u using cdev %u qp %u " > > + "(cdev_id_qp %lu)\n", str, key.lcore_id, cdev_id, qp, i); > > > > ret =3D rte_hash_add_key_data(map, &key, (void *)i); > > if (ret < 0) { > > @@ -1785,8 +1781,10 @@ add_cdev_mapping(struct rte_cryptodev_info > *dev_info, uint16_t cdev_id, > > continue; > > > > if (i->sym.xform_type =3D=3D RTE_CRYPTO_SYM_XFORM_AEAD) { > > - ret |=3D add_mapping(map, str, cdev_id, qp, params, > > + ret =3D add_mapping(map, str, cdev_id, qp, params, > > ipsec_ctx, NULL, NULL, i); > > + if (ret) > > + return ret; > > continue; > > } > > > > @@ -1801,12 +1799,15 @@ add_cdev_mapping(struct rte_cryptodev_info > *dev_info, uint16_t cdev_id, > > if (j->sym.xform_type !=3D > RTE_CRYPTO_SYM_XFORM_AUTH) > > continue; > > > > - ret |=3D add_mapping(map, str, cdev_id, qp, params, > > + ret =3D add_mapping(map, str, cdev_id, qp, params, > > ipsec_ctx, i, j, NULL); > > + if (ret) > > + return ret; > > + continue; > > } > > } > > > > - return ret; > > + return 0; > > } > > > > /* Check if the device is enabled by cryptodev_mask */ diff --git > > a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h index > > 8e07521..92fd5eb 100644 > > --- a/examples/ipsec-secgw/ipsec.h > > +++ b/examples/ipsec-secgw/ipsec.h > > @@ -200,7 +200,9 @@ struct ipsec_ctx { }; > > > > struct cdev_key { > > - uint16_t lcore_id; > > + uint16_t port_id; > > + uint8_t queue_id; > > + uint8_t lcore_id; > > uint8_t cipher_algo; > > uint8_t auth_algo; > > uint8_t aead_algo; > > -- > > 2.7.4