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 9015543C01; Tue, 27 Feb 2024 06:20:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB95042E29; Tue, 27 Feb 2024 06:20:03 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 65DD44027D; Tue, 27 Feb 2024 06:20:02 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41QNPm9H012596; Mon, 26 Feb 2024 21:20:01 -0800 Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3wfgun879p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Feb 2024 21:20:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oD/UIvs9XRQmLzoOZOBX0aSa8AhEC2tbiBeyMTqsPnSO6F28mFZ2ZCjoO3yUtispYkjv726che/50Ot8kWnsiQfj1y63e6kVwOsCo0jw+ncUgfVJDTvfFbCo4ZjNbVGxIuGlJCbfCJfEsYA1tf7rQMqfGaxGQeSaN9gmst0JRtbVEWuK7Uzx75H5Tb2e/B/+LUf2y/caITYcD7Md5sRyosswD+eoDhQ+p3IkmgnMu4ItttvIL1UaIP4i0YlOEo+/VT81+g5tTeQ7LT9xL5zgbBb41ypDidgQBziVJDpb/w9F8cKJOaLmczzTZaQe2ulRDCi/sGNVvurDCx3dQZQBJA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/1waVE4KvMBsj/n9chcraSY+7VSZQi5EkD/xui4tiCA=; b=b3ReVRDhF0J/xgzORegPlaX13fNj3yn6+Ewll7IkG4gYcAg7X4Xj/MvR52L6lrZ0G1zZqbqbZVRUNxxX7NT+bU+LNXqF7HU5RH7l3Pv4X3aOP+oq1rNqQwJLw/YaU+GXe083KCAed9+lLIb0XOhPoeuEm5qVAoy39+6MmR/j3qyJWTrUqLLNvZ7//08UOSbzCEVeO64ryY3lqoaTc2YOxy18Wjp4eqE/FWwBBTUionS7VhT8dJrvLP39R1oHEeM3HV04tLmlR0D9tY3d1GKL2i/rBzMgW8ULQwtMwmk8IJSf3lTJE24gc4oYXcfh5GTBS4OCYeu9FLRnoriOvne+nQ== 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=/1waVE4KvMBsj/n9chcraSY+7VSZQi5EkD/xui4tiCA=; b=gd2vBhKoB8QP9XTLsGogYH3WuSf30P3HsEc5GVsn2UHdPjyqSiu647A+TIrk11GsQT008zZS5vPsm6JXMjklQbOaSQlcBo0Tolze3Hn1dWAwuo3YLBHGYwiD7ORu+/QEwMHDThAnZfK3lT5VxdK0OEm2cyOS0aWz3uSm+ZB495o= Received: from PH0PR18MB4672.namprd18.prod.outlook.com (2603:10b6:510:c9::16) by PH0PR18MB4038.namprd18.prod.outlook.com (2603:10b6:510:2d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.31; Tue, 27 Feb 2024 05:19:59 +0000 Received: from PH0PR18MB4672.namprd18.prod.outlook.com ([fe80::3db8:298b:be22:45c7]) by PH0PR18MB4672.namprd18.prod.outlook.com ([fe80::3db8:298b:be22:45c7%6]) with mapi id 15.20.7316.035; Tue, 27 Feb 2024 05:19:58 +0000 From: Anoob Joseph To: Radu Nicolau CC: "stable@dpdk.org" , Volodymyr Fialko , Ting-Kai Ku , Ciara Power , Kai Ji , Akhil Goyal , "dev@dpdk.org" Subject: RE: [EXT] [PATCH v3] examples/ipsec-secgw: fix cryptodev to SA mapping Thread-Topic: [EXT] [PATCH v3] examples/ipsec-secgw: fix cryptodev to SA mapping Thread-Index: AQHaaJ4xRXdgdAIA7kqgBrYcyiIxY7EdpyFw Date: Tue, 27 Feb 2024 05:19:58 +0000 Message-ID: References: <20231211095349.9895-1-radu.nicolau@intel.com> <20240226102545.18667-1-radu.nicolau@intel.com> In-Reply-To: <20240226102545.18667-1-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-traffictypediagnostic: PH0PR18MB4672:EE_|PH0PR18MB4038:EE_ x-ms-office365-filtering-correlation-id: 85db896e-b8dd-4e71-5f7f-08dc3753bde4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: L6AA0/Yc+AMR15J0q8kz0cfSgHba0YXsj7109iRtz3748wyqU+bmAwrhG8uolUeXUKVHLqPYLSHQk5mvKZ/Lha/NE4haoTn2OPZvDZIuorZWd2HQ2zt7Mf6ntQvvRZEIL1baR7p99utvWRPtzH1SDp0Elqk9YdpvrqrWnUP+MG7tVj7/JdZY3hldkcnN4hbjzk4M1PBBLJzt7W/rSljQ6zs1C3C3Uaau9TqMvDMXXo65UKIRr+Wa3H08BiKStFt+3bU621niCH9CbUDQy5cIe7lOjr1wjUmzezQFbdYtiO6pATyHdSSqmwvwLz/Un7zj+3N7HRyIteqTN5qVSVEARq6PfPd+u+dycuqlJ5RWyxMVQZd6uopXxjTtjO612ucXVhAcVQPZ/Hlt1fOARljuImZ15hhsokQonG3XuCn4Ick7A/gU9l+7izij0XONoU8tKHnHHUjCG067gfNNCLb0R0CyRZjhl16twgqrZ/PeW2vB9tX9nOxgus2HInmMRzIfWT46PNtA2OJnVm5uI0fu96RHW0WbyYmXJ3pwj1WgntMW0Of1FshZAOf2n99qzHI/+4cqDAYiRFVdwQTs8uUHSc6ZiA+pkDvXGi7Rz1yf+4zpubBfFp4NJ17PCj25uIlmdVoTa0oO3qDoBR3vzS+/dTqf7E2kwuvhRzKY1r4+LufECX62BVtHRLYaH7er6Prtnfu4rMyPfKIIJFQOEgAAGlHX1XJIW1qnnUR0tnddLN0= 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:(13230031)(230273577357003)(38070700009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?eQImXWxRwaST6ri3OozZtKNh5vw76JxR3ZhyZ81dPHM6wN4sQdo7Re7H1La4?= =?us-ascii?Q?jtmheDq3EQpfhB3XiFcK5DIFdTw7HJncw/xxi4Wo36FvuHcTdbnkSoomL994?= =?us-ascii?Q?QOFGxXox4F7EOC/R39sflaGwuFiJJTPqd+CxKZF1NdVY6FDkjsTfOcVBJcmO?= =?us-ascii?Q?qqIp6rSQhzB9CpGbeNUW+0IXRWVX+UoF24uXnSM5T/OlP6ydI2Y6YAK7miYm?= =?us-ascii?Q?7h/SMb4+t4Ps864V9hweTvOrG5oYBBJICmouuP6DUnHijrCtUwqpVbPLkAoJ?= =?us-ascii?Q?0qLTZklNTmByMOj7SI+BXfVU0I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Q?F5aBmIXIvzDtxbraL1oonNRj4Vx//3qa0YVnVam2QBrilqdbMilqlw9xzYmN?= =?us-ascii?Q?d39NpucLB0RXws5L8mMEMTdXIymacWg6sytX1qW8P5CWYn/mWLgCyUJqGNVn?= =?us-ascii?Q?FDDR91zswLCOn4+UQqaMf2v3ehm4OwmMZuUFqaHm8DrxydlH2hSLrEhc/CZ8?= =?us-ascii?Q?ABP0uhuE3LQIIKfwpigOp+LmZ+Ck6c6sVQoWHhNjJl/RMIAIXEmOGzqPkU56?= =?us-ascii?Q?BtW+rgP4vLhiXwEDoJETUGc5IcC4x+V0qOdu3+mKbP9h9mOSkynUpMINTOAM?= =?us-ascii?Q?HyZYSG9tzVwPYZNlafKAkhKCMiW6KRMJt980v73Q35KzBxuSRxmPGYfK84CT?= =?us-ascii?Q?Lg5tw2g2rZ1uDNo5a4Q=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: 85db896e-b8dd-4e71-5f7f-08dc3753bde4 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2024 05:19:58.6884 (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: /XIBCsvnR3ynCdRS6JICyAhIs29Aw5vLTkiovSvNEvpeY+AFRg6Qp2w7UvpNpPeYkORpOG6iRu1ok5JarYcsOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR18MB4038 X-Proofpoint-ORIG-GUID: F6pBRfkiFsS4VuHr4gL0n_AIgSwStL79 X-Proofpoint-GUID: F6pBRfkiFsS4VuHr4gL0n_AIgSwStL79 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-26_11,2024-02-26_01,2023-05-22_02 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 Hi Radu, Thanks for making the changes. I've one more question. Please see inline. Thanks, Anoob > -----Original Message----- > From: Radu Nicolau > Sent: Monday, February 26, 2024 3:56 PM > To: dev@dpdk.org > Cc: Anoob Joseph ; Radu Nicolau > ; stable@dpdk.org; Volodymyr Fialko > ; Ting-Kai Ku ; Ciara Power > ; Kai Ji ; Akhil Goyal > > Subject: [EXT] [PATCH v3] examples/ipsec-secgw: fix cryptodev to SA mappi= ng >=20 > External Email >=20 > ---------------------------------------------------------------------- > There are use cases where a SA should be able to use different cryptodevs= on > different lcores, for example there can be cryptodevs with just 1 qp per = VF. > For this purpose this patch relaxes the check in create lookaside session= function. > Also add a check to verify that a CQP is available for the current lcore. >=20 > Fixes: a8ade12123c3 ("examples/ipsec-secgw: create lookaside sessions at = init") > Cc: stable@dpdk.org > Cc: vfialko@marvell.com >=20 > Signed-off-by: Radu Nicolau > Tested-by: Ting-Kai Ku > Acked-by: Ciara Power > Acked-by: Kai Ji > --- > v3: check if the cryptodev are not of the same type >=20 > examples/ipsec-secgw/ipsec.c | 25 ++++++++++++++++++++----- > 1 file changed, 20 insertions(+), 5 deletions(-) >=20 > diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c = index > f5cec4a928..b59576c049 100644 > --- a/examples/ipsec-secgw/ipsec.c > +++ b/examples/ipsec-secgw/ipsec.c > @@ -288,10 +288,21 @@ create_lookaside_session(struct ipsec_ctx > *ipsec_ctx_lcore[], > if (cdev_id =3D=3D RTE_CRYPTO_MAX_DEVS) > cdev_id =3D ipsec_ctx->tbl[cdev_id_qp].id; > else if (cdev_id !=3D ipsec_ctx->tbl[cdev_id_qp].id) { > - RTE_LOG(ERR, IPSEC, > - "SA mapping to multiple cryptodevs is " > - "not supported!"); > - return -EINVAL; > + struct rte_cryptodev_info dev_info_1, dev_info_2; > + rte_cryptodev_info_get(cdev_id, &dev_info_1); > + rte_cryptodev_info_get(ipsec_ctx->tbl[cdev_id_qp].id, > + &dev_info_2); > + if (dev_info_1.driver_id =3D=3D dev_info_2.driver_id) { > + RTE_LOG(WARNING, IPSEC, > + "SA mapped to multiple cryptodevs for > SPI %d\n", > + sa->spi); > + > + } else { > + RTE_LOG(WARNING, IPSEC, > + "SA mapped to multiple cryptodevs of > different types for SPI %d\n", > + sa->spi); > + > + } > } >=20 > /* Store per core queue pair information */ @@ -908,7 +919,11 > @@ ipsec_enqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx, > continue; > } >=20 > - enqueue_cop(sa->cqp[ipsec_ctx->lcore_id], &priv->cop); > + if (likely(sa->cqp[ipsec_ctx->lcore_id])) > + enqueue_cop(sa->cqp[ipsec_ctx->lcore_id], &priv->cop); > + else > + RTE_LOG(ERR, IPSEC, "No CQP available for lcore %d\n", > + ipsec_ctx->lcore_id); [Anoob] Throwing an error won't be good enough, right? Won't this lead to p= acket leaks? Since it is datapath, can't we assume that the configuration w= ould be done correctly in control path? I would suggest drop this specific change and we can enable multiple crypto= devs with lookaside SAs with the changes proposed. > } > } >=20 > -- > 2.34.1