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 9CE72436D0 for ; Tue, 12 Dec 2023 10:48:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9440142DFF; Tue, 12 Dec 2023 10:48:48 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by mails.dpdk.org (Postfix) with ESMTP id DAC6E402C5; Tue, 12 Dec 2023 02:36:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702344981; x=1733880981; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=HMZo1BBFVYWFBPF5njFAkQ7ll8Xz9JPax9Dv06jcZeY=; b=O1NQSU22Xcvou9+MF99dwCTI6whps+YhAnhTN0wUtmt+50fCCn2Oh4ft n15AaGEDA4RHBIa4EiIvizHej1KqFfkHjMLl1EzL8m55ttT5RKHZxzDEE 2DXicUeZanVtmITDI/XPJGrf/ZLkQjrdvMRGo9+WpKtmA/TjV9Q3NuZK7 UqZ/waJSxhIZA/f9/+CMzq0KtrptzXMe96TvDNjRSswGgAyCSq6Zo4E+c v/SvQ2aUg5+h9sUJJValVK3nWIR3DPo8B02MmeW0BYBMPkJLqpBLVyA/2 hJlNyZ3WPLcirTstERpsuOyRDSCtFktwLM6NBzQbQFhL8sRw1o1R7az3V Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="1813439" X-IronPort-AV: E=Sophos;i="6.04,269,1695711600"; d="scan'208";a="1813439" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 17:36:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,269,1695711600"; d="scan'208";a="21315050" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 11 Dec 2023 17:36:19 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 11 Dec 2023 17:36:18 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 11 Dec 2023 17:36:17 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 11 Dec 2023 17:36:17 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 11 Dec 2023 17:36:17 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mLtlqkpWENzksqowk5sWH5htukV5EoZFw7a0pkcg6UvTCBgaSCu1Mawl0GUJ0x2a/in0OeLk/FCN/U9HxH0NCkMNith+mSBBWLjz98D9az2B8XuIKAH3GPf9puesDygq5RKzSVdD+98NnSFQBPxBwCOBMZSId1F1LAPoZnsir9L2uERXVPEkiO+o2K3Xvl60+La2841U/TubsQjmPlDwiKmPVmgRLhBiV8XjM5mbgn5CUq7yG684t/IC0U0xw04u4lDsjCjrPIkOJmPA9lzkqGfD9pv403OZGOAtTydgkNvue4KpMkSBPzytRg0vPpp7anFuiXK4zmWm32BJ/HA5xA== 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=WbsaPnAEyu78N2LEGSWR0ShQ4XePTGHSPMXSn/P0u3w=; b=CBwLobldonlEOApoyT+EkEOstf+441Thnw/X3qABIoqD3xllDfc916INZ1lDv1qLtlpsqxqjvSGHAvYfrttyWHUglvjRQgnuPlJxwOHtgZWC1j98gGh4U4o4b9h2clPB/3ph6Tmz6rRaPALkNIHpqc2rJaYF7Vk5N1RzzfU/Cbl6PLvjhnDiec8aVerrnMiXtHEpZPsFW2RbYba8J81m2ZHiBX32tswlyl/Lsx85kZ1WISMVE6N61kmGCLeVQ4tLtee5XPIzvQlnbNDUjm1Sspm/fZRG5xUAzvTevUUZ3Tz4D6cfM7QjlASQnYXKrr9zYJjXimOj1EmBYxVypABTmA== 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 Received: from SN6PR11MB2973.namprd11.prod.outlook.com (2603:10b6:805:ce::23) by CH3PR11MB7178.namprd11.prod.outlook.com (2603:10b6:610:143::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33; Tue, 12 Dec 2023 01:36:10 +0000 Received: from SN6PR11MB2973.namprd11.prod.outlook.com ([fe80::173f:ace6:ba36:addc]) by SN6PR11MB2973.namprd11.prod.outlook.com ([fe80::173f:ace6:ba36:addc%7]) with mapi id 15.20.7068.031; Tue, 12 Dec 2023 01:36:10 +0000 From: "Ku, Ting-Kai" To: "Nicolau, Radu" , Akhil Goyal CC: "dev@dpdk.org" , "Power, Ciara" , "stable@dpdk.org" , "vfialko@marvell.com" Subject: RE: [PATCH] examples/ipsec-secgw: fix cryptodev to SA mapping Thread-Topic: [PATCH] examples/ipsec-secgw: fix cryptodev to SA mapping Thread-Index: AQHaLBf++GW9kClY/UGiBAKw5gWUmrCk3GXw Date: Tue, 12 Dec 2023 01:36:10 +0000 Message-ID: References: <20231211095349.9895-1-radu.nicolau@intel.com> In-Reply-To: <20231211095349.9895-1-radu.nicolau@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN6PR11MB2973:EE_|CH3PR11MB7178:EE_ x-ms-office365-filtering-correlation-id: 92f53b5a-7d38-4990-dde8-08dbfab2b820 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mEsxjF752YMnZiu0jJf15Zrqc8vGVt9ayUxpuKqrVd0xb4REgTuqXZqnQ3tOpoRLXveI3ChdmoAw5lJNXyPH6RI92PdwwFscWbPksyKUKUjmscVI/6eQ58cMCuuGIuh8bpwj9HKkmM7URN/abMJw2MIHiDcL7mhgdrD9f0JyAQ13bpBJF0YZwGgGrN3ggUmYGEcRJgC26AO8tMMcSI2iZIhX6n56y5iwt5ISN2ciUnXnfbCB4NTZG16MzUv3xSok+EyLCGnchOyedsk3XN3lKVHzcpLHpbYexxvV9WKXMuV0d7eCkoO+stRtBdR5kYLloCNjLZ0ExBcB6gdbYeok4ULDXq9TfSDWhhxWGGOEDxz7nVxJkqbopqUWNb8s4DhhDxa+lUQdwJY7ueHbqfhYT8GjGBB5EkcZyB9SrksP0DIJ+NZCHeCcEfwFziJreXiDfv4+4Fr0Pes0um1Qdbtgm9YjPf9t5V0jmwmG2piaxG2yojSeQmy33QSmczjTEjTEf68VHaMX9L5TE7c1oA63nuenUrsfHoJAty4mX/iz0y427wkrZtchk01Mw1imkHvMeuokm8spf8OpQzasMh4a00ne5K1blSRJ8sc5oO0q6eK/SqmlxINNii76KFOMXAMJSg+D55JnSGBRf2F5hnZtQJ56/NVaeeckRDAtQAaJR60= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2973.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(346002)(396003)(366004)(136003)(39860400002)(230922051799003)(230273577357003)(230173577357003)(64100799003)(1800799012)(451199024)(186009)(55016003)(110136005)(66946007)(76116006)(66556008)(66446008)(64756008)(54906003)(66476007)(2906002)(5660300002)(52536014)(316002)(122000001)(71200400001)(6506007)(7696005)(8676002)(8936002)(4326008)(41300700001)(38100700002)(478600001)(86362001)(33656002)(38070700009)(82960400001)(53546011)(83380400001)(9686003)(26005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?FwrHDHv4lmVwDMG+/IqjRFL0guzdmlnoL2bQdBWTh92EVvCOS3xFTEHiR1eI?= =?us-ascii?Q?/8MzeMb8bKG2nSRAfTWbdzjLrwR8gTUyFHegFiIIvwrXQNCU9Xnqaks6HqJt?= =?us-ascii?Q?rOCoJ2VWhRkPqnVSkxBzBGMQLgkjaHweP5Hu7eEX/fePFRs/PkX+g/jiEDcp?= =?us-ascii?Q?UXm8hxBwuabjDgWgrjywNAOVj5NSRIA6WI5SLFKGIxBtnFny3bVvh6EBotR7?= =?us-ascii?Q?4DSW5xO+Teo94uLIcCy8H7t2kNh9pDyg4bmVt81JlGrgI16NFuSfnUjvhYLC?= =?us-ascii?Q?SpwAzFjltt+befTwMiy60GlPT6gIDD7DgeKM4+9MEM6ZSdV8ouY86/RZmYBF?= =?us-ascii?Q?wcForSQHeLYY4ITmi4LrmCf4vB55CWMMeIERtKXkPQRAnjLd2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ikUwoXcbTMU4Mc6l2Iv3qPhCvCzdPfaJ0vTR0GsU5t9Tte?= =?us-ascii?Q?qIe2H9c72aKvVKqiPg3FvJLSy+e+gWMl9VIhZaOaYz3baSq49OZgoS5o1cH6?= =?us-ascii?Q?TXLqtVKeZrvoPJAvE6eKjUQgvtkJqJ4oa/UEt42sm88RK3EXbzO8CbT7tYfK?= =?us-ascii?Q?yql0jZTdjH0MmzX/I53vsX7RyAJUKxEbkC76ahDuDbHGD7cyaUUUX3+GMDeI?= =?us-ascii?Q?0sbV0/iVscBM/eGDiGjHLqgWNcmGbJKVnf+fQgzcaBFJTn8H5fk6fJH1/305?= =?us-ascii?Q?Si1sIFRgOFPbMyZrtdu/yACLymoy5NWwt0UK6Lsc?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2973.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92f53b5a-7d38-4990-dde8-08dbfab2b820 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Dec 2023 01:36:10.3294 (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: uI/RwEc6RYTBw+CAgqqWK5Cld9LRi6kKm0KSjPspebzY/fMfPTCjkU1uXGWJx7/D4DdeZKmx66/S/dlwmlNqxQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB7178 X-OriginatorOrg: intel.com X-Mailman-Approved-At: Tue, 12 Dec 2023 10:48:47 +0100 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 Fixes: a8ade12123c3 ("examples/ipsec-secgw: create lookaside sessions at in= it") Cc: stable@dpdk.org Cc: vfialko@marvell.com Signed-off-by: Radu Nicolau Tested-by: Ting-Kai Ku --- examples/ipsec-secgw/ipsec.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c in= dex f5cec4a928..593eab4e73 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_l= core[], 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_e= nqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx, continue; } =20 - enqueue_cop(sa->cqp[ipsec_ctx->lcore_id], &priv->cop); + if (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.25.1 -----Original Message----- From: Nicolau, Radu =20 Sent: Monday, December 11, 2023 5:54 PM To: Nicolau, Radu ; Akhil Goyal Cc: dev@dpdk.org; Power, Ciara ; Ku, Ting-Kai ; stable@dpdk.org; vfialko@marvell.com Subject: [PATCH] examples/ipsec-secgw: fix cryptodev to SA mapping There are use cases where a SA should be able to use different cryptodevs o= n 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 f= unction. Also add a check to verify that a CQP is available for the current lcore. Fixes: a8ade12123c3 ("examples/ipsec-secgw: create lookaside sessions at in= it") Cc: stable@dpdk.org Cc: vfialko@marvell.com Signed-off-by: Radu Nicolau --- examples/ipsec-secgw/ipsec.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c in= dex f5cec4a928..593eab4e73 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_l= core[], 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_e= nqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx, continue; } =20 - enqueue_cop(sa->cqp[ipsec_ctx->lcore_id], &priv->cop); + if (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.25.1