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 1B650A04FF; Mon, 4 Apr 2022 11:48:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF3DF40696; Mon, 4 Apr 2022 11:48:37 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id C1DD24068C for ; Mon, 4 Apr 2022 11:48:35 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 233KNfSt007439; Mon, 4 Apr 2022 02:48:35 -0700 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3f6kupejns-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Apr 2022 02:48:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ff1l8x8GQ4+ZFYSC//Pakncc+NuNFHoLe4ngq6ur3TKw+1PYVmRZ5hYZKpfjgF+1/78GfexBW/ZaTELth91DuK+DCspp3D3fkAGgDQleg3m/NSfCY0IF2oFCRJCEhlKi8g2NPDCVDH9ExgkvRymfEEAq838/Sb3GlzImUae/XcJi6lI5fBM49e7OqlFsiqDlEaku7v1+hLBPjsySH6sHKFhRxDRyn7wSrmGjBBlrg0S5m+UHO2/ce80MddLu0ZaJD7Kmf+rKNs/1c9YHvC3zWOIJW/2XSwjWFCbE7RBMjocr7YEMuI6YGWUnCASpCrLyO2+M3udcDd6FCH4ZQw+B5Q== 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=hBNw5GJFF95/iSfsXL/j9F9qpsmGam4KjMUpHDA1HiY=; b=cVPdSFJajyi8y7QQJMKDUizn7dipOP9mV7I38bhPE4DcWBnjE7OF0FBfqp8G5PMBj3bYr2aR9vN3FRjowyUeoAUmpTyfUKsNSx2zCi9+PGVo1JdvsFpfZQptPJ36zuHAIkpmEZn4GI9wnAW5WEEK6NB+zrlfjhaYGNoWz1tMSXcC7MJ043pMzP0T3XXzTE8UI7mvktEhbPMkkt/ojnPuGnwJCKZlFkg6SKMsH4l7ZvbW3YQ0oyAkXFAXvZvs0DHkPyikMuIx8mEmHhmqizTgZyKUTAV1vhhVnCvD//WtdYYnX8AFgSzK8ep87Yu7NibPNnzOXuNZ61rL18cNaN0iYw== 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=hBNw5GJFF95/iSfsXL/j9F9qpsmGam4KjMUpHDA1HiY=; b=GEE6M6cDogeS/9lgLBsQieMBb/ReirhdxM4vUl++6tIZOT3mpsujaQ/RfIPawhtkBAjauLTyX8CJCkn+kaQzlHK6Cc59J0RscN9HRV3lkY50gogJ/mv4n7Ij5OWu5626TsmdFIjCzZeONFvMCpDEXib4D3X2/Inrtd+gSLsckrE= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by BY3PR18MB4755.namprd18.prod.outlook.com (2603:10b6:a03:3ca::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.31; Mon, 4 Apr 2022 09:48:31 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::617e:c37d:1f25:b654]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::617e:c37d:1f25:b654%4]) with mapi id 15.20.5123.031; Mon, 4 Apr 2022 09:48:31 +0000 From: Akhil Goyal To: "Gujjar, Abhinandan S" , Volodymyr Fialko , "dev@dpdk.org" CC: Jerin Jacob Kollanukkaran , Anoob Joseph Subject: RE: [PATCH 1/2] security: introduce per session event metadata Thread-Topic: [PATCH 1/2] security: introduce per session event metadata Thread-Index: AQHYQDnFfv+VO3bY0UKgR1ETLX3qmKzffiMAgAAR5wA= Date: Mon, 4 Apr 2022 09:48:31 +0000 Message-ID: References: <20220325111615.1118946-1-vfialko@marvell.com> <20220325111615.1118946-2-vfialko@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a3e240ae-681b-4095-92ae-08da16204735 x-ms-traffictypediagnostic: BY3PR18MB4755:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4JG6Rop6BjQD5zxFmpx2prRBATT7iPRwDWuOZS/Yk6IfWf6E+HDALErTZyH3yNP2qolwxUUu6sexrhx3disDswuVV7PdGX4q9hubvRlM6kwA15qgQqkKZYiXtgiyg8qeEgdYi1+F1lfP5RszUjyRr8hyabfSO533O3ctTFfhLH4bdoVMUqs60RKGe43G3o8OHRLMu5dBte1MjpcAIBJqth1vMArXodb63Jg1DzOt4ZXEDgDN2xidHhJrxdj9tTjRTAjXirerSWbRqpqwXnh/r3kAfTSOLufJtbfAOMBk5OrVz7kWadpVORuShwdwvIjf5QCJtLSpVb9v9iwV4R7s+qpZ+bTWqaVhKq/0ll47nA/UgjMcOf28mWP56I3b0O1U3338sUuCGHew65A/zr8RWKX5rXomZeOhsb+lB3A3dfj9e8hCA3PX7Mxe4/X8ke57+IoK7XA0N6H6Yd2vVlC+ncf1/LO/69Ysb23fCwBGq3NnzLCDqv4CGwD6I3ZvnaG+IdaDKGxWdyH91UNMrPkofFfQf1bIBXJ5/0UqJKTw4dhmeUwAivc/n8VFtO53kSEPoVy9nMiY1gi5OPr8HW/m/eQVt/mOIsNP3MyUNHjLAjRvOuoccnxrqSa3nANUz9jH2hxe2n9Ocs0oCUAlHXPNPi8nfkFpffTlLrKnzXNxdca1OqptAGLtLY2ebqh9mtJ0Ho/zqBC1T6sYExVxccTN3A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(84040400005)(52536014)(53546011)(55236004)(6506007)(7696005)(26005)(8936002)(2906002)(55016003)(71200400001)(33656002)(186003)(5660300002)(508600001)(122000001)(107886003)(64756008)(15650500001)(86362001)(8676002)(4326008)(66446008)(83380400001)(110136005)(66476007)(38070700005)(66556008)(54906003)(66946007)(76116006)(9686003)(38100700002)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UHn7s9dF84AHysbx0gRe9Q0mQe1ibAEp+PJiFH/KGGn7jlqwirEUJd+RkocP?= =?us-ascii?Q?wmIfYyANLikcjY1cAB3ORTwr9QCnrHDGNKwv3qpFpjXA/EzchwHUK4IkpVli?= =?us-ascii?Q?yiaCNuVLcni7lWPSsBQDcW74T5zIilfm1a9jpdLHiXOLdJvb2DnyyQqEI8/L?= =?us-ascii?Q?9G5//Z87WdMVvzprYW7LLD8oyv5HeD2SRGPUUnmNnWXn1SuMTell3uAsJYYR?= =?us-ascii?Q?ts+ddUXQdfj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?us-ascii?Q?uKRxtPqf9IAQbb9hrnSUuDjabv950qaFZeyv3m1K2LoCXvESnyRBfor7+nN4?= =?us-ascii?Q?wCrMIJ8VL848rwvrRPKjRkNWVFOlOW9gKXeS7Vz7vj7Wxij9aS3CDY5kw/ex?= =?us-ascii?Q?RA3bWrBMUJ3yp+otAIXvMJKNGepWxuMosu8ghfDtrpL+L+43iY4jiUhdrVbu?= =?us-ascii?Q?2s4RZLfDNo3hShjbmJ5wFK+W+xAK/GrmCTqddSMg9F30lG7VxBjpOH8PGm+W?= =?us-ascii?Q?uj/pXktV3Rwwhccjc7lYu0oHFhXqbk1d7Bj0+TivjeCHcxAmDR4y5tT2+d82?= =?us-ascii?Q?q6f7CVXk8uNb0JCrf8chSeAjb1j64q05gYGNptrHGk8OO9eYlB70PpZgyjzm?= =?us-ascii?Q?WurPdkyde4hpkanZaNnWdMoW+Grn2XUcyJ/igE3rvwXpGyb4OqXZuVwGP9iK?= =?us-ascii?Q?SNXthwoM7ubDq2rTZZsQi+JE8LeC6tOHHq0Yzw9bD6jBW3hclfzyypBsRWVs?= =?us-ascii?Q?gAV3DFJi7jrkKjXO3uwCxoFh+vC7OP28e0+UIFSsxDsrmAAujc0rFBI22Qmz?= =?us-ascii?Q?x6BSZXvdtsPSXUUsmUgdoIdRn88svHO1Ov+D7meEDxX0gXlp7w07Q5YO0WiR?= =?us-ascii?Q?sX7Y/D4PHg=3D=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: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3e240ae-681b-4095-92ae-08da16204735 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2022 09:48:31.4555 (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: +b6zxMeaWTh83l9DeR+eRcv+LeHdugHJeDwhW616F/GhaZVkiT1fdyeH3M0XZ4IH+oMM2dH86q3LL4tRqo+AGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR18MB4755 X-Proofpoint-ORIG-GUID: BWVG5Z7QaG5iCOf33K7Fg76ecG13UofH X-Proofpoint-GUID: BWVG5Z7QaG5iCOf33K7Fg76ecG13UofH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-04-04_03,2022-03-31_01,2022-02-23_01 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 Abhinandan, > ---------------------------------------------------------------------- > Acked-by: Abhinandan Gujjar >=20 This change would be an ABI breakage. So to avoid that, we are planning to Propose a better solution compared to this patch. We plan to add a new cryptodev op to set the event metadata. A single API which can be used in all cases - sym/asym/security sessions. As currently in case of sym crypto, userdata is being used for storing the = event Metadata and it is then dereferenced in the PMD which is wrong. User data is meant only for user to use and PMD should not dereference it. Hence a new cryptodev op can be used to set session event metadata explicitly if event mode is enabled. I will be sending the proposal soon. Would need your help in testing the Intel usecases. Regards, Akhil > > -----Original Message----- > > From: Volodymyr Fialko > > Sent: Friday, March 25, 2022 4:46 PM > > To: dev@dpdk.org; Gujjar, Abhinandan S ; > Akhil > > Goyal > > Cc: jerinj@marvell.com; Volodymyr Fialko ; Anoob > > Joseph > > Subject: [PATCH 1/2] security: introduce per session event metadata > > > > Implement API to set/get event data per security session. > > > > Signed-off-by: Volodymyr Fialko > > Acked-by: Akhil Goyal > > Acked-by: Anoob Joseph > > --- > > .../prog_guide/event_crypto_adapter.rst | 4 +- > > lib/security/rte_security.h | 43 +++++++++++++++++++ > > 2 files changed, 45 insertions(+), 2 deletions(-) > > > > diff --git a/doc/guides/prog_guide/event_crypto_adapter.rst > > b/doc/guides/prog_guide/event_crypto_adapter.rst > > index 4fb5c688e0..227b36b4b7 100644 > > --- a/doc/guides/prog_guide/event_crypto_adapter.rst > > +++ b/doc/guides/prog_guide/event_crypto_adapter.rst > > @@ -246,9 +246,9 @@ by ``rte_cryptodev_sym_session_get_user_data()`` > API. > > The RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA capability > > indicates whether HW or SW supports this feature. > > > > -For security session, ``rte_security_session_set_private_data()`` API > > +For security session, ``rte_security_session_set_event_mdata()`` API > > will be used to set request/response data. The same data will be obtai= ned -by > > ``rte_security_session_get_private_data()`` API. > > +by ``rte_security_session_get_event_mdata()`` API. > > > > For session-less it is mandatory to place the request/response data wi= th the > > ``rte_crypto_op``. > > diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h = index > > b080d10c2c..29ec514504 100644 > > --- a/lib/security/rte_security.h > > +++ b/lib/security/rte_security.h > > @@ -526,6 +526,8 @@ struct rte_security_session { > > /**< Private session material */ > > uint64_t opaque_data; > > /**< Opaque user defined data */ > > + void *event_mdata; > > + /**< Event request/response information */ > > }; > > > > /** > > @@ -729,6 +731,47 @@ set_sec_session_private_data(struct > > rte_security_session *sess, > > sess->sess_private_data =3D private_data; } > > > > +/** > > + * Get event meta data attached to a security session. > > + * > > + * @param sess Session pointer allocated by > > + * *rte_security_session_create*. > > + * > > + * @return > > + * - On success return pointer to the event crypto meta data which is= set > > + * using *rte_security_session_set_event_mdata* > > + * - On failure returns NULL. > > + */ > > +__rte_experimental > > +static inline void * > > +rte_security_session_get_event_mdata(const struct rte_security_session > > +*sess) { > > + return sess->event_mdata; > > +} > > + > > +/** > > + * Attach event crypto meta data to a security session. > > + * > > + * Application can allocate memory for *rte_event_crypto_metadata* and > > +set the > > + * reference pointer using this API which the PMD can retrieve using > > + * *rte_security_session_get_event_mdata* > > + * > > + * The API should be used only in case session is used for event crypt= o > > + * adapter. > > + * > > + * @param sess Session pointer allocated by > > + * *rte_security_session_create*. > > + * @param ev_mdata Pointer to the event crypto meta data > > + * (aka *union rte_event_crypto_metadata*) > > + */ > > +__rte_experimental > > +static inline void > > +rte_security_session_set_event_mdata(struct rte_security_session *sess= , > > + void *ev_mdata) > > +{ > > + sess->event_mdata =3D ev_mdata; > > +} > > + > > /** > > * Attach a session to a crypto operation. > > * This API is needed only in case of > > RTE_SECURITY_SESS_CRYPTO_PROTO_OFFLOAD > > -- > > 2.25.1