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 0E1BB43BDE for ; Mon, 26 Feb 2024 05:49:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F00D642DAC; Mon, 26 Feb 2024 05:49:06 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id CF20540271; Mon, 26 Feb 2024 05:49:03 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41PNgDbg027414; Sun, 25 Feb 2024 20:49:02 -0800 Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3wfepr4190-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 25 Feb 2024 20:49:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F5H8afZTXUJl4jnFyhWcospUaJI4CDVkcxPNwBlKwkA/3xIIBD5MaKL4dDlurCknb56MGi9kQP1PKnXe6sYGlAjGbKTUyRNvCNQSjYBICb7e5PlMbSe2kXgdx+c2CVj44Pt1lWXzIdQcUdbdHuDMt38De+N8BL+F93HreeS3kc5sgCCqp7T90mZw800YcDHeUyFNjUgtYQ/1nPhwiXuuKY0tesupIL+XJfnp7zkaIr63keVSMFKwOF0T+CykC4PDv802c5MTbwNon2aHldUieDX/K3U8DvjSk06PiQCekOPxsXQbv5AdmI1A0W7wyqX1E0EGaiSp402+LrTt5yO05g== 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=FE/TofpIZnsXxSaJR6CQcwPTzFqvuL6f0gePFVF3E+g=; b=WmuzrAFVLJJmcWlijis1VyQpNLfj5BnBON1uXzsnihl9IyQVHiNzToYthxpEGkC0szDTaIKaYDvLNANtoxiOrbgpjsFF/TcUSJ35hDIM7GY4r41qsbzabW//tNCMVoOVcRd9tz+cZ7VsF7appVZLvqxGSElXkiodlER25fe/oqypKzT4u1c4UaEdc7aGX07E++EFvvOXOoJXvNcORGcMTz/gnMqmRZgRyhVUA9LRR5ZtOdE+wtkWlvBigmtjprzox6oeNEK2hmLQY1ELtld9UwxMhwUFfwNcFE+sECB+rZZS3TiMAwjDxqfqQ7RefzQsPh4UCpV1FpaEgEb5piLSeg== 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=FE/TofpIZnsXxSaJR6CQcwPTzFqvuL6f0gePFVF3E+g=; b=UAPKkwoNvzF+ctp00Lyvo98oxO+oLnXRXMIXKMCuHhkuKqkLxXPmO9uYrM8761QjcVhQOye2CI2fgiplZJ+9rnqutaxiz/odK0njj/RQtRVqRDWvoogtG9SyxpBCSE1F99+bHcdLtoWZvEmrt9oJBSNDrRKgb239qsSpmqB3Jjw= Received: from PH0PR18MB4672.namprd18.prod.outlook.com (2603:10b6:510:c9::16) by SA0PR18MB3680.namprd18.prod.outlook.com (2603:10b6:806:72::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.34; Mon, 26 Feb 2024 04:48: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; Mon, 26 Feb 2024 04:48:59 +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 v2] examples/ipsec-secgw: fix cryptodev to SA mapping Thread-Topic: [EXT] [PATCH v2] examples/ipsec-secgw: fix cryptodev to SA mapping Thread-Index: AQHaZkenFr2cIcyBzkaSiyygz85nFrEcED/Q Date: Mon, 26 Feb 2024 04:48:58 +0000 Message-ID: References: <20231211095349.9895-1-radu.nicolau@intel.com> <20240223110113.122947-1-radu.nicolau@intel.com> In-Reply-To: <20240223110113.122947-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_|SA0PR18MB3680:EE_ x-ms-office365-filtering-correlation-id: c137708e-d658-4fb5-647c-08dc36863eff x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JZ5qmPSpPDCDkFNVwBXMUuo44VjI/5MJIzi9r3Hr1gbneDpCiomSgYgDQna4ripxfKhEV9uwlbfYLPrFYrVasJPsYiDUKNxHi419VA2C0C7fWPL07MER3S7BBr3qfP2j9i/sgXZHJiwS55OJEGknQwABrZpDvFlXJluzJttgI+lJLjdouGJieT8btWv0H8e5k9TLiouVZL9CNUslqa4xBdzwKhhxoMu0GuEV5lDQ45lZ3kz+Oexh+ho+Dzrx3PNuYlgzJ9dcKakMnPQJE+cJdJn8hnYnvULyjfaqgKPxfSg7bns1ggqXzrk/6OErTFT0F1xZXRv7cFqOvJ6K+xLyo7GDWIiFVB/6kPccx4ErXTKhiLrJn8o3UjvuH8VAgPXFif50W5fBOLU/8/mJSP7/UuWeMdzgu4m6flCkpnKXHMQUtqwhncPPTFXpeKaE2/fILTDw/Wv9wsa+Z/DpoTZtDFRTIGG8TTJSzUdyTKiVUgbM84dgwdzrJ+sKUfXtH6XAHg9C2OVqgQe/8TGM9+ZNedLNhKHOhpZM/FA6ahL68jVNBuGETeM7owVkr3Z4Dfe8NchcVJ5q1EYw/GUssS0ounXy4xmwPsMMbaUFB0ahEbKlQvqEuF7Ygg0qeDBfteBRFBt+rw8iU/Lcz9MpmzJa4tLn0/howepZ2zDzqsx+MqDbJdWWILItw7pEvat6EBQo/lYAojPlybjXSKQqk8Cs2Y5KB1VSTcE+swjDatLNdIM= 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?tEDuiQyIz3yxnEo2iA2wdfE/GDuKMoZlL2qlefR7iu8sVlQA54oePugRWXws?= =?us-ascii?Q?Jj/f/69QiG5UybLSaN3PJYZIFOIuC/Lwmoz7sNv6Kk+SQjo8tRTXwF4hL0Xp?= =?us-ascii?Q?EirKOd88flR9CyrAwZlPe5nbAZ1C6ggGdTnIYxOJZ839hSrZiRj0oEtPlSWV?= =?us-ascii?Q?GDezaSReCgUFcG1Y7A3RcPqejbakE5S1YvUrbNO56Favmw8Qhwpj97f1nSxT?= =?us-ascii?Q?TdSNUZiSg2xsIIGr98IQ7SeX23IV6hBOOwWCe8llmZgviUWG2RnsccQKZbCo?= =?us-ascii?Q?HgQ1VkBFmwq2XJbp+HOyxakE2E0XeegmLDZKwONWMu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tCmgVsGgsPsMCDnyFO1lcb98D8/Utw9w4l+v6FwIWT?= =?us-ascii?Q?YHHI6v79Emjit+WcClef3o/4n5XwrA2v832XNpnuwVGD90+A8syfjkyW5JhL?= =?us-ascii?Q?9mjnTf1Ao2n18nm2O2sZSh1iwHcNNo/U7kizJyEQrG9qmDUIcN/gfTFRKmBh?= =?us-ascii?Q?VvonlxAU4iD+FAsLyLHjLqMk9euWEUsR/Kkf7Duy8CsMqkVfXlpl1uaE6n51?= =?us-ascii?Q?ehYmqBv1kI5+jgG1sVW0YkazxjNr5vCiJT43FyOl3TO6Y206UrvhivXFUtr7?= =?us-ascii?Q?k+MsuXQ3YRSuqDX6rWO7HJZCsYW4XtYFddsaE65T7muD26BaES5yffAmXXXs?= =?us-ascii?Q?a83uOUicOOXJhIUdsuk=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: c137708e-d658-4fb5-647c-08dc36863eff X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Feb 2024 04:48:58.9812 (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: QISzwDKztFzQIuha6Bg2q9+Te4/g/D3LSbWh2oGpJyFiXhCmNMOelNma1IJyxhoVxf6Rh8V+FA5xiqjmFMWp0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR18MB3680 X-Proofpoint-ORIG-GUID: dNTmknn0v_ZVXEN4zb2Cnrfknf3_dF1c X-Proofpoint-GUID: dNTmknn0v_ZVXEN4zb2Cnrfknf3_dF1c 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_01,2024-02-23_01,2023-05-22_02 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi Radu, Using same session across multiple devices would only work if the device in= stances are same. For example, if you use QAT device 0 & QAT device 1, then= the sharing is okay. But if we have QAT and some SW crypto PMD, then the s= ame session will not work. Is it possible to throw a warning when the crypt= o devices are not of same type? Thanks, Anoob > -----Original Message----- > From: Radu Nicolau > Sent: Friday, February 23, 2024 4:31 PM > To: dev@dpdk.org > Cc: Radu Nicolau ; stable@dpdk.org; Volodymyr Fia= lko > ; Ting-Kai Ku ; Ciara Power > ; Kai Ji ; Akhil Goyal > > Subject: [EXT] [PATCH v2] 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 > Signed-off-by: Radu Nicolau > Tested-by: Ting-Kai Ku > Signed-off-by: Radu Nicolau > Acked-by: Ciara Power > Acked-by: Kai Ji > --- > v2: add likely to CQP available branch >=20 > examples/ipsec-secgw/ipsec.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) >=20 > diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c = index > f5cec4a928..7bb9646736 100644 > --- a/examples/ipsec-secgw/ipsec.c > +++ b/examples/ipsec-secgw/ipsec.c > @@ -288,10 +288,9 @@ 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; > + RTE_LOG(WARNING, IPSEC, > + "SA mapped to multiple cryptodevs for SPI > %d\n", > + sa->spi); > } >=20 > /* Store per core queue pair information */ @@ -908,7 +907,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); > } > } >=20 > -- > 2.34.1