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 511E4A0032; Fri, 1 Oct 2021 17:53:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC26E4118A; Fri, 1 Oct 2021 17:53:30 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id E59664067A for ; Fri, 1 Oct 2021 17:53:28 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10124"; a="205628904" X-IronPort-AV: E=Sophos;i="5.85,339,1624345200"; d="scan'208";a="205628904" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2021 08:53:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,339,1624345200"; d="scan'208";a="480521182" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga007.fm.intel.com with ESMTP; 01 Oct 2021 08:53:26 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 1 Oct 2021 08:53:26 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) 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.2242.12; Fri, 1 Oct 2021 08:53:25 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Fri, 1 Oct 2021 08:53:25 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.175) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Fri, 1 Oct 2021 08:53:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lsq8tPAknrnbu5C32ohJy49lAmbb98MBOD9/vLr6flB1KMM7H0LmMUtTxHUj8BoE+Yp19uHHc2rURTZoi56kJNEKoHw08YdTxk1JlSsquyN2J0rWrt0SCmri14AYCNOAK+kLbd9Wbh/xcXdXnGv9XhscMdl2o+7u3nQX21xVWHVWs1nTjeFLdpTn553Egfdxgr3WZLKPSMc/3miLhE/dsrsQtpOsH7c6D7yomPIFd6WXlUnW4dn/2CXW7z+gyEll8l1dZFqY7hMgHYdYWRQfJiXvGYsXMAZe5o+7h8O3WSX2Kje3GhD5VngkgVd/GyKppdxW3Szi4hj6oUHY2wdcNQ== 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=1tZs+Ssx655gaHaIMmPtAG1aqc9UHPdPGw+XI6nRRQY=; b=JYSjN3qRczzeoeYhP/0rxKFK3T8jMPl2uMa493a/UzOJd6aPhje0JjXeLgy1cQMq6j2tdOp3YL+N56eKjtRFDQEpWg7fbvflHdNxvDEg6Iu9n1lrakVUvYcLxgnnpZDZSOhv7DTamBg+CT6aOZ0+CeVgmyAGU+Ip6t6lf6XacK/ix+XHJeP5ryglc/swdQe2jdpw+H5zEV/TzH62cySOfJWCXTbuKbDA7g7MWAWBlsVLEHtT1HRVo0gvMH5VNAgNNPYpw4GqvfX/6UUMPy0XeJtc6VP9um3GgA8XVE8DW6Cp2N4EmJztRyFzmhT4ICadzivAm1H5mSjestQgMlB/rQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1tZs+Ssx655gaHaIMmPtAG1aqc9UHPdPGw+XI6nRRQY=; b=GuzjBcWHsxySn2bER55I0SsrgTkr5hAhWOMbr1KNR/Dws7Db/tXaPhJc0l48y7K0btaV1uDpXMA8UtczoftPGcvN7JmSzqLzQ9zvs22y6AJ08TcuU41LlYggczzoPtnYbaj9ZptHEuq8+2kKqneBQxwZj2TzsTSJ0G/hhfQJ6Iw= Received: from CY4PR11MB1718.namprd11.prod.outlook.com (2603:10b6:903:2c::23) by CY4PR11MB1463.namprd11.prod.outlook.com (2603:10b6:910:3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.20; Fri, 1 Oct 2021 15:53:18 +0000 Received: from CY4PR11MB1718.namprd11.prod.outlook.com ([fe80::d46b:339a:9056:1122]) by CY4PR11MB1718.namprd11.prod.outlook.com ([fe80::d46b:339a:9056:1122%5]) with mapi id 15.20.4566.019; Fri, 1 Oct 2021 15:53:17 +0000 From: "Zhang, Roy Fan" To: Akhil Goyal , "dev@dpdk.org" CC: "thomas@monjalon.net" , "david.marchand@redhat.com" , "hemant.agrawal@nxp.com" , "anoobj@marvell.com" , "De Lara Guarch, Pablo" , "Trahe, Fiona" , "Doherty, Declan" , "matan@nvidia.com" , "g.singh@nxp.com" , "jianjay.zhou@huawei.com" , "asomalap@amd.com" , "ruifeng.wang@arm.com" , "Ananyev, Konstantin" , "Nicolau, Radu" , "ajit.khaparde@broadcom.com" , "rnagadheeraj@marvell.com" , "adwivedi@marvell.com" , "Power, Ciara" Thread-Topic: [PATCH 3/3] cryptodev: rework session framework Thread-Index: AQHXtgrAhSBQ8jaMHkOD9+YDCx8uiKu+Qsog Date: Fri, 1 Oct 2021 15:53:17 +0000 Message-ID: References: <20210930145014.2476799-1-gakhil@marvell.com> <20210930145014.2476799-4-gakhil@marvell.com> In-Reply-To: <20210930145014.2476799-4-gakhil@marvell.com> Accept-Language: zh-Hans-HK, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 94e14f2d-35d0-4695-3ae1-08d984f3961a x-ms-traffictypediagnostic: CY4PR11MB1463: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:586; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hnhfc8dvdV0LvQbNLiBSUeJ7dSBKxqnGV+easjIezX5Aw2+fjlPPtYNnToD6ge9MUppwp9KPRv22oJpgVgryVKVBo42sr2SHGbkOPvXlfDXA0Ws4MbosP81L6PxY02OMajak7HSD5FrpzOrmp4bmpmIv7UEZUTM+ZOQ6o/JwRpTwOkdzI30loY7MGT3di6mUY8xAUGvRo+fVCbrtAZM3IpzkAeERYsDayMQayrLZJF4jTxZA0zqTZvmCePYRqyjQ1BHy+VX1nDX+mYqsCr23d2lQV7ZaQ56lQCtV6ojrwlxOgTRZ5+v0OfWlhnKIIPjAXs+lgNhYwIZ3JQQmiDs347XIWhP7U4hZEher+x3TJKFSK1XH7qfU7XJ0ETNxjDHGvqs0PP1wav0zCq4sPQWxbpwxWlsCtF2yBbA6T8r75kqHz0CmE3XEn/DhdlyS7W7uCTBGLG5flpFmKj3xGjZXSUFMXilUQ1k4f/pkWZlwPcTVRPW+jIaZgy8um1CD+2L7oTgpOrScbOBTkaH5feQxA2SKdjJZdBIM61piq+o5crdztivQYC0eZdARe9uX1NNaK+1nJcrZMzvBFrAwHgUdqnDfjrJab2zyMVwMit/3LyH+hJj838TCVnU27Fay+5RKruzhdNwiyM9iFtlCCFCdVhlIQRujVS+QVrn5cqSAI2XS8eXZ3xcCQOO5H8aHIOdszWdKts5FQbduqvZKxvYlLg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR11MB1718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(76116006)(66476007)(6506007)(107886003)(64756008)(66556008)(66446008)(52536014)(54906003)(71200400001)(110136005)(83380400001)(53546011)(7696005)(66946007)(86362001)(2906002)(316002)(122000001)(5660300002)(508600001)(8676002)(38070700005)(38100700002)(33656002)(55016002)(186003)(8936002)(7416002)(9686003)(30864003)(26005)(4326008)(559001)(569008)(579004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?1S5xgSU4i6MN2AjRL+8eqPLz0Bf7QX2CCZU74LcLyMYXJE2Qt49nEP6c?= =?Windows-1252?Q?TeDbFNdl/5y/tHtLBOxz0xw7PP03lbkF7wuNg6wAYTu3Xu5krC7eTLcr?= =?Windows-1252?Q?vR1tFA1TYePAwjP5QwoedhjlIX2BircwU7nkM0N0hDhUtpIxBafEjS0A?= =?Windows-1252?Q?cxKiScCBIZmDBGPCLkpcQsbyONcdSDfDcVzaFkur/edzRr0uadicEddC?= =?Windows-1252?Q?9nrr2v9bU8dpwU9bnDc72GG+oZ/JkolKILUzQ2rLoKvYJ54/fiKtknDR?= =?Windows-1252?Q?oEfQ/Q3eh80bfEj3r0e9IooUVl5r/uwwzFToB/rnN8Yt0zDSdQB7s2uW?= =?Windows-1252?Q?adGbrH7OxT+iK3Xwklslv6fkXqh4OpteeZAhuIELbIk7KPGzyJitB6ij?= =?Windows-1252?Q?2Pa6wGaQdHauT5W+/M/6wS0QzJRfZLFCYrMs5Y8Z89yO3Y9jrAs9kGTj?= =?Windows-1252?Q?6bIdbPODdQnL40xVBRgNW7t/hqIa5+eHFcit3QhslH6BAAcNBruFCg63?= =?Windows-1252?Q?d7xIPcYOTEEctwJxd7R00uSTbdCy1kKFILMBubiM+5S4aSsk65slSnXp?= =?Windows-1252?Q?U1O8KyzZ3SMIYNzHl43+JvTJCEgh7XVDozbgwhv+H7uHAtCmu5YkuaDg?= =?Windows-1252?Q?PPR45FA+RaVCSd0iyMw7HsE5kcmTXWreI1fW3wXwYSQd52d9MOBdxgZR?= =?Windows-1252?Q?i3VMUEV5XIXWI65EU9OvmIsZboVjBDm05xQW2aUNVRP6ovzstMsJb+YE?= =?Windows-1252?Q?cYCiT5+6AZsdO/Oxs043c+Z/mAIZORWNa4nG8mbSZ5C38Xdnx48yoYEr?= =?Windows-1252?Q?ZXUHypAjETJV3fR5y4qjfvTuFAOOZHxCuIu6D+hAqkEAlBGxDPh0Gzlu?= =?Windows-1252?Q?aMFJt1e9iv50deMcoLBYs/I5TfXW5f8SxVCgx9g+O6W2MxslxVtG8hX7?= =?Windows-1252?Q?awjKlRCk+sBbDiwxthryDKHf2gk8CuCXL84QPKWS5Pg7zUKmLWEwDB/7?= =?Windows-1252?Q?JhPTdtM5B3DwOyVpftrwX/6rNoiruQfUDMO9IK4J4sUmQVqDyUk6TWWu?= =?Windows-1252?Q?5jEoK/qM3jXxZy5+kY3RMV7OBItv0+JF4J4KLvABE4S+iYwg2qZIQnwY?= =?Windows-1252?Q?z+drLZ4VxNJcbWwy9gkmt4kf+CUBKTxGd2Slxkj2yL03rW7U+lQeBGtx?= =?Windows-1252?Q?0gkOeyHyVkFaxC3YNATQefa27HGl5g4bE7xXSIUO+oUBEObjgzK8eUEr?= =?Windows-1252?Q?k9MdGsHJb1YKAz9pQDxP9xt4Tya8E0xwVeTHFMi12SUuA2GI/F7dfv4F?= =?Windows-1252?Q?7MFt+bRe2XbTlCiyztudUtzmylSir9LFeqZruIHyzsbg8tfRc5wpW9cY?= =?Windows-1252?Q?dlKHU+qPeyp6BpTPcfOapwhSQxxB4/TWq7kPdHnBWwAJNUGNuJ77aqln?= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB1718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94e14f2d-35d0-4695-3ae1-08d984f3961a X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Oct 2021 15:53:17.6668 (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: rd+mKF50CHl+XBq1VNU6xBM7oJR42KmTbB6IgM00JB3xHzsk5urnxKA9t7nRa9RRQaUCU6UnwQa+vQSy1fI2Xw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1463 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 3/3] cryptodev: rework session framework 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 Sender: "dev" Hi Akhil, Your patch failed all QAT tests - maybe it will fail on all PMDs requiring = to know the session's physical address (such as nitrox, caam). The reason is QAT PMD driver cannot know the physical address of the sessio= n private data passed into it - as the private data is computed by=20 rte_cryptodev_sym_session_init() from the start of the session (which has a= mempool obj header with valid physical address) to the offset for that dri= ver type. The session private data pointer - although is a valid buffer - d= oes not have the obj header that contains the physical address. I think the solution can be - instead of passing the session private data, = the rte_cryptodev_sym_session pointer should be passed and a macro shall be= provided to the drivers to manually compute the offset and then find the c= orrect session private data from the session for itself. Regards, Fan > -----Original Message----- > From: Akhil Goyal > Sent: Thursday, September 30, 2021 3:50 PM > To: dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; > hemant.agrawal@nxp.com; anoobj@marvell.com; De Lara Guarch, Pablo > ; Trahe, Fiona ; > Doherty, Declan ; matan@nvidia.com; > g.singh@nxp.com; Zhang, Roy Fan ; > jianjay.zhou@huawei.com; asomalap@amd.com; ruifeng.wang@arm.com; > Ananyev, Konstantin ; Nicolau, Radu > ; ajit.khaparde@broadcom.com; > rnagadheeraj@marvell.com; adwivedi@marvell.com; Power, Ciara > ; Akhil Goyal > Subject: [PATCH 3/3] cryptodev: rework session framework >=20 > As per current design, rte_cryptodev_sym_session_create() and > rte_cryptodev_sym_session_init() use separate mempool objects > for a single session. > And structure rte_cryptodev_sym_session is not directly used > by the application, it may cause ABI breakage if the structure > is modified in future. >=20 > To address these two issues, the rte_cryptodev_sym_session_create > will take one mempool object for both the session and session > private data. The API rte_cryptodev_sym_session_init will now not > take mempool object. > rte_cryptodev_sym_session_create will now return an opaque session > pointer which will be used by the app in rte_cryptodev_sym_session_init > and other APIs. >=20 > With this change, rte_cryptodev_sym_session_init will send > pointer to session private data of corresponding driver to the PMD > based on the driver_id for filling the PMD data. >=20 > In data path, opaque session pointer is attached to rte_crypto_op > and the PMD can call an internal library API to get the session > private data pointer based on the driver id. >=20 > TODO: > - inline APIs for opaque data > - move rte_cryptodev_sym_session struct to cryptodev_pmd.h > - currently nb_drivers are getting updated in RTE_INIT which > result in increasing the memory requirements for session. > This will be moved to PMD probe so that memory is created > only for those PMDs which are probed and not just compiled in. >=20 > Signed-off-by: Akhil Goyal > --- > app/test-crypto-perf/cperf.h | 1 - > app/test-crypto-perf/cperf_ops.c | 33 ++--- > app/test-crypto-perf/cperf_ops.h | 6 +- > app/test-crypto-perf/cperf_test_latency.c | 5 +- > app/test-crypto-perf/cperf_test_latency.h | 1 - > .../cperf_test_pmd_cyclecount.c | 5 +- > .../cperf_test_pmd_cyclecount.h | 1 - > app/test-crypto-perf/cperf_test_throughput.c | 5 +- > app/test-crypto-perf/cperf_test_throughput.h | 1 - > app/test-crypto-perf/cperf_test_verify.c | 5 +- > app/test-crypto-perf/cperf_test_verify.h | 1 - > app/test-crypto-perf/main.c | 29 +--- > app/test/test_cryptodev.c | 130 +++++------------- > app/test/test_cryptodev.h | 1 - > app/test/test_cryptodev_asym.c | 1 - > app/test/test_cryptodev_blockcipher.c | 6 +- > app/test/test_event_crypto_adapter.c | 28 +--- > app/test/test_ipsec.c | 22 +-- > drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c | 33 +---- > .../crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 34 +---- > drivers/crypto/armv8/rte_armv8_pmd_ops.c | 34 +---- > drivers/crypto/bcmfs/bcmfs_sym_session.c | 36 +---- > drivers/crypto/bcmfs/bcmfs_sym_session.h | 6 +- > drivers/crypto/caam_jr/caam_jr.c | 32 ++--- > drivers/crypto/ccp/ccp_pmd_ops.c | 32 +---- > drivers/crypto/cnxk/cn10k_cryptodev_ops.c | 18 ++- > drivers/crypto/cnxk/cn9k_cryptodev_ops.c | 18 +-- > drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 61 +++----- > drivers/crypto/cnxk/cnxk_cryptodev_ops.h | 13 +- > drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 29 +--- > drivers/crypto/dpaa_sec/dpaa_sec.c | 31 +---- > drivers/crypto/kasumi/rte_kasumi_pmd_ops.c | 34 +---- > drivers/crypto/mlx5/mlx5_crypto.c | 24 +--- > drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 36 ++--- > drivers/crypto/nitrox/nitrox_sym.c | 31 +---- > drivers/crypto/null/null_crypto_pmd_ops.c | 34 +---- > .../crypto/octeontx/otx_cryptodev_hw_access.h | 1 - > drivers/crypto/octeontx/otx_cryptodev_ops.c | 60 +++----- > drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 52 +++---- > .../octeontx2/otx2_cryptodev_ops_helper.h | 16 +-- > drivers/crypto/openssl/rte_openssl_pmd_ops.c | 35 +---- > drivers/crypto/qat/qat_sym_session.c | 29 +--- > drivers/crypto/qat/qat_sym_session.h | 6 +- > drivers/crypto/scheduler/scheduler_pmd_ops.c | 9 +- > drivers/crypto/snow3g/rte_snow3g_pmd_ops.c | 34 +---- > drivers/crypto/virtio/virtio_cryptodev.c | 31 ++--- > drivers/crypto/zuc/rte_zuc_pmd_ops.c | 35 +---- > .../octeontx2/otx2_evdev_crypto_adptr_rx.h | 3 +- > examples/fips_validation/fips_dev_self_test.c | 32 ++--- > examples/fips_validation/main.c | 20 +-- > examples/ipsec-secgw/ipsec-secgw.c | 72 +++++----- > examples/ipsec-secgw/ipsec.c | 3 +- > examples/ipsec-secgw/ipsec.h | 1 - > examples/ipsec-secgw/ipsec_worker.c | 4 - > examples/l2fwd-crypto/main.c | 41 +----- > examples/vhost_crypto/main.c | 16 +-- > lib/cryptodev/cryptodev_pmd.h | 7 +- > lib/cryptodev/rte_crypto.h | 2 +- > lib/cryptodev/rte_crypto_sym.h | 2 +- > lib/cryptodev/rte_cryptodev.c | 73 ++++++---- > lib/cryptodev/rte_cryptodev.h | 23 ++-- > lib/cryptodev/rte_cryptodev_trace.h | 5 +- > lib/pipeline/rte_table_action.c | 8 +- > lib/pipeline/rte_table_action.h | 2 +- > lib/vhost/rte_vhost_crypto.h | 3 - > lib/vhost/vhost_crypto.c | 7 +- > 66 files changed, 399 insertions(+), 1050 deletions(-) >=20 > diff --git a/app/test-crypto-perf/cperf.h b/app/test-crypto-perf/cperf.h > index 2b0aad095c..db58228dce 100644 > --- a/app/test-crypto-perf/cperf.h > +++ b/app/test-crypto-perf/cperf.h > @@ -15,7 +15,6 @@ struct cperf_op_fns; >=20 > typedef void *(*cperf_constructor_t)( > struct rte_mempool *sess_mp, > - struct rte_mempool *sess_priv_mp, > uint8_t dev_id, > uint16_t qp_id, > const struct cperf_options *options, > diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto- > perf/cperf_ops.c > index 1b3cbe77b9..f094bc656d 100644 > --- a/app/test-crypto-perf/cperf_ops.c > +++ b/app/test-crypto-perf/cperf_ops.c > @@ -12,7 +12,7 @@ static int > cperf_set_ops_asym(struct rte_crypto_op **ops, > uint32_t src_buf_offset __rte_unused, > uint32_t dst_buf_offset __rte_unused, uint16_t nb_ops, > - struct rte_cryptodev_sym_session *sess, > + void *sess, > const struct cperf_options *options __rte_unused, > const struct cperf_test_vector *test_vector __rte_unused, > uint16_t iv_offset __rte_unused, > @@ -40,7 +40,7 @@ static int > cperf_set_ops_security(struct rte_crypto_op **ops, > uint32_t src_buf_offset __rte_unused, > uint32_t dst_buf_offset __rte_unused, > - uint16_t nb_ops, struct rte_cryptodev_sym_session *sess, > + uint16_t nb_ops, void *sess, > const struct cperf_options *options __rte_unused, > const struct cperf_test_vector *test_vector __rte_unused, > uint16_t iv_offset __rte_unused, uint32_t *imix_idx) > @@ -106,7 +106,7 @@ cperf_set_ops_security(struct rte_crypto_op **ops, > static int > cperf_set_ops_null_cipher(struct rte_crypto_op **ops, > uint32_t src_buf_offset, uint32_t dst_buf_offset, > - uint16_t nb_ops, struct rte_cryptodev_sym_session *sess, > + uint16_t nb_ops, void *sess, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector __rte_unused, > uint16_t iv_offset __rte_unused, uint32_t *imix_idx) > @@ -145,7 +145,7 @@ cperf_set_ops_null_cipher(struct rte_crypto_op > **ops, > static int > cperf_set_ops_null_auth(struct rte_crypto_op **ops, > uint32_t src_buf_offset, uint32_t dst_buf_offset, > - uint16_t nb_ops, struct rte_cryptodev_sym_session *sess, > + uint16_t nb_ops, void *sess, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector __rte_unused, > uint16_t iv_offset __rte_unused, uint32_t *imix_idx) > @@ -184,7 +184,7 @@ cperf_set_ops_null_auth(struct rte_crypto_op **ops, > static int > cperf_set_ops_cipher(struct rte_crypto_op **ops, > uint32_t src_buf_offset, uint32_t dst_buf_offset, > - uint16_t nb_ops, struct rte_cryptodev_sym_session *sess, > + uint16_t nb_ops, void *sess, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > uint16_t iv_offset, uint32_t *imix_idx) > @@ -240,7 +240,7 @@ cperf_set_ops_cipher(struct rte_crypto_op **ops, > static int > cperf_set_ops_auth(struct rte_crypto_op **ops, > uint32_t src_buf_offset, uint32_t dst_buf_offset, > - uint16_t nb_ops, struct rte_cryptodev_sym_session *sess, > + uint16_t nb_ops, void *sess, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > uint16_t iv_offset, uint32_t *imix_idx) > @@ -340,7 +340,7 @@ cperf_set_ops_auth(struct rte_crypto_op **ops, > static int > cperf_set_ops_cipher_auth(struct rte_crypto_op **ops, > uint32_t src_buf_offset, uint32_t dst_buf_offset, > - uint16_t nb_ops, struct rte_cryptodev_sym_session *sess, > + uint16_t nb_ops, void *sess, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > uint16_t iv_offset, uint32_t *imix_idx) > @@ -455,7 +455,7 @@ cperf_set_ops_cipher_auth(struct rte_crypto_op > **ops, > static int > cperf_set_ops_aead(struct rte_crypto_op **ops, > uint32_t src_buf_offset, uint32_t dst_buf_offset, > - uint16_t nb_ops, struct rte_cryptodev_sym_session *sess, > + uint16_t nb_ops, void *sess, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > uint16_t iv_offset, uint32_t *imix_idx) > @@ -563,9 +563,8 @@ cperf_set_ops_aead(struct rte_crypto_op **ops, > return 0; > } >=20 > -static struct rte_cryptodev_sym_session * > +static void * > cperf_create_session(struct rte_mempool *sess_mp, > - struct rte_mempool *priv_mp, > uint8_t dev_id, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > @@ -590,7 +589,7 @@ cperf_create_session(struct rte_mempool *sess_mp, > if (sess =3D=3D NULL) > return NULL; > rc =3D rte_cryptodev_asym_session_init(dev_id, (void *)sess, > - &xform, priv_mp); > + &xform, sess_mp); > if (rc < 0) { > if (sess !=3D NULL) { > rte_cryptodev_asym_session_clear(dev_id, > @@ -742,8 +741,7 @@ cperf_create_session(struct rte_mempool *sess_mp, > cipher_xform.cipher.iv.length =3D 0; > } > /* create crypto session */ > - rte_cryptodev_sym_session_init(dev_id, sess, > &cipher_xform, > - priv_mp); > + rte_cryptodev_sym_session_init(dev_id, sess, > &cipher_xform); > /* > * auth only > */ > @@ -770,8 +768,7 @@ cperf_create_session(struct rte_mempool *sess_mp, > auth_xform.auth.iv.length =3D 0; > } > /* create crypto session */ > - rte_cryptodev_sym_session_init(dev_id, sess, &auth_xform, > - priv_mp); > + rte_cryptodev_sym_session_init(dev_id, sess, > &auth_xform); > /* > * cipher and auth > */ > @@ -830,12 +827,12 @@ cperf_create_session(struct rte_mempool > *sess_mp, > cipher_xform.next =3D &auth_xform; > /* create crypto session */ > rte_cryptodev_sym_session_init(dev_id, > - sess, &cipher_xform, priv_mp); > + sess, &cipher_xform); > } else { /* auth then cipher */ > auth_xform.next =3D &cipher_xform; > /* create crypto session */ > rte_cryptodev_sym_session_init(dev_id, > - sess, &auth_xform, priv_mp); > + sess, &auth_xform); > } > } else { /* options->op_type =3D=3D CPERF_AEAD */ > aead_xform.type =3D RTE_CRYPTO_SYM_XFORM_AEAD; > @@ -856,7 +853,7 @@ cperf_create_session(struct rte_mempool *sess_mp, >=20 > /* Create crypto session */ > rte_cryptodev_sym_session_init(dev_id, > - sess, &aead_xform, priv_mp); > + sess, &aead_xform); > } >=20 > return sess; > diff --git a/app/test-crypto-perf/cperf_ops.h b/app/test-crypto- > perf/cperf_ops.h > index ff125d12cd..3ff10491a0 100644 > --- a/app/test-crypto-perf/cperf_ops.h > +++ b/app/test-crypto-perf/cperf_ops.h > @@ -12,15 +12,15 @@ > #include "cperf_test_vectors.h" >=20 >=20 > -typedef struct rte_cryptodev_sym_session *(*cperf_sessions_create_t)( > - struct rte_mempool *sess_mp, struct rte_mempool > *sess_priv_mp, > +typedef void *(*cperf_sessions_create_t)( > + struct rte_mempool *sess_mp, > uint8_t dev_id, const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > uint16_t iv_offset); >=20 > typedef int (*cperf_populate_ops_t)(struct rte_crypto_op **ops, > uint32_t src_buf_offset, uint32_t dst_buf_offset, > - uint16_t nb_ops, struct rte_cryptodev_sym_session *sess, > + uint16_t nb_ops, void *sess, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > uint16_t iv_offset, uint32_t *imix_idx); > diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto- > perf/cperf_test_latency.c > index 159fe8492b..4193f7e777 100644 > --- a/app/test-crypto-perf/cperf_test_latency.c > +++ b/app/test-crypto-perf/cperf_test_latency.c > @@ -24,7 +24,7 @@ struct cperf_latency_ctx { >=20 > struct rte_mempool *pool; >=20 > - struct rte_cryptodev_sym_session *sess; > + void *sess; >=20 > cperf_populate_ops_t populate_ops; >=20 > @@ -59,7 +59,6 @@ cperf_latency_test_free(struct cperf_latency_ctx *ctx) >=20 > void * > cperf_latency_test_constructor(struct rte_mempool *sess_mp, > - struct rte_mempool *sess_priv_mp, > uint8_t dev_id, uint16_t qp_id, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > @@ -84,7 +83,7 @@ cperf_latency_test_constructor(struct rte_mempool > *sess_mp, > sizeof(struct rte_crypto_sym_op) + > sizeof(struct cperf_op_result *); >=20 > - ctx->sess =3D op_fns->sess_create(sess_mp, sess_priv_mp, dev_id, > options, > + ctx->sess =3D op_fns->sess_create(sess_mp, dev_id, options, > test_vector, iv_offset); > if (ctx->sess =3D=3D NULL) > goto err; > diff --git a/app/test-crypto-perf/cperf_test_latency.h b/app/test-crypto- > perf/cperf_test_latency.h > index ed5b0a07bb..d3fc3218d7 100644 > --- a/app/test-crypto-perf/cperf_test_latency.h > +++ b/app/test-crypto-perf/cperf_test_latency.h > @@ -17,7 +17,6 @@ > void * > cperf_latency_test_constructor( > struct rte_mempool *sess_mp, > - struct rte_mempool *sess_priv_mp, > uint8_t dev_id, > uint16_t qp_id, > const struct cperf_options *options, > diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c b/app/test- > crypto-perf/cperf_test_pmd_cyclecount.c > index cbbbedd9ba..3dd489376f 100644 > --- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c > +++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c > @@ -27,7 +27,7 @@ struct cperf_pmd_cyclecount_ctx { > struct rte_crypto_op **ops; > struct rte_crypto_op **ops_processed; >=20 > - struct rte_cryptodev_sym_session *sess; > + void *sess; >=20 > cperf_populate_ops_t populate_ops; >=20 > @@ -93,7 +93,6 @@ cperf_pmd_cyclecount_test_free(struct > cperf_pmd_cyclecount_ctx *ctx) >=20 > void * > cperf_pmd_cyclecount_test_constructor(struct rte_mempool *sess_mp, > - struct rte_mempool *sess_priv_mp, > uint8_t dev_id, uint16_t qp_id, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > @@ -120,7 +119,7 @@ cperf_pmd_cyclecount_test_constructor(struct > rte_mempool *sess_mp, > uint16_t iv_offset =3D sizeof(struct rte_crypto_op) + > sizeof(struct rte_crypto_sym_op); >=20 > - ctx->sess =3D op_fns->sess_create(sess_mp, sess_priv_mp, dev_id, > options, > + ctx->sess =3D op_fns->sess_create(sess_mp, dev_id, options, > test_vector, iv_offset); > if (ctx->sess =3D=3D NULL) > goto err; > diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.h b/app/test- > crypto-perf/cperf_test_pmd_cyclecount.h > index 3084038a18..beb4419910 100644 > --- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.h > +++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.h > @@ -18,7 +18,6 @@ > void * > cperf_pmd_cyclecount_test_constructor( > struct rte_mempool *sess_mp, > - struct rte_mempool *sess_priv_mp, > uint8_t dev_id, > uint16_t qp_id, > const struct cperf_options *options, > diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-cryp= to- > perf/cperf_test_throughput.c > index 76fcda47ff..dc5c48b4da 100644 > --- a/app/test-crypto-perf/cperf_test_throughput.c > +++ b/app/test-crypto-perf/cperf_test_throughput.c > @@ -18,7 +18,7 @@ struct cperf_throughput_ctx { >=20 > struct rte_mempool *pool; >=20 > - struct rte_cryptodev_sym_session *sess; > + void *sess; >=20 > cperf_populate_ops_t populate_ops; >=20 > @@ -64,7 +64,6 @@ cperf_throughput_test_free(struct > cperf_throughput_ctx *ctx) >=20 > void * > cperf_throughput_test_constructor(struct rte_mempool *sess_mp, > - struct rte_mempool *sess_priv_mp, > uint8_t dev_id, uint16_t qp_id, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > @@ -87,7 +86,7 @@ cperf_throughput_test_constructor(struct > rte_mempool *sess_mp, > uint16_t iv_offset =3D sizeof(struct rte_crypto_op) + > sizeof(struct rte_crypto_sym_op); >=20 > - ctx->sess =3D op_fns->sess_create(sess_mp, sess_priv_mp, dev_id, > options, > + ctx->sess =3D op_fns->sess_create(sess_mp, dev_id, options, > test_vector, iv_offset); > if (ctx->sess =3D=3D NULL) > goto err; > diff --git a/app/test-crypto-perf/cperf_test_throughput.h b/app/test- > crypto-perf/cperf_test_throughput.h > index 91e1a4b708..439ec8e559 100644 > --- a/app/test-crypto-perf/cperf_test_throughput.h > +++ b/app/test-crypto-perf/cperf_test_throughput.h > @@ -18,7 +18,6 @@ > void * > cperf_throughput_test_constructor( > struct rte_mempool *sess_mp, > - struct rte_mempool *sess_priv_mp, > uint8_t dev_id, > uint16_t qp_id, > const struct cperf_options *options, > diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto- > perf/cperf_test_verify.c > index 2939aeaa93..cf561dd700 100644 > --- a/app/test-crypto-perf/cperf_test_verify.c > +++ b/app/test-crypto-perf/cperf_test_verify.c > @@ -18,7 +18,7 @@ struct cperf_verify_ctx { >=20 > struct rte_mempool *pool; >=20 > - struct rte_cryptodev_sym_session *sess; > + void *sess; >=20 > cperf_populate_ops_t populate_ops; >=20 > @@ -51,7 +51,6 @@ cperf_verify_test_free(struct cperf_verify_ctx *ctx) >=20 > void * > cperf_verify_test_constructor(struct rte_mempool *sess_mp, > - struct rte_mempool *sess_priv_mp, > uint8_t dev_id, uint16_t qp_id, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > @@ -74,7 +73,7 @@ cperf_verify_test_constructor(struct rte_mempool > *sess_mp, > uint16_t iv_offset =3D sizeof(struct rte_crypto_op) + > sizeof(struct rte_crypto_sym_op); >=20 > - ctx->sess =3D op_fns->sess_create(sess_mp, sess_priv_mp, dev_id, > options, > + ctx->sess =3D op_fns->sess_create(sess_mp, dev_id, options, > test_vector, iv_offset); > if (ctx->sess =3D=3D NULL) > goto err; > diff --git a/app/test-crypto-perf/cperf_test_verify.h b/app/test-crypto- > perf/cperf_test_verify.h > index ac2192ba99..9f70ad87ba 100644 > --- a/app/test-crypto-perf/cperf_test_verify.h > +++ b/app/test-crypto-perf/cperf_test_verify.h > @@ -18,7 +18,6 @@ > void * > cperf_verify_test_constructor( > struct rte_mempool *sess_mp, > - struct rte_mempool *sess_priv_mp, > uint8_t dev_id, > uint16_t qp_id, > const struct cperf_options *options, > diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c > index 390380898e..c3327b7e55 100644 > --- a/app/test-crypto-perf/main.c > +++ b/app/test-crypto-perf/main.c > @@ -118,35 +118,14 @@ fill_session_pool_socket(int32_t socket_id, > uint32_t session_priv_size, > char mp_name[RTE_MEMPOOL_NAMESIZE]; > struct rte_mempool *sess_mp; >=20 > - if (session_pool_socket[socket_id].priv_mp =3D=3D NULL) { > - snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, > - "priv_sess_mp_%u", socket_id); > - > - sess_mp =3D rte_mempool_create(mp_name, > - nb_sessions, > - session_priv_size, > - 0, 0, NULL, NULL, NULL, > - NULL, socket_id, > - 0); > - > - if (sess_mp =3D=3D NULL) { > - printf("Cannot create pool \"%s\" on socket %d\n", > - mp_name, socket_id); > - return -ENOMEM; > - } > - > - printf("Allocated pool \"%s\" on socket %d\n", > - mp_name, socket_id); > - session_pool_socket[socket_id].priv_mp =3D sess_mp; > - } > - > if (session_pool_socket[socket_id].sess_mp =3D=3D NULL) { >=20 > snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, > "sess_mp_%u", socket_id); >=20 > sess_mp =3D > rte_cryptodev_sym_session_pool_create(mp_name, > - nb_sessions, 0, 0, 0, socket_id); > + nb_sessions, session_priv_size, > + 0, 0, socket_id); >=20 > if (sess_mp =3D=3D NULL) { > printf("Cannot create pool \"%s\" on socket %d\n", > @@ -344,12 +323,9 @@ cperf_initialize_cryptodev(struct cperf_options > *opts, uint8_t *enabled_cdevs) > return ret; >=20 > qp_conf.mp_session =3D > session_pool_socket[socket_id].sess_mp; > - qp_conf.mp_session_private =3D > - session_pool_socket[socket_id].priv_mp; >=20 > if (opts->op_type =3D=3D CPERF_ASYM_MODEX) { > qp_conf.mp_session =3D NULL; > - qp_conf.mp_session_private =3D NULL; > } >=20 > ret =3D rte_cryptodev_configure(cdev_id, &conf); > @@ -704,7 +680,6 @@ main(int argc, char **argv) >=20 > ctx[i] =3D cperf_testmap[opts.test].constructor( > session_pool_socket[socket_id].sess_mp, > - session_pool_socket[socket_id].priv_mp, > cdev_id, qp_id, > &opts, t_vec, &op_fns); > if (ctx[i] =3D=3D NULL) { > diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c > index 82f819211a..e5c7930c63 100644 > --- a/app/test/test_cryptodev.c > +++ b/app/test/test_cryptodev.c > @@ -79,7 +79,7 @@ struct crypto_unittest_params { > #endif >=20 > union { > - struct rte_cryptodev_sym_session *sess; > + void *sess; > #ifdef RTE_LIB_SECURITY > void *sec_session; > #endif > @@ -119,7 +119,7 @@ > test_AES_CBC_HMAC_SHA512_decrypt_create_session_params( > uint8_t *hmac_key); >=20 > static int > -test_AES_CBC_HMAC_SHA512_decrypt_perform(struct > rte_cryptodev_sym_session *sess, > +test_AES_CBC_HMAC_SHA512_decrypt_perform(void *sess, > struct crypto_unittest_params *ut_params, > struct crypto_testsuite_params *ts_param, > const uint8_t *cipher, > @@ -596,23 +596,11 @@ testsuite_setup(void) > } >=20 > ts_params->session_mpool =3D > rte_cryptodev_sym_session_pool_create( > - "test_sess_mp", MAX_NB_SESSIONS, 0, 0, 0, > + "test_sess_mp", MAX_NB_SESSIONS, session_size, 0, > 0, > SOCKET_ID_ANY); > TEST_ASSERT_NOT_NULL(ts_params->session_mpool, > "session mempool allocation failed"); >=20 > - ts_params->session_priv_mpool =3D rte_mempool_create( > - "test_sess_mp_priv", > - MAX_NB_SESSIONS, > - session_size, > - 0, 0, NULL, NULL, NULL, > - NULL, SOCKET_ID_ANY, > - 0); > - TEST_ASSERT_NOT_NULL(ts_params->session_priv_mpool, > - "session mempool allocation failed"); > - > - > - > TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id, > &ts_params->conf), > "Failed to configure cryptodev %u with %u qps", > @@ -620,7 +608,6 @@ testsuite_setup(void) >=20 > ts_params->qp_conf.nb_descriptors =3D MAX_NUM_OPS_INFLIGHT; > ts_params->qp_conf.mp_session =3D ts_params->session_mpool; > - ts_params->qp_conf.mp_session_private =3D ts_params- > >session_priv_mpool; >=20 > for (qp_id =3D 0; qp_id < info.max_nb_queue_pairs; qp_id++) { > TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup( > @@ -650,11 +637,6 @@ testsuite_teardown(void) > } >=20 > /* Free session mempools */ > - if (ts_params->session_priv_mpool !=3D NULL) { > - rte_mempool_free(ts_params->session_priv_mpool); > - ts_params->session_priv_mpool =3D NULL; > - } > - > if (ts_params->session_mpool !=3D NULL) { > rte_mempool_free(ts_params->session_mpool); > ts_params->session_mpool =3D NULL; > @@ -1330,7 +1312,6 @@ dev_configure_and_start(uint64_t ff_disable) > ts_params->conf.ff_disable =3D ff_disable; > ts_params->qp_conf.nb_descriptors =3D MAX_NUM_OPS_INFLIGHT; > ts_params->qp_conf.mp_session =3D ts_params->session_mpool; > - ts_params->qp_conf.mp_session_private =3D ts_params- > >session_priv_mpool; >=20 > TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params- > >valid_devs[0], > &ts_params->conf), > @@ -1552,7 +1533,6 @@ test_queue_pair_descriptor_setup(void) > */ > qp_conf.nb_descriptors =3D MIN_NUM_OPS_INFLIGHT; /* min size*/ > qp_conf.mp_session =3D ts_params->session_mpool; > - qp_conf.mp_session_private =3D ts_params->session_priv_mpool; >=20 > for (qp_id =3D 0; qp_id < ts_params->conf.nb_queue_pairs; qp_id++) { > TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup( > @@ -2146,8 +2126,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void) >=20 > /* Create crypto session*/ > rte_cryptodev_sym_session_init(ts_params->valid_devs[0], > - ut_params->sess, &ut_params->cipher_xform, > - ts_params->session_priv_mpool); > + ut_params->sess, &ut_params->cipher_xform); > TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation > failed"); >=20 > /* Generate crypto op data structure */ > @@ -2247,7 +2226,7 @@ > test_AES_CBC_HMAC_SHA512_decrypt_create_session_params( > uint8_t *hmac_key); >=20 > static int > -test_AES_CBC_HMAC_SHA512_decrypt_perform(struct > rte_cryptodev_sym_session *sess, > +test_AES_CBC_HMAC_SHA512_decrypt_perform(void *sess, > struct crypto_unittest_params *ut_params, > struct crypto_testsuite_params *ts_params, > const uint8_t *cipher, > @@ -2288,7 +2267,7 @@ > test_AES_CBC_HMAC_SHA512_decrypt_create_session_params( >=20 >=20 > static int > -test_AES_CBC_HMAC_SHA512_decrypt_perform(struct > rte_cryptodev_sym_session *sess, > +test_AES_CBC_HMAC_SHA512_decrypt_perform(void *sess, > struct crypto_unittest_params *ut_params, > struct crypto_testsuite_params *ts_params, > const uint8_t *cipher, > @@ -2401,8 +2380,7 @@ create_wireless_algo_hash_session(uint8_t dev_id, > ts_params->session_mpool); >=20 > status =3D rte_cryptodev_sym_session_init(dev_id, ut_params->sess, > - &ut_params->auth_xform, > - ts_params->session_priv_mpool); > + &ut_params->auth_xform); > if (status =3D=3D -ENOTSUP) > return TEST_SKIPPED; >=20 > @@ -2443,8 +2421,7 @@ create_wireless_algo_cipher_session(uint8_t > dev_id, > ts_params->session_mpool); >=20 > status =3D rte_cryptodev_sym_session_init(dev_id, ut_params->sess, > - &ut_params->cipher_xform, > - ts_params->session_priv_mpool); > + &ut_params->cipher_xform); > if (status =3D=3D -ENOTSUP) > return TEST_SKIPPED; >=20 > @@ -2566,8 +2543,7 @@ create_wireless_algo_cipher_auth_session(uint8_t > dev_id, > TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation > failed"); >=20 > status =3D rte_cryptodev_sym_session_init(dev_id, ut_params->sess, > - &ut_params->cipher_xform, > - ts_params->session_priv_mpool); > + &ut_params->cipher_xform); > if (status =3D=3D -ENOTSUP) > return TEST_SKIPPED; >=20 > @@ -2629,8 +2605,7 @@ create_wireless_cipher_auth_session(uint8_t > dev_id, > ts_params->session_mpool); >=20 > status =3D rte_cryptodev_sym_session_init(dev_id, ut_params->sess, > - &ut_params->cipher_xform, > - ts_params->session_priv_mpool); > + &ut_params->cipher_xform); > if (status =3D=3D -ENOTSUP) > return TEST_SKIPPED; >=20 > @@ -2699,13 +2674,11 @@ > create_wireless_algo_auth_cipher_session(uint8_t dev_id, > ut_params->auth_xform.next =3D NULL; > ut_params->cipher_xform.next =3D &ut_params->auth_xform; > status =3D rte_cryptodev_sym_session_init(dev_id, > ut_params->sess, > - &ut_params->cipher_xform, > - ts_params->session_priv_mpool); > + &ut_params->cipher_xform); >=20 > } else > status =3D rte_cryptodev_sym_session_init(dev_id, > ut_params->sess, > - &ut_params->auth_xform, > - ts_params->session_priv_mpool); > + &ut_params->auth_xform); >=20 > if (status =3D=3D -ENOTSUP) > return TEST_SKIPPED; > @@ -7838,8 +7811,7 @@ create_aead_session(uint8_t dev_id, enum > rte_crypto_aead_algorithm algo, > ts_params->session_mpool); >=20 > rte_cryptodev_sym_session_init(dev_id, ut_params->sess, > - &ut_params->aead_xform, > - ts_params->session_priv_mpool); > + &ut_params->aead_xform); >=20 > TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation > failed"); >=20 > @@ -10992,8 +10964,7 @@ static int MD5_HMAC_create_session(struct > crypto_testsuite_params *ts_params, > ts_params->session_mpool); >=20 > rte_cryptodev_sym_session_init(ts_params->valid_devs[0], > - ut_params->sess, &ut_params->auth_xform, > - ts_params->session_priv_mpool); > + ut_params->sess, &ut_params->auth_xform); >=20 > if (ut_params->sess =3D=3D NULL) > return TEST_FAILED; > @@ -11206,7 +11177,7 @@ test_multi_session(void) > struct crypto_unittest_params *ut_params =3D &unittest_params; >=20 > struct rte_cryptodev_info dev_info; > - struct rte_cryptodev_sym_session **sessions; > + void **sessions; >=20 > uint16_t i; >=20 > @@ -11229,9 +11200,7 @@ test_multi_session(void) >=20 > rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); >=20 > - sessions =3D rte_malloc(NULL, > - sizeof(struct rte_cryptodev_sym_session *) * > - (MAX_NB_SESSIONS + 1), 0); > + sessions =3D rte_malloc(NULL, sizeof(void *) * (MAX_NB_SESSIONS + > 1), 0); >=20 > /* Create multiple crypto sessions*/ > for (i =3D 0; i < MAX_NB_SESSIONS; i++) { > @@ -11240,8 +11209,7 @@ test_multi_session(void) > ts_params->session_mpool); >=20 > rte_cryptodev_sym_session_init(ts_params->valid_devs[0], > - sessions[i], &ut_params->auth_xform, > - ts_params->session_priv_mpool); > + sessions[i], &ut_params->auth_xform); > TEST_ASSERT_NOT_NULL(sessions[i], > "Session creation failed at session > number %u", > i); > @@ -11279,8 +11247,7 @@ test_multi_session(void) > sessions[i] =3D NULL; > /* Next session create should fail */ > rte_cryptodev_sym_session_init(ts_params->valid_devs[0], > - sessions[i], &ut_params->auth_xform, > - ts_params->session_priv_mpool); > + sessions[i], &ut_params->auth_xform); > TEST_ASSERT_NULL(sessions[i], > "Session creation succeeded unexpectedly!"); >=20 > @@ -11311,7 +11278,7 @@ test_multi_session_random_usage(void) > { > struct crypto_testsuite_params *ts_params =3D &testsuite_params; > struct rte_cryptodev_info dev_info; > - struct rte_cryptodev_sym_session **sessions; > + void **sessions; > uint32_t i, j; > struct multi_session_params ut_paramz[] =3D { >=20 > @@ -11355,8 +11322,7 @@ test_multi_session_random_usage(void) > rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); >=20 > sessions =3D rte_malloc(NULL, > - (sizeof(struct rte_cryptodev_sym_session *) > - * MAX_NB_SESSIONS) + 1, 0); > + (sizeof(void *) * MAX_NB_SESSIONS) + 1, 0); >=20 > for (i =3D 0; i < MB_SESSION_NUMBER; i++) { > sessions[i] =3D rte_cryptodev_sym_session_create( > @@ -11373,8 +11339,7 @@ test_multi_session_random_usage(void) > rte_cryptodev_sym_session_init( > ts_params->valid_devs[0], > sessions[i], > - &ut_paramz[i].ut_params.auth_xform, > - ts_params->session_priv_mpool); > + &ut_paramz[i].ut_params.auth_xform); >=20 > TEST_ASSERT_NOT_NULL(sessions[i], > "Session creation failed at session > number %u", > @@ -11457,8 +11422,7 @@ test_null_invalid_operation(void) >=20 > /* Create Crypto session*/ > ret =3D rte_cryptodev_sym_session_init(ts_params->valid_devs[0], > - ut_params->sess, &ut_params->cipher_xform, > - ts_params->session_priv_mpool); > + ut_params->sess, &ut_params->cipher_xform); > TEST_ASSERT(ret < 0, > "Session creation succeeded unexpectedly"); >=20 > @@ -11475,8 +11439,7 @@ test_null_invalid_operation(void) >=20 > /* Create Crypto session*/ > ret =3D rte_cryptodev_sym_session_init(ts_params->valid_devs[0], > - ut_params->sess, &ut_params->auth_xform, > - ts_params->session_priv_mpool); > + ut_params->sess, &ut_params->auth_xform); > TEST_ASSERT(ret < 0, > "Session creation succeeded unexpectedly"); >=20 > @@ -11521,8 +11484,7 @@ test_null_burst_operation(void) >=20 > /* Create Crypto session*/ > rte_cryptodev_sym_session_init(ts_params->valid_devs[0], > - ut_params->sess, &ut_params->cipher_xform, > - ts_params->session_priv_mpool); > + ut_params->sess, &ut_params->cipher_xform); > TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation > failed"); >=20 > TEST_ASSERT_EQUAL(rte_crypto_op_bulk_alloc(ts_params- > >op_mpool, > @@ -11634,7 +11596,6 @@ test_enq_callback_setup(void) >=20 > qp_conf.nb_descriptors =3D MAX_NUM_OPS_INFLIGHT; > qp_conf.mp_session =3D ts_params->session_mpool; > - qp_conf.mp_session_private =3D ts_params->session_priv_mpool; >=20 > TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup( > ts_params->valid_devs[0], qp_id, &qp_conf, > @@ -11734,7 +11695,6 @@ test_deq_callback_setup(void) >=20 > qp_conf.nb_descriptors =3D MAX_NUM_OPS_INFLIGHT; > qp_conf.mp_session =3D ts_params->session_mpool; > - qp_conf.mp_session_private =3D ts_params->session_priv_mpool; >=20 > TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup( > ts_params->valid_devs[0], qp_id, &qp_conf, > @@ -11943,8 +11903,7 @@ static int create_gmac_session(uint8_t dev_id, > ts_params->session_mpool); >=20 > rte_cryptodev_sym_session_init(dev_id, ut_params->sess, > - &ut_params->auth_xform, > - ts_params->session_priv_mpool); > + &ut_params->auth_xform); >=20 > TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation > failed"); >=20 > @@ -12588,8 +12547,7 @@ create_auth_session(struct > crypto_unittest_params *ut_params, > ts_params->session_mpool); >=20 > rte_cryptodev_sym_session_init(dev_id, ut_params->sess, > - &ut_params->auth_xform, > - ts_params->session_priv_mpool); > + &ut_params->auth_xform); >=20 > TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation > failed"); >=20 > @@ -12641,8 +12599,7 @@ create_auth_cipher_session(struct > crypto_unittest_params *ut_params, > ts_params->session_mpool); >=20 > rte_cryptodev_sym_session_init(dev_id, ut_params->sess, > - &ut_params->auth_xform, > - ts_params->session_priv_mpool); > + &ut_params->auth_xform); >=20 > TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation > failed"); >=20 > @@ -13149,8 +13106,7 @@ test_authenticated_encrypt_with_esn( >=20 > rte_cryptodev_sym_session_init(ts_params->valid_devs[0], > ut_params->sess, > - &ut_params->cipher_xform, > - ts_params->session_priv_mpool); > + &ut_params->cipher_xform); >=20 > TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation > failed"); >=20 > @@ -13281,8 +13237,7 @@ test_authenticated_decrypt_with_esn( >=20 > rte_cryptodev_sym_session_init(ts_params->valid_devs[0], > ut_params->sess, > - &ut_params->auth_xform, > - ts_params->session_priv_mpool); > + &ut_params->auth_xform); >=20 > TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation > failed"); >=20 > @@ -14003,11 +13958,6 @@ test_scheduler_attach_worker_op(void) > rte_mempool_free(ts_params->session_mpool); > ts_params->session_mpool =3D NULL; > } > - if (ts_params->session_priv_mpool) { > - rte_mempool_free(ts_params- > >session_priv_mpool); > - ts_params->session_priv_mpool =3D NULL; > - } > - > if (info.sym.max_nb_sessions !=3D 0 && > info.sym.max_nb_sessions < > MAX_NB_SESSIONS) { > RTE_LOG(ERR, USER1, > @@ -14024,32 +13974,14 @@ test_scheduler_attach_worker_op(void) > ts_params->session_mpool =3D > rte_cryptodev_sym_session_pool_create( > "test_sess_mp", > - MAX_NB_SESSIONS, 0, 0, 0, > + MAX_NB_SESSIONS, > + session_size, 0, 0, > SOCKET_ID_ANY); > TEST_ASSERT_NOT_NULL(ts_params- > >session_mpool, > "session mempool allocation failed"); > } >=20 > - /* > - * Create mempool with maximum number of sessions, > - * to include device specific session private data > - */ > - if (ts_params->session_priv_mpool =3D=3D NULL) { > - ts_params->session_priv_mpool =3D > rte_mempool_create( > - "test_sess_mp_priv", > - MAX_NB_SESSIONS, > - session_size, > - 0, 0, NULL, NULL, NULL, > - NULL, SOCKET_ID_ANY, > - 0); > - > - TEST_ASSERT_NOT_NULL(ts_params- > >session_priv_mpool, > - "session mempool allocation failed"); > - } > - > ts_params->qp_conf.mp_session =3D ts_params- > >session_mpool; > - ts_params->qp_conf.mp_session_private =3D > - ts_params->session_priv_mpool; >=20 > ret =3D rte_cryptodev_scheduler_worker_attach(sched_id, > (uint8_t)i); > diff --git a/app/test/test_cryptodev.h b/app/test/test_cryptodev.h > index 1cdd84d01f..a3a10d484b 100644 > --- a/app/test/test_cryptodev.h > +++ b/app/test/test_cryptodev.h > @@ -89,7 +89,6 @@ struct crypto_testsuite_params { > struct rte_mempool *large_mbuf_pool; > struct rte_mempool *op_mpool; > struct rte_mempool *session_mpool; > - struct rte_mempool *session_priv_mpool; > struct rte_cryptodev_config conf; > struct rte_cryptodev_qp_conf qp_conf; >=20 > diff --git a/app/test/test_cryptodev_asym.c > b/app/test/test_cryptodev_asym.c > index 9d19a6d6d9..35da574da8 100644 > --- a/app/test/test_cryptodev_asym.c > +++ b/app/test/test_cryptodev_asym.c > @@ -924,7 +924,6 @@ testsuite_setup(void) > /* configure qp */ > ts_params->qp_conf.nb_descriptors =3D > DEFAULT_NUM_OPS_INFLIGHT; > ts_params->qp_conf.mp_session =3D ts_params->session_mpool; > - ts_params->qp_conf.mp_session_private =3D ts_params- > >session_mpool; > for (qp_id =3D 0; qp_id < info.max_nb_queue_pairs; qp_id++) { > TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup( > dev_id, qp_id, &ts_params->qp_conf, > diff --git a/app/test/test_cryptodev_blockcipher.c > b/app/test/test_cryptodev_blockcipher.c > index 3cdb2c96e8..9417803f18 100644 > --- a/app/test/test_cryptodev_blockcipher.c > +++ b/app/test/test_cryptodev_blockcipher.c > @@ -68,7 +68,6 @@ test_blockcipher_one_case(const struct > blockcipher_test_case *t, > struct rte_mempool *mbuf_pool, > struct rte_mempool *op_mpool, > struct rte_mempool *sess_mpool, > - struct rte_mempool *sess_priv_mpool, > uint8_t dev_id, > char *test_msg) > { > @@ -81,7 +80,7 @@ test_blockcipher_one_case(const struct > blockcipher_test_case *t, > struct rte_crypto_sym_op *sym_op =3D NULL; > struct rte_crypto_op *op =3D NULL; > struct rte_cryptodev_info dev_info; > - struct rte_cryptodev_sym_session *sess =3D NULL; > + void *sess =3D NULL; >=20 > int status =3D TEST_SUCCESS; > const struct blockcipher_test_data *tdata =3D t->test_data; > @@ -514,7 +513,7 @@ test_blockcipher_one_case(const struct > blockcipher_test_case *t, > sess =3D rte_cryptodev_sym_session_create(sess_mpool); >=20 > status =3D rte_cryptodev_sym_session_init(dev_id, sess, > - init_xform, sess_priv_mpool); > + init_xform); > if (status =3D=3D -ENOTSUP) { > snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, > "UNSUPPORTED"); > status =3D TEST_SKIPPED; > @@ -831,7 +830,6 @@ blockcipher_test_case_run(const void *data) > p_testsuite_params->mbuf_pool, > p_testsuite_params->op_mpool, > p_testsuite_params->session_mpool, > - p_testsuite_params->session_priv_mpool, > p_testsuite_params->valid_devs[0], > test_msg); > return status; > diff --git a/app/test/test_event_crypto_adapter.c > b/app/test/test_event_crypto_adapter.c > index 3ad20921e2..59229a1cde 100644 > --- a/app/test/test_event_crypto_adapter.c > +++ b/app/test/test_event_crypto_adapter.c > @@ -61,7 +61,6 @@ struct event_crypto_adapter_test_params { > struct rte_mempool *mbuf_pool; > struct rte_mempool *op_mpool; > struct rte_mempool *session_mpool; > - struct rte_mempool *session_priv_mpool; > struct rte_cryptodev_config *config; > uint8_t crypto_event_port_id; > uint8_t internal_port_op_fwd; > @@ -167,7 +166,7 @@ static int > test_op_forward_mode(uint8_t session_less) > { > struct rte_crypto_sym_xform cipher_xform; > - struct rte_cryptodev_sym_session *sess; > + void *sess; > union rte_event_crypto_metadata m_data; > struct rte_crypto_sym_op *sym_op; > struct rte_crypto_op *op; > @@ -203,7 +202,7 @@ test_op_forward_mode(uint8_t session_less) >=20 > /* Create Crypto session*/ > ret =3D rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess, > - &cipher_xform, params.session_priv_mpool); > + &cipher_xform); > TEST_ASSERT_SUCCESS(ret, "Failed to init session\n"); >=20 > ret =3D rte_event_crypto_adapter_caps_get(evdev, > TEST_CDEV_ID, > @@ -367,7 +366,7 @@ static int > test_op_new_mode(uint8_t session_less) > { > struct rte_crypto_sym_xform cipher_xform; > - struct rte_cryptodev_sym_session *sess; > + void *sess; > union rte_event_crypto_metadata m_data; > struct rte_crypto_sym_op *sym_op; > struct rte_crypto_op *op; > @@ -411,7 +410,7 @@ test_op_new_mode(uint8_t session_less) > &m_data, sizeof(m_data)); > } > ret =3D rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess, > - &cipher_xform, params.session_priv_mpool); > + &cipher_xform); > TEST_ASSERT_SUCCESS(ret, "Failed to init session\n"); >=20 > rte_crypto_op_attach_sym_session(op, sess); > @@ -553,22 +552,12 @@ configure_cryptodev(void) >=20 > params.session_mpool =3D rte_cryptodev_sym_session_pool_create( > "CRYPTO_ADAPTER_SESSION_MP", > - MAX_NB_SESSIONS, 0, 0, > + MAX_NB_SESSIONS, session_size, 0, > sizeof(union rte_event_crypto_metadata), > SOCKET_ID_ANY); > TEST_ASSERT_NOT_NULL(params.session_mpool, > "session mempool allocation failed\n"); >=20 > - params.session_priv_mpool =3D rte_mempool_create( > - "CRYPTO_AD_SESS_MP_PRIV", > - MAX_NB_SESSIONS, > - session_size, > - 0, 0, NULL, NULL, NULL, > - NULL, SOCKET_ID_ANY, > - 0); > - TEST_ASSERT_NOT_NULL(params.session_priv_mpool, > - "session mempool allocation failed\n"); > - > rte_cryptodev_info_get(TEST_CDEV_ID, &info); > conf.nb_queue_pairs =3D info.max_nb_queue_pairs; > conf.socket_id =3D SOCKET_ID_ANY; > @@ -580,7 +569,6 @@ configure_cryptodev(void) >=20 > qp_conf.nb_descriptors =3D DEFAULT_NUM_OPS_INFLIGHT; > qp_conf.mp_session =3D params.session_mpool; > - qp_conf.mp_session_private =3D params.session_priv_mpool; >=20 > TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup( > TEST_CDEV_ID, TEST_CDEV_QP_ID, &qp_conf, > @@ -934,12 +922,6 @@ crypto_teardown(void) > rte_mempool_free(params.session_mpool); > params.session_mpool =3D NULL; > } > - if (params.session_priv_mpool !=3D NULL) { > - rte_mempool_avail_count(params.session_priv_mpool); > - rte_mempool_free(params.session_priv_mpool); > - params.session_priv_mpool =3D NULL; > - } > - > /* Free ops mempool */ > if (params.op_mpool !=3D NULL) { > RTE_LOG(DEBUG, USER1, "EVENT_CRYPTO_SYM_OP_POOL > count %u\n", > diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c > index 2ffa2a8e79..134545efe1 100644 > --- a/app/test/test_ipsec.c > +++ b/app/test/test_ipsec.c > @@ -355,20 +355,9 @@ testsuite_setup(void) > return TEST_FAILED; > } >=20 > - ts_params->qp_conf.mp_session_private =3D rte_mempool_create( > - "test_priv_sess_mp", > - MAX_NB_SESSIONS, > - sess_sz, > - 0, 0, NULL, NULL, NULL, > - NULL, SOCKET_ID_ANY, > - 0); > - > - TEST_ASSERT_NOT_NULL(ts_params->qp_conf.mp_session_private, > - "private session mempool allocation failed"); > - > ts_params->qp_conf.mp_session =3D > rte_cryptodev_sym_session_pool_create("test_sess_mp", > - MAX_NB_SESSIONS, 0, 0, 0, SOCKET_ID_ANY); > + MAX_NB_SESSIONS, sess_sz, 0, 0, SOCKET_ID_ANY); >=20 > TEST_ASSERT_NOT_NULL(ts_params->qp_conf.mp_session, > "session mempool allocation failed"); > @@ -413,11 +402,6 @@ testsuite_teardown(void) > rte_mempool_free(ts_params->qp_conf.mp_session); > ts_params->qp_conf.mp_session =3D NULL; > } > - > - if (ts_params->qp_conf.mp_session_private !=3D NULL) { > - rte_mempool_free(ts_params- > >qp_conf.mp_session_private); > - ts_params->qp_conf.mp_session_private =3D NULL; > - } > } >=20 > static int > @@ -644,7 +628,7 @@ create_crypto_session(struct ipsec_unitest_params > *ut, > struct rte_cryptodev_qp_conf *qp, uint8_t dev_id, uint32_t j) > { > int32_t rc; > - struct rte_cryptodev_sym_session *s; > + void *s; >=20 > s =3D rte_cryptodev_sym_session_create(qp->mp_session); > if (s =3D=3D NULL) > @@ -652,7 +636,7 @@ create_crypto_session(struct ipsec_unitest_params > *ut, >=20 > /* initiliaze SA crypto session for device */ > rc =3D rte_cryptodev_sym_session_init(dev_id, s, > - ut->crypto_xforms, qp->mp_session_private); > + ut->crypto_xforms); > if (rc =3D=3D 0) { > ut->ss[j].crypto.ses =3D s; > return 0; > diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c > b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c > index edb7275e76..75330292af 100644 > --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c > +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c > @@ -235,7 +235,6 @@ aesni_gcm_pmd_qp_setup(struct rte_cryptodev > *dev, uint16_t qp_id, > goto qp_setup_cleanup; >=20 > qp->sess_mp =3D qp_conf->mp_session; > - qp->sess_mp_priv =3D qp_conf->mp_session_private; >=20 > memset(&qp->qp_stats, 0, sizeof(qp->qp_stats)); >=20 > @@ -259,10 +258,8 @@ aesni_gcm_pmd_sym_session_get_size(struct > rte_cryptodev *dev __rte_unused) > static int > aesni_gcm_pmd_sym_session_configure(struct rte_cryptodev *dev > __rte_unused, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + void *sess) > { > - void *sess_private_data; > int ret; > struct aesni_gcm_private *internals =3D dev->data->dev_private; >=20 > @@ -271,42 +268,24 @@ aesni_gcm_pmd_sym_session_configure(struct > rte_cryptodev *dev __rte_unused, > return -EINVAL; > } >=20 > - if (rte_mempool_get(mempool, &sess_private_data)) { > - AESNI_GCM_LOG(ERR, > - "Couldn't get object from session mempool"); > - return -ENOMEM; > - } > ret =3D aesni_gcm_set_session_parameters(internals->ops, > - sess_private_data, xform); > + sess, xform); > if (ret !=3D 0) { > AESNI_GCM_LOG(ERR, "failed configure session > parameters"); > - > - /* Return session to mempool */ > - rte_mempool_put(mempool, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > - sess_private_data); > - > return 0; > } >=20 > /** Clear the memory of session so it doesn't leave key material behind = */ > static void > -aesni_gcm_pmd_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +aesni_gcm_pmd_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - > + RTE_SET_USED(dev); > /* Zero out the whole structure */ > - if (sess_priv) { > - memset(sess_priv, 0, sizeof(struct aesni_gcm_session)); > - struct rte_mempool *sess_mp =3D > rte_mempool_from_obj(sess_priv); > - set_sym_session_private_data(sess, index, NULL); > - rte_mempool_put(sess_mp, sess_priv); > - } > + if (sess) > + memset(sess, 0, sizeof(struct aesni_gcm_session)); > } >=20 > struct rte_cryptodev_ops aesni_gcm_pmd_ops =3D { > diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c > b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c > index 39c67e3952..efdc05c45f 100644 > --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c > +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c > @@ -944,7 +944,6 @@ aesni_mb_pmd_qp_setup(struct rte_cryptodev *dev, > uint16_t qp_id, > } >=20 > qp->sess_mp =3D qp_conf->mp_session; > - qp->sess_mp_priv =3D qp_conf->mp_session_private; >=20 > memset(&qp->stats, 0, sizeof(qp->stats)); >=20 > @@ -974,11 +973,8 @@ aesni_mb_pmd_sym_session_get_size(struct > rte_cryptodev *dev __rte_unused) > /** Configure a aesni multi-buffer session from a crypto xform chain */ > static int > aesni_mb_pmd_sym_session_configure(struct rte_cryptodev *dev, > - struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + struct rte_crypto_sym_xform *xform, void *sess) > { > - void *sess_private_data; > struct aesni_mb_private *internals =3D dev->data->dev_private; > int ret; >=20 > @@ -987,43 +983,25 @@ aesni_mb_pmd_sym_session_configure(struct > rte_cryptodev *dev, > return -EINVAL; > } >=20 > - if (rte_mempool_get(mempool, &sess_private_data)) { > - AESNI_MB_LOG(ERR, > - "Couldn't get object from session mempool"); > - return -ENOMEM; > - } > - > ret =3D aesni_mb_set_session_parameters(internals->mb_mgr, > - sess_private_data, xform); > + sess, xform); > if (ret !=3D 0) { > AESNI_MB_LOG(ERR, "failed configure session parameters"); > - > - /* Return session to mempool */ > - rte_mempool_put(mempool, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > - sess_private_data); > - > return 0; > } >=20 > /** Clear the memory of session so it doesn't leave key material behind = */ > static void > -aesni_mb_pmd_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +aesni_mb_pmd_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > + RTE_SET_USED(dev); >=20 > /* Zero out the whole structure */ > - if (sess_priv) { > - memset(sess_priv, 0, sizeof(struct aesni_mb_session)); > - struct rte_mempool *sess_mp =3D > rte_mempool_from_obj(sess_priv); > - set_sym_session_private_data(sess, index, NULL); > - rte_mempool_put(sess_mp, sess_priv); > - } > + if (sess) > + memset(sess, 0, sizeof(struct aesni_mb_session)); > } >=20 > struct rte_cryptodev_ops aesni_mb_pmd_ops =3D { > diff --git a/drivers/crypto/armv8/rte_armv8_pmd_ops.c > b/drivers/crypto/armv8/rte_armv8_pmd_ops.c > index 1b2749fe62..2d3b54b063 100644 > --- a/drivers/crypto/armv8/rte_armv8_pmd_ops.c > +++ b/drivers/crypto/armv8/rte_armv8_pmd_ops.c > @@ -244,7 +244,6 @@ armv8_crypto_pmd_qp_setup(struct rte_cryptodev > *dev, uint16_t qp_id, > goto qp_setup_cleanup; >=20 > qp->sess_mp =3D qp_conf->mp_session; > - qp->sess_mp_priv =3D qp_conf->mp_session_private; >=20 > memset(&qp->stats, 0, sizeof(qp->stats)); >=20 > @@ -268,10 +267,8 @@ armv8_crypto_pmd_sym_session_get_size(struct > rte_cryptodev *dev __rte_unused) > static int > armv8_crypto_pmd_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + void *sess) > { > - void *sess_private_data; > int ret; >=20 > if (unlikely(sess =3D=3D NULL)) { > @@ -279,42 +276,23 @@ armv8_crypto_pmd_sym_session_configure(struct > rte_cryptodev *dev, > return -EINVAL; > } >=20 > - if (rte_mempool_get(mempool, &sess_private_data)) { > - CDEV_LOG_ERR( > - "Couldn't get object from session mempool"); > - return -ENOMEM; > - } > - > - ret =3D armv8_crypto_set_session_parameters(sess_private_data, > xform); > + ret =3D armv8_crypto_set_session_parameters(sess, xform); > if (ret !=3D 0) { > ARMV8_CRYPTO_LOG_ERR("failed configure session > parameters"); > - > - /* Return session to mempool */ > - rte_mempool_put(mempool, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > - sess_private_data); > - > return 0; > } >=20 > /** Clear the memory of session so it doesn't leave key material behind = */ > static void > -armv8_crypto_pmd_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +armv8_crypto_pmd_sym_session_clear(struct rte_cryptodev *dev, void > *sess) > { > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - > + RTE_SET_USED(dev); > /* Zero out the whole structure */ > - if (sess_priv) { > - memset(sess_priv, 0, sizeof(struct armv8_crypto_session)); > - struct rte_mempool *sess_mp =3D > rte_mempool_from_obj(sess_priv); > - set_sym_session_private_data(sess, index, NULL); > - rte_mempool_put(sess_mp, sess_priv); > - } > + if (sess) > + memset(sess, 0, sizeof(struct armv8_crypto_session)); > } >=20 > struct rte_cryptodev_ops armv8_crypto_pmd_ops =3D { > diff --git a/drivers/crypto/bcmfs/bcmfs_sym_session.c > b/drivers/crypto/bcmfs/bcmfs_sym_session.c > index 675ed0ad55..b4b167d0c2 100644 > --- a/drivers/crypto/bcmfs/bcmfs_sym_session.c > +++ b/drivers/crypto/bcmfs/bcmfs_sym_session.c > @@ -224,10 +224,9 @@ bcmfs_sym_get_session(struct rte_crypto_op *op) > int > bcmfs_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + void *sess) > { > - void *sess_private_data; > + RTE_SET_USED(dev); > int ret; >=20 > if (unlikely(sess =3D=3D NULL)) { > @@ -235,44 +234,23 @@ bcmfs_sym_session_configure(struct > rte_cryptodev *dev, > return -EINVAL; > } >=20 > - if (rte_mempool_get(mempool, &sess_private_data)) { > - BCMFS_DP_LOG(ERR, > - "Couldn't get object from session mempool"); > - return -ENOMEM; > - } > - > - ret =3D crypto_set_session_parameters(sess_private_data, xform); > + ret =3D crypto_set_session_parameters(sess, xform); >=20 > if (ret !=3D 0) { > BCMFS_DP_LOG(ERR, "Failed configure session parameters"); > - /* Return session to mempool */ > - rte_mempool_put(mempool, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > - sess_private_data); > - > return 0; > } >=20 > /* Clear the memory of session so it doesn't leave key material behind *= / > void > -bcmfs_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +bcmfs_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - > - if (sess_priv) { > - struct rte_mempool *sess_mp; > - > - memset(sess_priv, 0, sizeof(struct bcmfs_sym_session)); > - sess_mp =3D rte_mempool_from_obj(sess_priv); > - > - set_sym_session_private_data(sess, index, NULL); > - rte_mempool_put(sess_mp, sess_priv); > - } > + RTE_SET_USED(dev); > + if (sess) > + memset(sess, 0, sizeof(struct bcmfs_sym_session)); > } >=20 > unsigned int > diff --git a/drivers/crypto/bcmfs/bcmfs_sym_session.h > b/drivers/crypto/bcmfs/bcmfs_sym_session.h > index d40595b4bd..7faafe2fd5 100644 > --- a/drivers/crypto/bcmfs/bcmfs_sym_session.h > +++ b/drivers/crypto/bcmfs/bcmfs_sym_session.h > @@ -93,12 +93,10 @@ bcmfs_process_crypto_op(struct rte_crypto_op *op, > int > bcmfs_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool); > + void *sess); >=20 > void > -bcmfs_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess); > +bcmfs_sym_session_clear(struct rte_cryptodev *dev, void *sess); >=20 > unsigned int > bcmfs_sym_session_get_private_size(struct rte_cryptodev *dev > __rte_unused); > diff --git a/drivers/crypto/caam_jr/caam_jr.c > b/drivers/crypto/caam_jr/caam_jr.c > index ce7a100778..8a04820fa6 100644 > --- a/drivers/crypto/caam_jr/caam_jr.c > +++ b/drivers/crypto/caam_jr/caam_jr.c > @@ -1692,52 +1692,36 @@ caam_jr_set_session_parameters(struct > rte_cryptodev *dev, > static int > caam_jr_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + void *sess) > { > - void *sess_private_data; > int ret; >=20 > PMD_INIT_FUNC_TRACE(); >=20 > - if (rte_mempool_get(mempool, &sess_private_data)) { > - CAAM_JR_ERR("Couldn't get object from session mempool"); > - return -ENOMEM; > - } > - > - memset(sess_private_data, 0, sizeof(struct caam_jr_session)); > - ret =3D caam_jr_set_session_parameters(dev, xform, > sess_private_data); > + memset(sess, 0, sizeof(struct caam_jr_session)); > + ret =3D caam_jr_set_session_parameters(dev, xform, sess); > if (ret !=3D 0) { > CAAM_JR_ERR("failed to configure session parameters"); > - /* Return session to mempool */ > - rte_mempool_put(mempool, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > sess_private_data); > - > return 0; > } >=20 > /* Clear the memory of session so it doesn't leave key material behind *= / > static void > -caam_jr_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +caam_jr_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - struct caam_jr_session *s =3D (struct caam_jr_session *)sess_priv; > + RTE_SET_USED(dev); > + > + struct caam_jr_session *s =3D (struct caam_jr_session *)sess; >=20 > PMD_INIT_FUNC_TRACE(); >=20 > - if (sess_priv) { > - struct rte_mempool *sess_mp =3D > rte_mempool_from_obj(sess_priv); > - > + if (sess) { > rte_free(s->cipher_key.data); > rte_free(s->auth_key.data); > memset(s, 0, sizeof(struct caam_jr_session)); > - set_sym_session_private_data(sess, index, NULL); > - rte_mempool_put(sess_mp, sess_priv); > } > } >=20 > diff --git a/drivers/crypto/ccp/ccp_pmd_ops.c > b/drivers/crypto/ccp/ccp_pmd_ops.c > index 0d615d311c..cac1268130 100644 > --- a/drivers/crypto/ccp/ccp_pmd_ops.c > +++ b/drivers/crypto/ccp/ccp_pmd_ops.c > @@ -727,7 +727,6 @@ ccp_pmd_qp_setup(struct rte_cryptodev *dev, > uint16_t qp_id, > } >=20 > qp->sess_mp =3D qp_conf->mp_session; > - qp->sess_mp_priv =3D qp_conf->mp_session_private; >=20 > /* mempool for batch info */ > qp->batch_mp =3D rte_mempool_create( > @@ -758,11 +757,9 @@ ccp_pmd_sym_session_get_size(struct > rte_cryptodev *dev __rte_unused) > static int > ccp_pmd_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + void *sess) > { > int ret; > - void *sess_private_data; > struct ccp_private *internals; >=20 > if (unlikely(sess =3D=3D NULL || xform =3D=3D NULL)) { > @@ -770,39 +767,22 @@ ccp_pmd_sym_session_configure(struct > rte_cryptodev *dev, > return -ENOMEM; > } >=20 > - if (rte_mempool_get(mempool, &sess_private_data)) { > - CCP_LOG_ERR("Couldn't get object from session mempool"); > - return -ENOMEM; > - } > internals =3D (struct ccp_private *)dev->data->dev_private; > - ret =3D ccp_set_session_parameters(sess_private_data, xform, > internals); > + ret =3D ccp_set_session_parameters(sess, xform, internals); > if (ret !=3D 0) { > CCP_LOG_ERR("failed configure session parameters"); > - > - /* Return session to mempool */ > - rte_mempool_put(mempool, sess_private_data); > return ret; > } > - set_sym_session_private_data(sess, dev->driver_id, > - sess_private_data); >=20 > return 0; > } >=20 > static void > -ccp_pmd_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +ccp_pmd_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - > - if (sess_priv) { > - struct rte_mempool *sess_mp =3D > rte_mempool_from_obj(sess_priv); > - > - rte_mempool_put(sess_mp, sess_priv); > - memset(sess_priv, 0, sizeof(struct ccp_session)); > - set_sym_session_private_data(sess, index, NULL); > - } > + RTE_SET_USED(dev); > + if (sess) > + memset(sess, 0, sizeof(struct ccp_session)); > } >=20 > struct rte_cryptodev_ops ccp_ops =3D { > diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c > b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c > index 99968cc353..50cae5e3d6 100644 > --- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c > +++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c > @@ -32,17 +32,18 @@ cn10k_cpt_sym_temp_sess_create(struct > cnxk_cpt_qp *qp, struct rte_crypto_op *op) > if (sess =3D=3D NULL) > return NULL; >=20 > - ret =3D sym_session_configure(qp->lf.roc_cpt, driver_id, sym_op- > >xform, > - sess, qp->sess_mp_priv); > + sess->sess_data[driver_id].data =3D > + (void *)((uint8_t *)sess + > + rte_cryptodev_sym_get_header_session_size() + > + (driver_id * sess->priv_sz)); > + priv =3D get_sym_session_private_data(sess, driver_id); > + ret =3D sym_session_configure(qp->lf.roc_cpt, sym_op->xform, (void > *)priv); > if (ret) > goto sess_put; >=20 > - priv =3D get_sym_session_private_data(sess, driver_id); > - > sym_op->session =3D sess; >=20 > return priv; > - > sess_put: > rte_mempool_put(qp->sess_mp, sess); > return NULL; > @@ -144,9 +145,7 @@ cn10k_cpt_fill_inst(struct cnxk_cpt_qp *qp, struct > rte_crypto_op *ops[], > ret =3D cpt_sym_inst_fill(qp, op, sess, infl_req, > &inst[0]); > if (unlikely(ret)) { > - > sym_session_clear(cn10k_cryptodev_driver_id, > - op->sym->session); > - rte_mempool_put(qp->sess_mp, op->sym- > >session); > + sym_session_clear(op->sym->session); > return 0; > } > w7 =3D sess->cpt_inst_w7; > @@ -437,8 +436,7 @@ cn10k_cpt_dequeue_post_process(struct > cnxk_cpt_qp *qp, > temp_sess_free: > if (unlikely(cop->sess_type =3D=3D RTE_CRYPTO_OP_SESSIONLESS)) { > if (cop->type =3D=3D RTE_CRYPTO_OP_TYPE_SYMMETRIC) { > - sym_session_clear(cn10k_cryptodev_driver_id, > - cop->sym->session); > + sym_session_clear(cop->sym->session); > sz =3D > rte_cryptodev_sym_get_existing_header_session_size( > cop->sym->session); > memset(cop->sym->session, 0, sz); > diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c > b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c > index 4c2dc5b080..5f83581131 100644 > --- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c > +++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c > @@ -81,17 +81,19 @@ cn9k_cpt_sym_temp_sess_create(struct > cnxk_cpt_qp *qp, struct rte_crypto_op *op) > if (sess =3D=3D NULL) > return NULL; >=20 > - ret =3D sym_session_configure(qp->lf.roc_cpt, driver_id, sym_op- > >xform, > - sess, qp->sess_mp_priv); > + sess->sess_data[driver_id].data =3D > + (void *)((uint8_t *)sess + > + rte_cryptodev_sym_get_header_session_size() + > + (driver_id * sess->priv_sz)); > + priv =3D get_sym_session_private_data(sess, driver_id); > + ret =3D sym_session_configure(qp->lf.roc_cpt, sym_op->xform, > + (void *)priv); > if (ret) > goto sess_put; >=20 > - priv =3D get_sym_session_private_data(sess, driver_id); > - > sym_op->session =3D sess; >=20 > return priv; > - > sess_put: > rte_mempool_put(qp->sess_mp, sess); > return NULL; > @@ -126,8 +128,7 @@ cn9k_cpt_inst_prep(struct cnxk_cpt_qp *qp, struct > rte_crypto_op *op, > ret =3D cn9k_cpt_sym_inst_fill(qp, op, sess, infl_req, > inst); > if (unlikely(ret)) { > - > sym_session_clear(cn9k_cryptodev_driver_id, > - op->sym->session); > + sym_session_clear(op->sym->session); > rte_mempool_put(qp->sess_mp, op->sym- > >session); > } > inst->w7.u64 =3D sess->cpt_inst_w7; > @@ -484,8 +485,7 @@ cn9k_cpt_dequeue_post_process(struct > cnxk_cpt_qp *qp, struct rte_crypto_op *cop, > temp_sess_free: > if (unlikely(cop->sess_type =3D=3D RTE_CRYPTO_OP_SESSIONLESS)) { > if (cop->type =3D=3D RTE_CRYPTO_OP_TYPE_SYMMETRIC) { > - sym_session_clear(cn9k_cryptodev_driver_id, > - cop->sym->session); > + sym_session_clear(cop->sym->session); > sz =3D > rte_cryptodev_sym_get_existing_header_session_size( > cop->sym->session); > memset(cop->sym->session, 0, sz); > diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c > b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c > index 41d8fe49e1..52d9cf0cf3 100644 > --- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c > +++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c > @@ -379,7 +379,6 @@ cnxk_cpt_queue_pair_setup(struct rte_cryptodev > *dev, uint16_t qp_id, > } >=20 > qp->sess_mp =3D conf->mp_session; > - qp->sess_mp_priv =3D conf->mp_session_private; > dev->data->queue_pairs[qp_id] =3D qp; >=20 > return 0; > @@ -493,27 +492,20 @@ cnxk_cpt_inst_w7_get(struct cnxk_se_sess *sess, > struct roc_cpt *roc_cpt) > } >=20 > int > -sym_session_configure(struct roc_cpt *roc_cpt, int driver_id, > +sym_session_configure(struct roc_cpt *roc_cpt, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *pool) > + void *sess) > { > struct cnxk_se_sess *sess_priv; > - void *priv; > int ret; >=20 > ret =3D sym_xform_verify(xform); > if (unlikely(ret < 0)) > return ret; >=20 > - if (unlikely(rte_mempool_get(pool, &priv))) { > - plt_dp_err("Could not allocate session private data"); > - return -ENOMEM; > - } > + memset(sess, 0, sizeof(struct cnxk_se_sess)); >=20 > - memset(priv, 0, sizeof(struct cnxk_se_sess)); > - > - sess_priv =3D priv; > + sess_priv =3D sess; >=20 > switch (ret) { > case CNXK_CPT_CIPHER: > @@ -547,7 +539,7 @@ sym_session_configure(struct roc_cpt *roc_cpt, int > driver_id, > } >=20 > if (ret) > - goto priv_put; > + return -ENOTSUP; >=20 > if ((sess_priv->roc_se_ctx.fc_type =3D=3D ROC_SE_HASH_HMAC) && > cpt_mac_len_verify(&xform->auth)) { > @@ -557,66 +549,45 @@ sym_session_configure(struct roc_cpt *roc_cpt, int > driver_id, > sess_priv->roc_se_ctx.auth_key =3D NULL; > } >=20 > - ret =3D -ENOTSUP; > - goto priv_put; > + return -ENOTSUP; > } >=20 > sess_priv->cpt_inst_w7 =3D cnxk_cpt_inst_w7_get(sess_priv, roc_cpt); >=20 > - set_sym_session_private_data(sess, driver_id, sess_priv); > - > return 0; > - > -priv_put: > - rte_mempool_put(pool, priv); > - > - return -ENOTSUP; > } >=20 > int > cnxk_cpt_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *pool) > + void *sess) > { > struct cnxk_cpt_vf *vf =3D dev->data->dev_private; > struct roc_cpt *roc_cpt =3D &vf->cpt; > - uint8_t driver_id; >=20 > - driver_id =3D dev->driver_id; > - > - return sym_session_configure(roc_cpt, driver_id, xform, sess, pool); > + return sym_session_configure(roc_cpt, xform, sess); > } >=20 > void > -sym_session_clear(int driver_id, struct rte_cryptodev_sym_session *sess) > +sym_session_clear(void *sess) > { > - void *priv =3D get_sym_session_private_data(sess, driver_id); > - struct cnxk_se_sess *sess_priv; > - struct rte_mempool *pool; > + struct cnxk_se_sess *sess_priv =3D sess; >=20 > - if (priv =3D=3D NULL) > + if (sess =3D=3D NULL) > return; >=20 > - sess_priv =3D priv; > - > if (sess_priv->roc_se_ctx.auth_key !=3D NULL) > plt_free(sess_priv->roc_se_ctx.auth_key); >=20 > - memset(priv, 0, cnxk_cpt_sym_session_get_size(NULL)); > - > - pool =3D rte_mempool_from_obj(priv); > - > - set_sym_session_private_data(sess, driver_id, NULL); > - > - rte_mempool_put(pool, priv); > + memset(sess_priv, 0, cnxk_cpt_sym_session_get_size(NULL)); > } >=20 > void > -cnxk_cpt_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +cnxk_cpt_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > - return sym_session_clear(dev->driver_id, sess); > + RTE_SET_USED(dev); > + > + return sym_session_clear(sess); > } >=20 > unsigned int > diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h > b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h > index c5332dec53..3c09d10582 100644 > --- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h > +++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h > @@ -111,18 +111,15 @@ unsigned int > cnxk_cpt_sym_session_get_size(struct rte_cryptodev *dev); >=20 > int cnxk_cpt_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *pool); > + void *sess); >=20 > -int sym_session_configure(struct roc_cpt *roc_cpt, int driver_id, > +int sym_session_configure(struct roc_cpt *roc_cpt, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *pool); > + void *sess); >=20 > -void cnxk_cpt_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess); > +void cnxk_cpt_sym_session_clear(struct rte_cryptodev *dev, void *sess); >=20 > -void sym_session_clear(int driver_id, struct rte_cryptodev_sym_session > *sess); > +void sym_session_clear(void *sess); >=20 > unsigned int cnxk_ae_session_size_get(struct rte_cryptodev *dev > __rte_unused); >=20 > diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > index 176f1a27a0..42229763f8 100644 > --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > @@ -3438,49 +3438,32 @@ dpaa2_sec_security_session_destroy(void *dev > __rte_unused, void *sess) > static int > dpaa2_sec_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + void *sess) > { > - void *sess_private_data; > int ret; >=20 > - if (rte_mempool_get(mempool, &sess_private_data)) { > - DPAA2_SEC_ERR("Couldn't get object from session > mempool"); > - return -ENOMEM; > - } > - > - ret =3D dpaa2_sec_set_session_parameters(dev, xform, > sess_private_data); > + ret =3D dpaa2_sec_set_session_parameters(dev, xform, sess); > if (ret !=3D 0) { > DPAA2_SEC_ERR("Failed to configure session parameters"); > - /* Return session to mempool */ > - rte_mempool_put(mempool, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > - sess_private_data); > - > return 0; > } >=20 > /** Clear the memory of session so it doesn't leave key material behind = */ > static void > -dpaa2_sec_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +dpaa2_sec_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > PMD_INIT_FUNC_TRACE(); > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - dpaa2_sec_session *s =3D (dpaa2_sec_session *)sess_priv; > + RTE_SET_USED(dev); > + dpaa2_sec_session *s =3D (dpaa2_sec_session *)sess; >=20 > - if (sess_priv) { > + if (sess) { > rte_free(s->ctxt); > rte_free(s->cipher_key.data); > rte_free(s->auth_key.data); > memset(s, 0, sizeof(dpaa2_sec_session)); > - struct rte_mempool *sess_mp =3D > rte_mempool_from_obj(sess_priv); > - set_sym_session_private_data(sess, index, NULL); > - rte_mempool_put(sess_mp, sess_priv); > } > } >=20 > diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c > b/drivers/crypto/dpaa_sec/dpaa_sec.c > index 5a087df090..4727088b45 100644 > --- a/drivers/crypto/dpaa_sec/dpaa_sec.c > +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c > @@ -2537,33 +2537,18 @@ dpaa_sec_set_session_parameters(struct > rte_cryptodev *dev, >=20 > static int > dpaa_sec_sym_session_configure(struct rte_cryptodev *dev, > - struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + struct rte_crypto_sym_xform *xform, void *sess) > { > - void *sess_private_data; > int ret; >=20 > PMD_INIT_FUNC_TRACE(); >=20 > - if (rte_mempool_get(mempool, &sess_private_data)) { > - DPAA_SEC_ERR("Couldn't get object from session > mempool"); > - return -ENOMEM; > - } > - > - ret =3D dpaa_sec_set_session_parameters(dev, xform, > sess_private_data); > + ret =3D dpaa_sec_set_session_parameters(dev, xform, sess); > if (ret !=3D 0) { > DPAA_SEC_ERR("failed to configure session parameters"); > - > - /* Return session to mempool */ > - rte_mempool_put(mempool, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > - sess_private_data); > - > - > return 0; > } >=20 > @@ -2584,18 +2569,14 @@ free_session_memory(struct rte_cryptodev > *dev, dpaa_sec_session *s) >=20 > /** Clear the memory of session so it doesn't leave key material behind = */ > static void > -dpaa_sec_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +dpaa_sec_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > PMD_INIT_FUNC_TRACE(); > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - dpaa_sec_session *s =3D (dpaa_sec_session *)sess_priv; > + RTE_SET_USED(dev); > + dpaa_sec_session *s =3D (dpaa_sec_session *)sess; >=20 > - if (sess_priv) { > + if (sess) > free_session_memory(dev, s); > - set_sym_session_private_data(sess, index, NULL); > - } > } >=20 > #ifdef RTE_LIB_SECURITY > diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c > b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c > index f075054807..b2e5c92598 100644 > --- a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c > +++ b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c > @@ -220,7 +220,6 @@ kasumi_pmd_qp_setup(struct rte_cryptodev *dev, > uint16_t qp_id, >=20 > qp->mgr =3D internals->mgr; > qp->sess_mp =3D qp_conf->mp_session; > - qp->sess_mp_priv =3D qp_conf->mp_session_private; >=20 > memset(&qp->qp_stats, 0, sizeof(qp->qp_stats)); >=20 > @@ -243,10 +242,8 @@ kasumi_pmd_sym_session_get_size(struct > rte_cryptodev *dev __rte_unused) > static int > kasumi_pmd_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + void *sess) > { > - void *sess_private_data; > int ret; > struct kasumi_private *internals =3D dev->data->dev_private; >=20 > @@ -255,43 +252,24 @@ kasumi_pmd_sym_session_configure(struct > rte_cryptodev *dev, > return -EINVAL; > } >=20 > - if (rte_mempool_get(mempool, &sess_private_data)) { > - KASUMI_LOG(ERR, > - "Couldn't get object from session mempool"); > - return -ENOMEM; > - } > - > ret =3D kasumi_set_session_parameters(internals->mgr, > - sess_private_data, xform); > + sess, xform); > if (ret !=3D 0) { > KASUMI_LOG(ERR, "failed configure session parameters"); > - > - /* Return session to mempool */ > - rte_mempool_put(mempool, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > - sess_private_data); > - > return 0; > } >=20 > /** Clear the memory of session so it doesn't leave key material behind = */ > static void > -kasumi_pmd_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +kasumi_pmd_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - > + RTE_SET_USED(dev); > /* Zero out the whole structure */ > - if (sess_priv) { > - memset(sess_priv, 0, sizeof(struct kasumi_session)); > - struct rte_mempool *sess_mp =3D > rte_mempool_from_obj(sess_priv); > - set_sym_session_private_data(sess, index, NULL); > - rte_mempool_put(sess_mp, sess_priv); > - } > + if (sess) > + memset(sess, 0, sizeof(struct kasumi_session)); > } >=20 > struct rte_cryptodev_ops kasumi_pmd_ops =3D { > diff --git a/drivers/crypto/mlx5/mlx5_crypto.c > b/drivers/crypto/mlx5/mlx5_crypto.c > index 682cf8b607..615ab9f45d 100644 > --- a/drivers/crypto/mlx5/mlx5_crypto.c > +++ b/drivers/crypto/mlx5/mlx5_crypto.c > @@ -165,14 +165,12 @@ mlx5_crypto_sym_session_get_size(struct > rte_cryptodev *dev __rte_unused) > static int > mlx5_crypto_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *session, > - struct rte_mempool *mp) > + void *session) > { > struct mlx5_crypto_priv *priv =3D dev->data->dev_private; > - struct mlx5_crypto_session *sess_private_data; > + struct mlx5_crypto_session *sess_private_data =3D session; > struct rte_crypto_cipher_xform *cipher; > uint8_t encryption_order; > - int ret; >=20 > if (unlikely(xform->next !=3D NULL)) { > DRV_LOG(ERR, "Xform next is not supported."); > @@ -183,17 +181,9 @@ mlx5_crypto_sym_session_configure(struct > rte_cryptodev *dev, > DRV_LOG(ERR, "Only AES-XTS algorithm is supported."); > return -ENOTSUP; > } > - ret =3D rte_mempool_get(mp, (void *)&sess_private_data); > - if (ret !=3D 0) { > - DRV_LOG(ERR, > - "Failed to get session %p private data from > mempool.", > - sess_private_data); > - return -ENOMEM; > - } > cipher =3D &xform->cipher; > sess_private_data->dek =3D mlx5_crypto_dek_prepare(priv, cipher); > if (sess_private_data->dek =3D=3D NULL) { > - rte_mempool_put(mp, sess_private_data); > DRV_LOG(ERR, "Failed to prepare dek."); > return -ENOMEM; > } > @@ -228,27 +218,21 @@ mlx5_crypto_sym_session_configure(struct > rte_cryptodev *dev, > sess_private_data->dek_id =3D > rte_cpu_to_be_32(sess_private_data->dek->obj->id > & > 0xffffff); > - set_sym_session_private_data(session, dev->driver_id, > - sess_private_data); > DRV_LOG(DEBUG, "Session %p was configured.", sess_private_data); > return 0; > } >=20 > static void > -mlx5_crypto_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +mlx5_crypto_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > struct mlx5_crypto_priv *priv =3D dev->data->dev_private; > - struct mlx5_crypto_session *spriv =3D > get_sym_session_private_data(sess, > - dev- > >driver_id); > + struct mlx5_crypto_session *spriv =3D sess; >=20 > if (unlikely(spriv =3D=3D NULL)) { > DRV_LOG(ERR, "Failed to get session %p private data.", spriv); > return; > } > mlx5_crypto_dek_destroy(priv, spriv->dek); > - set_sym_session_private_data(sess, dev->driver_id, NULL); > - rte_mempool_put(rte_mempool_from_obj(spriv), spriv); > DRV_LOG(DEBUG, "Session %p was cleared.", spriv); > } >=20 > diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c > b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c > index e04a2c88c7..2e4b27ea21 100644 > --- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c > +++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c > @@ -704,7 +704,6 @@ mrvl_crypto_pmd_qp_setup(struct rte_cryptodev > *dev, uint16_t qp_id, > break; >=20 > qp->sess_mp =3D qp_conf->mp_session; > - qp->sess_mp_priv =3D qp_conf->mp_session_private; >=20 > memset(&qp->stats, 0, sizeof(qp->stats)); > dev->data->queue_pairs[qp_id] =3D qp; > @@ -735,12 +734,9 @@ > mrvl_crypto_pmd_sym_session_get_size(__rte_unused struct > rte_cryptodev *dev) > */ > static int > mrvl_crypto_pmd_sym_session_configure(__rte_unused struct > rte_cryptodev *dev, > - struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mp) > + struct rte_crypto_sym_xform *xform, void *sess) > { > struct mrvl_crypto_session *mrvl_sess; > - void *sess_private_data; > int ret; >=20 > if (sess =3D=3D NULL) { > @@ -748,25 +744,16 @@ > mrvl_crypto_pmd_sym_session_configure(__rte_unused struct > rte_cryptodev *dev, > return -EINVAL; > } >=20 > - if (rte_mempool_get(mp, &sess_private_data)) { > - CDEV_LOG_ERR("Couldn't get object from session > mempool."); > - return -ENOMEM; > - } > + memset(sess, 0, sizeof(struct mrvl_crypto_session)); >=20 > - memset(sess_private_data, 0, sizeof(struct mrvl_crypto_session)); > - > - ret =3D mrvl_crypto_set_session_parameters(sess_private_data, > xform); > + ret =3D mrvl_crypto_set_session_parameters(sess, xform); > if (ret !=3D 0) { > MRVL_LOG(ERR, "Failed to configure session parameters!"); > - > - /* Return session to mempool */ > - rte_mempool_put(mp, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > sess_private_data); >=20 > - mrvl_sess =3D (struct mrvl_crypto_session *)sess_private_data; > + mrvl_sess =3D (struct mrvl_crypto_session *)sess; > if (sam_session_create(&mrvl_sess->sam_sess_params, > &mrvl_sess->sam_sess) < 0) { > MRVL_LOG(DEBUG, "Failed to create session!"); > @@ -789,17 +776,13 @@ > mrvl_crypto_pmd_sym_session_configure(__rte_unused struct > rte_cryptodev *dev, > * @returns 0. Always. > */ > static void > -mrvl_crypto_pmd_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +mrvl_crypto_pmd_sym_session_clear(struct rte_cryptodev *dev, void > *sess) > { > - > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - > + RTE_SET_USED(dev); > /* Zero out the whole structure */ > - if (sess_priv) { > + if (sess) { > struct mrvl_crypto_session *mrvl_sess =3D > - (struct mrvl_crypto_session *)sess_priv; > + (struct mrvl_crypto_session *)sess; >=20 > if (mrvl_sess->sam_sess && > sam_session_destroy(mrvl_sess->sam_sess) < 0) { > @@ -807,9 +790,6 @@ mrvl_crypto_pmd_sym_session_clear(struct > rte_cryptodev *dev, > } >=20 > memset(mrvl_sess, 0, sizeof(struct mrvl_crypto_session)); > - struct rte_mempool *sess_mp =3D > rte_mempool_from_obj(sess_priv); > - set_sym_session_private_data(sess, index, NULL); > - rte_mempool_put(sess_mp, sess_priv); > } > } >=20 > diff --git a/drivers/crypto/nitrox/nitrox_sym.c > b/drivers/crypto/nitrox/nitrox_sym.c > index f8b7edcd69..0c9bbfef46 100644 > --- a/drivers/crypto/nitrox/nitrox_sym.c > +++ b/drivers/crypto/nitrox/nitrox_sym.c > @@ -532,22 +532,16 @@ configure_aead_ctx(struct rte_crypto_aead_xform > *xform, > static int > nitrox_sym_dev_sess_configure(struct rte_cryptodev *cdev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + void *sess) > { > - void *mp_obj; > struct nitrox_crypto_ctx *ctx; > struct rte_crypto_cipher_xform *cipher_xform =3D NULL; > struct rte_crypto_auth_xform *auth_xform =3D NULL; > struct rte_crypto_aead_xform *aead_xform =3D NULL; > int ret =3D -EINVAL; >=20 > - if (rte_mempool_get(mempool, &mp_obj)) { > - NITROX_LOG(ERR, "Couldn't allocate context\n"); > - return -ENOMEM; > - } > - > - ctx =3D mp_obj; > + RTE_SET_USED(cdev); > + ctx =3D sess; > ctx->nitrox_chain =3D get_crypto_chain_order(xform); > switch (ctx->nitrox_chain) { > case NITROX_CHAIN_CIPHER_ONLY: > @@ -586,28 +580,17 @@ nitrox_sym_dev_sess_configure(struct > rte_cryptodev *cdev, > } >=20 > ctx->iova =3D rte_mempool_virt2iova(ctx); > - set_sym_session_private_data(sess, cdev->driver_id, ctx); > return 0; > err: > - rte_mempool_put(mempool, mp_obj); > return ret; > } >=20 > static void > -nitrox_sym_dev_sess_clear(struct rte_cryptodev *cdev, > - struct rte_cryptodev_sym_session *sess) > +nitrox_sym_dev_sess_clear(struct rte_cryptodev *cdev, void *sess) > { > - struct nitrox_crypto_ctx *ctx =3D get_sym_session_private_data(sess, > - cdev->driver_id); > - struct rte_mempool *sess_mp; > - > - if (!ctx) > - return; > - > - memset(ctx, 0, sizeof(*ctx)); > - sess_mp =3D rte_mempool_from_obj(ctx); > - set_sym_session_private_data(sess, cdev->driver_id, NULL); > - rte_mempool_put(sess_mp, ctx); > + RTE_SET_USED(cdev); > + if (sess) > + memset(sess, 0, sizeof(struct nitrox_crypto_ctx)); > } >=20 > static struct nitrox_crypto_ctx * > diff --git a/drivers/crypto/null/null_crypto_pmd_ops.c > b/drivers/crypto/null/null_crypto_pmd_ops.c > index a8b5a06e7f..65bfa8dcf7 100644 > --- a/drivers/crypto/null/null_crypto_pmd_ops.c > +++ b/drivers/crypto/null/null_crypto_pmd_ops.c > @@ -234,7 +234,6 @@ null_crypto_pmd_qp_setup(struct rte_cryptodev > *dev, uint16_t qp_id, > } >=20 > qp->sess_mp =3D qp_conf->mp_session; > - qp->sess_mp_priv =3D qp_conf->mp_session_private; >=20 > memset(&qp->qp_stats, 0, sizeof(qp->qp_stats)); >=20 > @@ -258,10 +257,8 @@ null_crypto_pmd_sym_session_get_size(struct > rte_cryptodev *dev __rte_unused) > static int > null_crypto_pmd_sym_session_configure(struct rte_cryptodev *dev > __rte_unused, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mp) > + void *sess) > { > - void *sess_private_data; > int ret; >=20 > if (unlikely(sess =3D=3D NULL)) { > @@ -269,42 +266,23 @@ null_crypto_pmd_sym_session_configure(struct > rte_cryptodev *dev __rte_unused, > return -EINVAL; > } >=20 > - if (rte_mempool_get(mp, &sess_private_data)) { > - NULL_LOG(ERR, > - "Couldn't get object from session mempool"); > - return -ENOMEM; > - } > - > - ret =3D null_crypto_set_session_parameters(sess_private_data, > xform); > + ret =3D null_crypto_set_session_parameters(sess, xform); > if (ret !=3D 0) { > NULL_LOG(ERR, "failed configure session parameters"); > - > - /* Return session to mempool */ > - rte_mempool_put(mp, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > - sess_private_data); > - > return 0; > } >=20 > /** Clear the memory of session so it doesn't leave key material behind = */ > static void > -null_crypto_pmd_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +null_crypto_pmd_sym_session_clear(struct rte_cryptodev *dev, void > *sess) > { > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - > + RTE_SET_USED(dev); > /* Zero out the whole structure */ > - if (sess_priv) { > - memset(sess_priv, 0, sizeof(struct null_crypto_session)); > - struct rte_mempool *sess_mp =3D > rte_mempool_from_obj(sess_priv); > - set_sym_session_private_data(sess, index, NULL); > - rte_mempool_put(sess_mp, sess_priv); > - } > + if (sess) > + memset(sess, 0, sizeof(struct null_crypto_session)); > } >=20 > static struct rte_cryptodev_ops pmd_ops =3D { > diff --git a/drivers/crypto/octeontx/otx_cryptodev_hw_access.h > b/drivers/crypto/octeontx/otx_cryptodev_hw_access.h > index 7c6b1e45b4..95659e472b 100644 > --- a/drivers/crypto/octeontx/otx_cryptodev_hw_access.h > +++ b/drivers/crypto/octeontx/otx_cryptodev_hw_access.h > @@ -49,7 +49,6 @@ struct cpt_instance { > uint32_t queue_id; > uintptr_t rsvd; > struct rte_mempool *sess_mp; > - struct rte_mempool *sess_mp_priv; > struct cpt_qp_meta_info meta_info; > uint8_t ca_enabled; > }; > diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c > b/drivers/crypto/octeontx/otx_cryptodev_ops.c > index 9e8fd495cf..abd0963be0 100644 > --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c > +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c > @@ -171,7 +171,6 @@ otx_cpt_que_pair_setup(struct rte_cryptodev *dev, >=20 > instance->queue_id =3D que_pair_id; > instance->sess_mp =3D qp_conf->mp_session; > - instance->sess_mp_priv =3D qp_conf->mp_session_private; > dev->data->queue_pairs[que_pair_id] =3D instance; >=20 > return 0; > @@ -243,29 +242,22 @@ sym_xform_verify(struct rte_crypto_sym_xform > *xform) > } >=20 > static int > -sym_session_configure(int driver_id, struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *pool) > +sym_session_configure(struct rte_crypto_sym_xform *xform, > + void *sess) > { > struct rte_crypto_sym_xform *temp_xform =3D xform; > struct cpt_sess_misc *misc; > vq_cmd_word3_t vq_cmd_w3; > - void *priv; > int ret; >=20 > ret =3D sym_xform_verify(xform); > if (unlikely(ret)) > return ret; >=20 > - if (unlikely(rte_mempool_get(pool, &priv))) { > - CPT_LOG_ERR("Could not allocate session private data"); > - return -ENOMEM; > - } > - > - memset(priv, 0, sizeof(struct cpt_sess_misc) + > + memset(sess, 0, sizeof(struct cpt_sess_misc) + > offsetof(struct cpt_ctx, mc_ctx)); >=20 > - misc =3D priv; > + misc =3D sess; >=20 > for ( ; xform !=3D NULL; xform =3D xform->next) { > switch (xform->type) { > @@ -301,8 +293,6 @@ sym_session_configure(int driver_id, struct > rte_crypto_sym_xform *xform, > goto priv_put; > } >=20 > - set_sym_session_private_data(sess, driver_id, priv); > - > misc->ctx_dma_addr =3D rte_mempool_virt2iova(misc) + > sizeof(struct cpt_sess_misc); >=20 > @@ -316,56 +306,46 @@ sym_session_configure(int driver_id, struct > rte_crypto_sym_xform *xform, > return 0; >=20 > priv_put: > - if (priv) > - rte_mempool_put(pool, priv); > return -ENOTSUP; > } >=20 > static void > -sym_session_clear(int driver_id, struct rte_cryptodev_sym_session *sess) > +sym_session_clear(void *sess) > { > - void *priv =3D get_sym_session_private_data(sess, driver_id); > struct cpt_sess_misc *misc; > - struct rte_mempool *pool; > struct cpt_ctx *ctx; >=20 > - if (priv =3D=3D NULL) > + if (sess =3D=3D NULL) > return; >=20 > - misc =3D priv; > + misc =3D sess; > ctx =3D SESS_PRIV(misc); >=20 > if (ctx->auth_key !=3D NULL) > rte_free(ctx->auth_key); >=20 > - memset(priv, 0, cpt_get_session_size()); > - > - pool =3D rte_mempool_from_obj(priv); > - > - set_sym_session_private_data(sess, driver_id, NULL); > - > - rte_mempool_put(pool, priv); > + memset(sess, 0, cpt_get_session_size()); > } >=20 > static int > otx_cpt_session_cfg(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *pool) > + void *sess) > { > CPT_PMD_INIT_FUNC_TRACE(); > + RTE_SET_USED(dev); >=20 > - return sym_session_configure(dev->driver_id, xform, sess, pool); > + return sym_session_configure(xform, sess); > } >=20 >=20 > static void > -otx_cpt_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +otx_cpt_session_clear(struct rte_cryptodev *dev, void *sess) > { > CPT_PMD_INIT_FUNC_TRACE(); > + RTE_SET_USED(dev); >=20 > - return sym_session_clear(dev->driver_id, sess); > + return sym_session_clear(sess); > } >=20 > static unsigned int > @@ -576,7 +556,6 @@ static __rte_always_inline void * __rte_hot > otx_cpt_enq_single_sym_sessless(struct cpt_instance *instance, > struct rte_crypto_op *op) > { > - const int driver_id =3D otx_cryptodev_driver_id; > struct rte_crypto_sym_op *sym_op =3D op->sym; > struct rte_cryptodev_sym_session *sess; > void *req; > @@ -589,8 +568,12 @@ otx_cpt_enq_single_sym_sessless(struct > cpt_instance *instance, > return NULL; > } >=20 > - ret =3D sym_session_configure(driver_id, sym_op->xform, sess, > - instance->sess_mp_priv); > + sess->sess_data[otx_cryptodev_driver_id].data =3D > + (void *)((uint8_t *)sess + > + rte_cryptodev_sym_get_header_session_size() + > + (otx_cryptodev_driver_id * sess->priv_sz)); > + ret =3D sym_session_configure(sym_op->xform, > + sess->sess_data[otx_cryptodev_driver_id].data); > if (ret) > goto sess_put; >=20 > @@ -604,7 +587,7 @@ otx_cpt_enq_single_sym_sessless(struct > cpt_instance *instance, > return req; >=20 > priv_put: > - sym_session_clear(driver_id, sess); > + sym_session_clear(sess); > sess_put: > rte_mempool_put(instance->sess_mp, sess); > return NULL; > @@ -913,7 +896,6 @@ free_sym_session_data(const struct cpt_instance > *instance, > memset(cop->sym->session, 0, > rte_cryptodev_sym_get_existing_header_session_size( > cop->sym->session)); > - rte_mempool_put(instance->sess_mp_priv, sess_private_data_t); > rte_mempool_put(instance->sess_mp, cop->sym->session); > cop->sym->session =3D NULL; > } > diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c > b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c > index 7b744cd4b4..dcfbc49996 100644 > --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c > +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c > @@ -371,29 +371,21 @@ sym_xform_verify(struct rte_crypto_sym_xform > *xform) > } >=20 > static int > -sym_session_configure(int driver_id, struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *pool) > +sym_session_configure(struct rte_crypto_sym_xform *xform, void *sess) > { > struct rte_crypto_sym_xform *temp_xform =3D xform; > struct cpt_sess_misc *misc; > vq_cmd_word3_t vq_cmd_w3; > - void *priv; > int ret; >=20 > ret =3D sym_xform_verify(xform); > if (unlikely(ret)) > return ret; >=20 > - if (unlikely(rte_mempool_get(pool, &priv))) { > - CPT_LOG_ERR("Could not allocate session private data"); > - return -ENOMEM; > - } > - > - memset(priv, 0, sizeof(struct cpt_sess_misc) + > + memset(sess, 0, sizeof(struct cpt_sess_misc) + > offsetof(struct cpt_ctx, mc_ctx)); >=20 > - misc =3D priv; > + misc =3D sess; >=20 > for ( ; xform !=3D NULL; xform =3D xform->next) { > switch (xform->type) { > @@ -414,7 +406,7 @@ sym_session_configure(int driver_id, struct > rte_crypto_sym_xform *xform, > } >=20 > if (ret) > - goto priv_put; > + return -ENOTSUP; > } >=20 > if ((GET_SESS_FC_TYPE(misc) =3D=3D HASH_HMAC) && > @@ -425,12 +417,9 @@ sym_session_configure(int driver_id, struct > rte_crypto_sym_xform *xform, > rte_free(ctx->auth_key); > ctx->auth_key =3D NULL; > } > - ret =3D -ENOTSUP; > - goto priv_put; > + return -ENOTSUP; > } >=20 > - set_sym_session_private_data(sess, driver_id, misc); > - > misc->ctx_dma_addr =3D rte_mempool_virt2iova(misc) + > sizeof(struct cpt_sess_misc); >=20 > @@ -451,11 +440,6 @@ sym_session_configure(int driver_id, struct > rte_crypto_sym_xform *xform, > misc->cpt_inst_w7 =3D vq_cmd_w3.u64; >=20 > return 0; > - > -priv_put: > - rte_mempool_put(pool, priv); > - > - return -ENOTSUP; > } >=20 > static __rte_always_inline int32_t __rte_hot > @@ -765,7 +749,6 @@ otx2_cpt_enqueue_sym_sessless(struct otx2_cpt_qp > *qp, struct rte_crypto_op *op, > struct pending_queue *pend_q, > unsigned int burst_index) > { > - const int driver_id =3D otx2_cryptodev_driver_id; > struct rte_crypto_sym_op *sym_op =3D op->sym; > struct rte_cryptodev_sym_session *sess; > int ret; > @@ -775,8 +758,12 @@ otx2_cpt_enqueue_sym_sessless(struct > otx2_cpt_qp *qp, struct rte_crypto_op *op, > if (sess =3D=3D NULL) > return -ENOMEM; >=20 > - ret =3D sym_session_configure(driver_id, sym_op->xform, sess, > - qp->sess_mp_priv); > + sess->sess_data[otx2_cryptodev_driver_id].data =3D > + (void *)((uint8_t *)sess + > + rte_cryptodev_sym_get_header_session_size() + > + (otx2_cryptodev_driver_id * sess->priv_sz)); > + ret =3D sym_session_configure(sym_op->xform, > + sess->sess_data[otx2_cryptodev_driver_id].data); > if (ret) > goto sess_put; >=20 > @@ -790,7 +777,7 @@ otx2_cpt_enqueue_sym_sessless(struct otx2_cpt_qp > *qp, struct rte_crypto_op *op, > return 0; >=20 > priv_put: > - sym_session_clear(driver_id, sess); > + sym_session_clear(sess); > sess_put: > rte_mempool_put(qp->sess_mp, sess); > return ret; > @@ -1035,8 +1022,7 @@ otx2_cpt_dequeue_post_process(struct > otx2_cpt_qp *qp, struct rte_crypto_op *cop, > } >=20 > if (unlikely(cop->sess_type =3D=3D > RTE_CRYPTO_OP_SESSIONLESS)) { > - sym_session_clear(otx2_cryptodev_driver_id, > - cop->sym->session); > + sym_session_clear(cop->sym->session); > sz =3D > rte_cryptodev_sym_get_existing_header_session_size( > cop->sym->session); > memset(cop->sym->session, 0, sz); > @@ -1291,7 +1277,6 @@ otx2_cpt_queue_pair_setup(struct rte_cryptodev > *dev, uint16_t qp_id, > } >=20 > qp->sess_mp =3D conf->mp_session; > - qp->sess_mp_priv =3D conf->mp_session_private; > dev->data->queue_pairs[qp_id] =3D qp; >=20 > return 0; > @@ -1330,21 +1315,22 @@ otx2_cpt_sym_session_get_size(struct > rte_cryptodev *dev __rte_unused) > static int > otx2_cpt_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *pool) > + void *sess) > { > CPT_PMD_INIT_FUNC_TRACE(); > + RTE_SET_USED(dev); >=20 > - return sym_session_configure(dev->driver_id, xform, sess, pool); > + return sym_session_configure(xform, sess); > } >=20 > static void > otx2_cpt_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > + void *sess) > { > CPT_PMD_INIT_FUNC_TRACE(); > + RTE_SET_USED(dev); >=20 > - return sym_session_clear(dev->driver_id, sess); > + return sym_session_clear(sess); > } >=20 > static unsigned int > diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops_helper.h > b/drivers/crypto/octeontx2/otx2_cryptodev_ops_helper.h > index 01c081a216..5f63eaf7b7 100644 > --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops_helper.h > +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops_helper.h > @@ -8,29 +8,21 @@ > #include "cpt_pmd_logs.h" >=20 > static void > -sym_session_clear(int driver_id, struct rte_cryptodev_sym_session *sess) > +sym_session_clear(void *sess) > { > - void *priv =3D get_sym_session_private_data(sess, driver_id); > struct cpt_sess_misc *misc; > - struct rte_mempool *pool; > struct cpt_ctx *ctx; >=20 > - if (priv =3D=3D NULL) > + if (sess =3D=3D NULL) > return; >=20 > - misc =3D priv; > + misc =3D sess; > ctx =3D SESS_PRIV(misc); >=20 > if (ctx->auth_key !=3D NULL) > rte_free(ctx->auth_key); >=20 > - memset(priv, 0, cpt_get_session_size()); > - > - pool =3D rte_mempool_from_obj(priv); > - > - set_sym_session_private_data(sess, driver_id, NULL); > - > - rte_mempool_put(pool, priv); > + memset(sess, 0, cpt_get_session_size()); > } >=20 > static __rte_always_inline uint8_t > diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c > b/drivers/crypto/openssl/rte_openssl_pmd_ops.c > index 52715f86f8..1b48a6b400 100644 > --- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c > +++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c > @@ -741,7 +741,6 @@ openssl_pmd_qp_setup(struct rte_cryptodev *dev, > uint16_t qp_id, > goto qp_setup_cleanup; >=20 > qp->sess_mp =3D qp_conf->mp_session; > - qp->sess_mp_priv =3D qp_conf->mp_session_private; >=20 > memset(&qp->stats, 0, sizeof(qp->stats)); >=20 > @@ -772,10 +771,8 @@ openssl_pmd_asym_session_get_size(struct > rte_cryptodev *dev __rte_unused) > static int > openssl_pmd_sym_session_configure(struct rte_cryptodev *dev > __rte_unused, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + void *sess) > { > - void *sess_private_data; > int ret; >=20 > if (unlikely(sess =3D=3D NULL)) { > @@ -783,24 +780,12 @@ openssl_pmd_sym_session_configure(struct > rte_cryptodev *dev __rte_unused, > return -EINVAL; > } >=20 > - if (rte_mempool_get(mempool, &sess_private_data)) { > - OPENSSL_LOG(ERR, > - "Couldn't get object from session mempool"); > - return -ENOMEM; > - } > - > - ret =3D openssl_set_session_parameters(sess_private_data, xform); > + ret =3D openssl_set_session_parameters(sess, xform); > if (ret !=3D 0) { > OPENSSL_LOG(ERR, "failed configure session parameters"); > - > - /* Return session to mempool */ > - rte_mempool_put(mempool, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > - sess_private_data); > - > return 0; > } >=20 > @@ -1154,19 +1139,13 @@ openssl_pmd_asym_session_configure(struct > rte_cryptodev *dev __rte_unused, >=20 > /** Clear the memory of session so it doesn't leave key material behind = */ > static void > -openssl_pmd_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +openssl_pmd_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - > + RTE_SET_USED(dev); > /* Zero out the whole structure */ > - if (sess_priv) { > - openssl_reset_session(sess_priv); > - memset(sess_priv, 0, sizeof(struct openssl_session)); > - struct rte_mempool *sess_mp =3D > rte_mempool_from_obj(sess_priv); > - set_sym_session_private_data(sess, index, NULL); > - rte_mempool_put(sess_mp, sess_priv); > + if (sess) { > + openssl_reset_session(sess); > + memset(sess, 0, sizeof(struct openssl_session)); > } > } >=20 > diff --git a/drivers/crypto/qat/qat_sym_session.c > b/drivers/crypto/qat/qat_sym_session.c > index 2a22347c7f..114bf081c1 100644 > --- a/drivers/crypto/qat/qat_sym_session.c > +++ b/drivers/crypto/qat/qat_sym_session.c > @@ -172,21 +172,14 @@ qat_is_auth_alg_supported(enum > rte_crypto_auth_algorithm algo, > } >=20 > void > -qat_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +qat_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - struct qat_sym_session *s =3D (struct qat_sym_session *)sess_priv; > + struct qat_sym_session *s =3D (struct qat_sym_session *)sess; >=20 > - if (sess_priv) { > + if (sess) { > if (s->bpi_ctx) > bpi_cipher_ctx_free(s->bpi_ctx); > memset(s, 0, qat_sym_session_get_private_size(dev)); > - struct rte_mempool *sess_mp =3D > rte_mempool_from_obj(sess_priv); > - > - set_sym_session_private_data(sess, index, NULL); > - rte_mempool_put(sess_mp, sess_priv); > } > } >=20 > @@ -458,31 +451,17 @@ qat_sym_session_configure_cipher(struct > rte_cryptodev *dev, > int > qat_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + void *sess_private_data) > { > - void *sess_private_data; > int ret; >=20 > - if (rte_mempool_get(mempool, &sess_private_data)) { > - CDEV_LOG_ERR( > - "Couldn't get object from session mempool"); > - return -ENOMEM; > - } > - > ret =3D qat_sym_session_set_parameters(dev, xform, > sess_private_data); > if (ret !=3D 0) { > QAT_LOG(ERR, > "Crypto QAT PMD: failed to configure session parameters"); > - > - /* Return session to mempool */ > - rte_mempool_put(mempool, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > - sess_private_data); > - > return 0; > } >=20 > diff --git a/drivers/crypto/qat/qat_sym_session.h > b/drivers/crypto/qat/qat_sym_session.h > index 7fcc1d6f7b..6da29e2305 100644 > --- a/drivers/crypto/qat/qat_sym_session.h > +++ b/drivers/crypto/qat/qat_sym_session.h > @@ -112,8 +112,7 @@ struct qat_sym_session { > int > qat_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool); > + void *sess); >=20 > int > qat_sym_session_set_parameters(struct rte_cryptodev *dev, > @@ -135,8 +134,7 @@ qat_sym_session_configure_auth(struct > rte_cryptodev *dev, > struct qat_sym_session *session); >=20 > void > -qat_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *session); > +qat_sym_session_clear(struct rte_cryptodev *dev, void *session); >=20 > unsigned int > qat_sym_session_get_private_size(struct rte_cryptodev *dev); > diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c > b/drivers/crypto/scheduler/scheduler_pmd_ops.c > index 465b88ade8..87260b5a22 100644 > --- a/drivers/crypto/scheduler/scheduler_pmd_ops.c > +++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c > @@ -476,9 +476,7 @@ scheduler_pmd_sym_session_get_size(struct > rte_cryptodev *dev __rte_unused) >=20 > static int > scheduler_pmd_sym_session_configure(struct rte_cryptodev *dev, > - struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + struct rte_crypto_sym_xform *xform, void *sess) > { > struct scheduler_ctx *sched_ctx =3D dev->data->dev_private; > uint32_t i; > @@ -488,7 +486,7 @@ scheduler_pmd_sym_session_configure(struct > rte_cryptodev *dev, > struct scheduler_worker *worker =3D &sched_ctx->workers[i]; >=20 > ret =3D rte_cryptodev_sym_session_init(worker->dev_id, sess, > - xform, mempool); > + xform); > if (ret < 0) { > CR_SCHED_LOG(ERR, "unable to config sym session"); > return ret; > @@ -500,8 +498,7 @@ scheduler_pmd_sym_session_configure(struct > rte_cryptodev *dev, >=20 > /** Clear the memory of session so it doesn't leave key material behind = */ > static void > -scheduler_pmd_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +scheduler_pmd_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > struct scheduler_ctx *sched_ctx =3D dev->data->dev_private; > uint32_t i; > diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c > b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c > index 3f46014b7d..b0f8f6d86a 100644 > --- a/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c > +++ b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c > @@ -226,7 +226,6 @@ snow3g_pmd_qp_setup(struct rte_cryptodev *dev, > uint16_t qp_id, >=20 > qp->mgr =3D internals->mgr; > qp->sess_mp =3D qp_conf->mp_session; > - qp->sess_mp_priv =3D qp_conf->mp_session_private; >=20 > memset(&qp->qp_stats, 0, sizeof(qp->qp_stats)); >=20 > @@ -250,10 +249,8 @@ snow3g_pmd_sym_session_get_size(struct > rte_cryptodev *dev __rte_unused) > static int > snow3g_pmd_sym_session_configure(struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + void *sess) > { > - void *sess_private_data; > int ret; > struct snow3g_private *internals =3D dev->data->dev_private; >=20 > @@ -262,43 +259,24 @@ snow3g_pmd_sym_session_configure(struct > rte_cryptodev *dev, > return -EINVAL; > } >=20 > - if (rte_mempool_get(mempool, &sess_private_data)) { > - SNOW3G_LOG(ERR, > - "Couldn't get object from session mempool"); > - return -ENOMEM; > - } > - > ret =3D snow3g_set_session_parameters(internals->mgr, > - sess_private_data, xform); > + sess, xform); > if (ret !=3D 0) { > SNOW3G_LOG(ERR, "failed configure session parameters"); > - > - /* Return session to mempool */ > - rte_mempool_put(mempool, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > - sess_private_data); > - > return 0; > } >=20 > /** Clear the memory of session so it doesn't leave key material behind = */ > static void > -snow3g_pmd_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +snow3g_pmd_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - > + RTE_SET_USED(dev); > /* Zero out the whole structure */ > - if (sess_priv) { > - memset(sess_priv, 0, sizeof(struct snow3g_session)); > - struct rte_mempool *sess_mp =3D > rte_mempool_from_obj(sess_priv); > - set_sym_session_private_data(sess, index, NULL); > - rte_mempool_put(sess_mp, sess_priv); > - } > + if (sess) > + memset(sess, 0, sizeof(struct snow3g_session)); > } >=20 > struct rte_cryptodev_ops snow3g_pmd_ops =3D { > diff --git a/drivers/crypto/virtio/virtio_cryptodev.c > b/drivers/crypto/virtio/virtio_cryptodev.c > index 8faa39df4a..de52fec32e 100644 > --- a/drivers/crypto/virtio/virtio_cryptodev.c > +++ b/drivers/crypto/virtio/virtio_cryptodev.c > @@ -37,11 +37,10 @@ static void virtio_crypto_dev_free_mbufs(struct > rte_cryptodev *dev); > static unsigned int virtio_crypto_sym_get_session_private_size( > struct rte_cryptodev *dev); > static void virtio_crypto_sym_clear_session(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess); > + void *sess); > static int virtio_crypto_sym_configure_session(struct rte_cryptodev *dev= , > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *session, > - struct rte_mempool *mp); > + void *session); >=20 > /* > * The set of PCI devices this driver supports > @@ -927,7 +926,7 @@ virtio_crypto_check_sym_clear_session_paras( > static void > virtio_crypto_sym_clear_session( > struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > + void *sess) > { > struct virtio_crypto_hw *hw; > struct virtqueue *vq; > @@ -1290,11 +1289,9 @@ static int > virtio_crypto_check_sym_configure_session_paras( > struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sym_sess, > - struct rte_mempool *mempool) > + void *sym_sess) > { > - if (unlikely(xform =3D=3D NULL) || unlikely(sym_sess =3D=3D NULL) || > - unlikely(mempool =3D=3D NULL)) { > + if (unlikely(xform =3D=3D NULL) || unlikely(sym_sess =3D=3D NULL)) { > VIRTIO_CRYPTO_SESSION_LOG_ERR("NULL pointer"); > return -1; > } > @@ -1309,12 +1306,9 @@ static int > virtio_crypto_sym_configure_session( > struct rte_cryptodev *dev, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + void *sess) > { > int ret; > - struct virtio_crypto_session crypto_sess; > - void *session_private =3D &crypto_sess; > struct virtio_crypto_session *session; > struct virtio_crypto_op_ctrl_req *ctrl_req; > enum virtio_crypto_cmd_id cmd_id; > @@ -1326,19 +1320,13 @@ virtio_crypto_sym_configure_session( > PMD_INIT_FUNC_TRACE(); >=20 > ret =3D virtio_crypto_check_sym_configure_session_paras(dev, xform, > - sess, mempool); > + sess); > if (ret < 0) { > VIRTIO_CRYPTO_SESSION_LOG_ERR("Invalid parameters"); > return ret; > } >=20 > - if (rte_mempool_get(mempool, &session_private)) { > - VIRTIO_CRYPTO_SESSION_LOG_ERR( > - "Couldn't get object from session mempool"); > - return -ENOMEM; > - } > - > - session =3D (struct virtio_crypto_session *)session_private; > + session =3D (struct virtio_crypto_session *)sess; > memset(session, 0, sizeof(struct virtio_crypto_session)); > ctrl_req =3D &session->ctrl; > ctrl_req->header.opcode =3D > VIRTIO_CRYPTO_CIPHER_CREATE_SESSION; > @@ -1401,9 +1389,6 @@ virtio_crypto_sym_configure_session( > goto error_out; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > - session_private); > - > return 0; >=20 > error_out: > diff --git a/drivers/crypto/zuc/rte_zuc_pmd_ops.c > b/drivers/crypto/zuc/rte_zuc_pmd_ops.c > index 38642d45ab..04126c8a04 100644 > --- a/drivers/crypto/zuc/rte_zuc_pmd_ops.c > +++ b/drivers/crypto/zuc/rte_zuc_pmd_ops.c > @@ -226,7 +226,6 @@ zuc_pmd_qp_setup(struct rte_cryptodev *dev, > uint16_t qp_id, >=20 > qp->mb_mgr =3D internals->mb_mgr; > qp->sess_mp =3D qp_conf->mp_session; > - qp->sess_mp_priv =3D qp_conf->mp_session_private; >=20 > memset(&qp->qp_stats, 0, sizeof(qp->qp_stats)); >=20 > @@ -250,10 +249,8 @@ zuc_pmd_sym_session_get_size(struct > rte_cryptodev *dev __rte_unused) > static int > zuc_pmd_sym_session_configure(struct rte_cryptodev *dev __rte_unused, > struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *sess, > - struct rte_mempool *mempool) > + void *sess) > { > - void *sess_private_data; > int ret; >=20 > if (unlikely(sess =3D=3D NULL)) { > @@ -261,43 +258,23 @@ zuc_pmd_sym_session_configure(struct > rte_cryptodev *dev __rte_unused, > return -EINVAL; > } >=20 > - if (rte_mempool_get(mempool, &sess_private_data)) { > - ZUC_LOG(ERR, > - "Couldn't get object from session mempool"); > - > - return -ENOMEM; > - } > - > - ret =3D zuc_set_session_parameters(sess_private_data, xform); > + ret =3D zuc_set_session_parameters(sess, xform); > if (ret !=3D 0) { > ZUC_LOG(ERR, "failed configure session parameters"); > - > - /* Return session to mempool */ > - rte_mempool_put(mempool, sess_private_data); > return ret; > } >=20 > - set_sym_session_private_data(sess, dev->driver_id, > - sess_private_data); > - > return 0; > } >=20 > /** Clear the memory of session so it doesn't leave key material behind = */ > static void > -zuc_pmd_sym_session_clear(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess) > +zuc_pmd_sym_session_clear(struct rte_cryptodev *dev, void *sess) > { > - uint8_t index =3D dev->driver_id; > - void *sess_priv =3D get_sym_session_private_data(sess, index); > - > + RTE_SET_USED(dev); > /* Zero out the whole structure */ > - if (sess_priv) { > - memset(sess_priv, 0, sizeof(struct zuc_session)); > - struct rte_mempool *sess_mp =3D > rte_mempool_from_obj(sess_priv); > - set_sym_session_private_data(sess, index, NULL); > - rte_mempool_put(sess_mp, sess_priv); > - } > + if (sess) > + memset(sess, 0, sizeof(struct zuc_session)); > } >=20 > struct rte_cryptodev_ops zuc_pmd_ops =3D { > diff --git a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_rx.h > b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_rx.h > index b33cb7e139..8522f2dfda 100644 > --- a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_rx.h > +++ b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_rx.h > @@ -38,8 +38,7 @@ otx2_ca_deq_post_process(const struct otx2_cpt_qp > *qp, > } >=20 > if (unlikely(cop->sess_type =3D=3D > RTE_CRYPTO_OP_SESSIONLESS)) { > - sym_session_clear(otx2_cryptodev_driver_id, > - cop->sym->session); > + sym_session_clear(cop->sym->session); > memset(cop->sym->session, 0, >=20 > rte_cryptodev_sym_get_existing_header_session_size( > cop->sym->session)); > diff --git a/examples/fips_validation/fips_dev_self_test.c > b/examples/fips_validation/fips_dev_self_test.c > index b4eab05a98..bbc27a1b6f 100644 > --- a/examples/fips_validation/fips_dev_self_test.c > +++ b/examples/fips_validation/fips_dev_self_test.c > @@ -969,7 +969,6 @@ struct fips_dev_auto_test_env { > struct rte_mempool *mpool; > struct rte_mempool *op_pool; > struct rte_mempool *sess_pool; > - struct rte_mempool *sess_priv_pool; > struct rte_mbuf *mbuf; > struct rte_crypto_op *op; > }; > @@ -981,7 +980,7 @@ typedef int > (*fips_dev_self_test_prepare_xform_t)(uint8_t, > uint32_t); >=20 > typedef int (*fips_dev_self_test_prepare_op_t)(struct rte_crypto_op *, > - struct rte_mbuf *, struct rte_cryptodev_sym_session *, > + struct rte_mbuf *, void *, > uint32_t, struct fips_dev_self_test_vector *); >=20 > typedef int (*fips_dev_self_test_check_result_t)(struct rte_crypto_op *, > @@ -1173,7 +1172,7 @@ prepare_aead_xform(uint8_t dev_id, > static int > prepare_cipher_op(struct rte_crypto_op *op, > struct rte_mbuf *mbuf, > - struct rte_cryptodev_sym_session *session, > + void *session, > uint32_t dir, > struct fips_dev_self_test_vector *vec) > { > @@ -1212,7 +1211,7 @@ prepare_cipher_op(struct rte_crypto_op *op, > static int > prepare_auth_op(struct rte_crypto_op *op, > struct rte_mbuf *mbuf, > - struct rte_cryptodev_sym_session *session, > + void *session, > uint32_t dir, > struct fips_dev_self_test_vector *vec) > { > @@ -1251,7 +1250,7 @@ prepare_auth_op(struct rte_crypto_op *op, > static int > prepare_aead_op(struct rte_crypto_op *op, > struct rte_mbuf *mbuf, > - struct rte_cryptodev_sym_session *session, > + void *session, > uint32_t dir, > struct fips_dev_self_test_vector *vec) > { > @@ -1464,7 +1463,7 @@ run_single_test(uint8_t dev_id, > uint32_t negative_test) > { > struct rte_crypto_sym_xform xform; > - struct rte_cryptodev_sym_session *sess; > + void *sess; > uint16_t n_deqd; > uint8_t key[256]; > int ret; > @@ -1484,8 +1483,7 @@ run_single_test(uint8_t dev_id, > if (!sess) > return -ENOMEM; >=20 > - ret =3D rte_cryptodev_sym_session_init(dev_id, > - sess, &xform, env->sess_priv_pool); > + ret =3D rte_cryptodev_sym_session_init(dev_id, sess, &xform); > if (ret < 0) { > RTE_LOG(ERR, PMD, "Error %i: Init session\n", ret); > return ret; > @@ -1533,8 +1531,6 @@ fips_dev_auto_test_uninit(uint8_t dev_id, > rte_mempool_free(env->op_pool); > if (env->sess_pool) > rte_mempool_free(env->sess_pool); > - if (env->sess_priv_pool) > - rte_mempool_free(env->sess_priv_pool); >=20 > rte_cryptodev_stop(dev_id); > } > @@ -1542,7 +1538,7 @@ fips_dev_auto_test_uninit(uint8_t dev_id, > static int > fips_dev_auto_test_init(uint8_t dev_id, struct fips_dev_auto_test_env > *env) > { > - struct rte_cryptodev_qp_conf qp_conf =3D {128, NULL, NULL}; > + struct rte_cryptodev_qp_conf qp_conf =3D {128, NULL}; > uint32_t sess_sz =3D > rte_cryptodev_sym_get_private_session_size(dev_id); > struct rte_cryptodev_config conf; > char name[128]; > @@ -1586,25 +1582,13 @@ fips_dev_auto_test_init(uint8_t dev_id, struct > fips_dev_auto_test_env *env) > snprintf(name, 128, "%s%u", "SELF_TEST_SESS_POOL", dev_id); >=20 > env->sess_pool =3D rte_cryptodev_sym_session_pool_create(name, > - 128, 0, 0, 0, rte_cryptodev_socket_id(dev_id)); > + 128, sess_sz, 0, 0, rte_cryptodev_socket_id(dev_id)); > if (!env->sess_pool) { > ret =3D -ENOMEM; > goto error_exit; > } >=20 > - memset(name, 0, 128); > - snprintf(name, 128, "%s%u", "SELF_TEST_SESS_PRIV_POOL", dev_id); > - > - env->sess_priv_pool =3D rte_mempool_create(name, > - 128, sess_sz, 0, 0, NULL, NULL, NULL, > - NULL, rte_cryptodev_socket_id(dev_id), 0); > - if (!env->sess_priv_pool) { > - ret =3D -ENOMEM; > - goto error_exit; > - } > - > qp_conf.mp_session =3D env->sess_pool; > - qp_conf.mp_session_private =3D env->sess_priv_pool; >=20 > ret =3D rte_cryptodev_queue_pair_setup(dev_id, 0, &qp_conf, > rte_cryptodev_socket_id(dev_id)); > diff --git a/examples/fips_validation/main.c > b/examples/fips_validation/main.c > index a8daad1f48..03c6ccb5b8 100644 > --- a/examples/fips_validation/main.c > +++ b/examples/fips_validation/main.c > @@ -48,13 +48,12 @@ struct cryptodev_fips_validate_env { > uint16_t mbuf_data_room; > struct rte_mempool *mpool; > struct rte_mempool *sess_mpool; > - struct rte_mempool *sess_priv_mpool; > struct rte_mempool *op_pool; > struct rte_mbuf *mbuf; > uint8_t *digest; > uint16_t digest_len; > struct rte_crypto_op *op; > - struct rte_cryptodev_sym_session *sess; > + void *sess; > uint16_t self_test; > struct fips_dev_broken_test_config *broken_test_config; > } env; > @@ -63,7 +62,7 @@ static int > cryptodev_fips_validate_app_int(void) > { > struct rte_cryptodev_config conf =3D {rte_socket_id(), 1, 0}; > - struct rte_cryptodev_qp_conf qp_conf =3D {128, NULL, NULL}; > + struct rte_cryptodev_qp_conf qp_conf =3D {128, NULL}; > struct rte_cryptodev_info dev_info; > uint32_t sess_sz =3D rte_cryptodev_sym_get_private_session_size( > env.dev_id); > @@ -103,16 +102,11 @@ cryptodev_fips_validate_app_int(void) > ret =3D -ENOMEM; >=20 > env.sess_mpool =3D rte_cryptodev_sym_session_pool_create( > - "FIPS_SESS_MEMPOOL", 16, 0, 0, 0, rte_socket_id()); > + "FIPS_SESS_MEMPOOL", 16, sess_sz, 0, 0, > + rte_socket_id()); > if (!env.sess_mpool) > goto error_exit; >=20 > - env.sess_priv_mpool =3D > rte_mempool_create("FIPS_SESS_PRIV_MEMPOOL", > - 16, sess_sz, 0, 0, NULL, NULL, NULL, > - NULL, rte_socket_id(), 0); > - if (!env.sess_priv_mpool) > - goto error_exit; > - > env.op_pool =3D rte_crypto_op_pool_create( > "FIPS_OP_POOL", > RTE_CRYPTO_OP_TYPE_SYMMETRIC, > @@ -127,7 +121,6 @@ cryptodev_fips_validate_app_int(void) > goto error_exit; >=20 > qp_conf.mp_session =3D env.sess_mpool; > - qp_conf.mp_session_private =3D env.sess_priv_mpool; >=20 > ret =3D rte_cryptodev_queue_pair_setup(env.dev_id, 0, &qp_conf, > rte_socket_id()); > @@ -141,8 +134,6 @@ cryptodev_fips_validate_app_int(void) > rte_mempool_free(env.mpool); > if (env.sess_mpool) > rte_mempool_free(env.sess_mpool); > - if (env.sess_priv_mpool) > - rte_mempool_free(env.sess_priv_mpool); > if (env.op_pool) > rte_mempool_free(env.op_pool); >=20 > @@ -158,7 +149,6 @@ cryptodev_fips_validate_app_uninit(void) > rte_cryptodev_sym_session_free(env.sess); > rte_mempool_free(env.mpool); > rte_mempool_free(env.sess_mpool); > - rte_mempool_free(env.sess_priv_mpool); > rte_mempool_free(env.op_pool); > } >=20 > @@ -1179,7 +1169,7 @@ fips_run_test(void) > return -ENOMEM; >=20 > ret =3D rte_cryptodev_sym_session_init(env.dev_id, > - env.sess, &xform, env.sess_priv_mpool); > + env.sess, &xform); > if (ret < 0) { > RTE_LOG(ERR, USER1, "Error %i: Init session\n", > ret); > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec- > secgw/ipsec-secgw.c > index 7ad94cb822..65528ee2e7 100644 > --- a/examples/ipsec-secgw/ipsec-secgw.c > +++ b/examples/ipsec-secgw/ipsec-secgw.c > @@ -1216,15 +1216,11 @@ ipsec_poll_mode_worker(void) > qconf->inbound.sa_ctx =3D socket_ctx[socket_id].sa_in; > qconf->inbound.cdev_map =3D cdev_map_in; > qconf->inbound.session_pool =3D socket_ctx[socket_id].session_pool; > - qconf->inbound.session_priv_pool =3D > - socket_ctx[socket_id].session_priv_pool; > qconf->outbound.sp4_ctx =3D socket_ctx[socket_id].sp_ip4_out; > qconf->outbound.sp6_ctx =3D socket_ctx[socket_id].sp_ip6_out; > qconf->outbound.sa_ctx =3D socket_ctx[socket_id].sa_out; > qconf->outbound.cdev_map =3D cdev_map_out; > qconf->outbound.session_pool =3D > socket_ctx[socket_id].session_pool; > - qconf->outbound.session_priv_pool =3D > - socket_ctx[socket_id].session_priv_pool; > qconf->frag.pool_dir =3D socket_ctx[socket_id].mbuf_pool; > qconf->frag.pool_indir =3D socket_ctx[socket_id].mbuf_pool_indir; >=20 > @@ -2142,8 +2138,6 @@ cryptodevs_init(uint16_t req_queue_num) > qp_conf.nb_descriptors =3D CDEV_QUEUE_DESC; > qp_conf.mp_session =3D > socket_ctx[dev_conf.socket_id].session_pool; > - qp_conf.mp_session_private =3D > - socket_ctx[dev_conf.socket_id].session_priv_pool; > for (qp =3D 0; qp < dev_conf.nb_queue_pairs; qp++) > if (rte_cryptodev_queue_pair_setup(cdev_id, qp, > &qp_conf, dev_conf.socket_id)) > @@ -2405,37 +2399,37 @@ session_pool_init(struct socket_ctx *ctx, int32_t > socket_id, size_t sess_sz) > printf("Allocated session pool on socket %d\n", > socket_id); > } >=20 > -static void > -session_priv_pool_init(struct socket_ctx *ctx, int32_t socket_id, > - size_t sess_sz) > -{ > - char mp_name[RTE_MEMPOOL_NAMESIZE]; > - struct rte_mempool *sess_mp; > - uint32_t nb_sess; > - > - snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, > - "sess_mp_priv_%u", socket_id); > - nb_sess =3D (get_nb_crypto_sessions() + CDEV_MP_CACHE_SZ * > - rte_lcore_count()); > - nb_sess =3D RTE_MAX(nb_sess, CDEV_MP_CACHE_SZ * > - CDEV_MP_CACHE_MULTIPLIER); > - sess_mp =3D rte_mempool_create(mp_name, > - nb_sess, > - sess_sz, > - CDEV_MP_CACHE_SZ, > - 0, NULL, NULL, NULL, > - NULL, socket_id, > - 0); > - ctx->session_priv_pool =3D sess_mp; > - > - if (ctx->session_priv_pool =3D=3D NULL) > - rte_exit(EXIT_FAILURE, > - "Cannot init session priv pool on socket %d\n", > - socket_id); > - else > - printf("Allocated session priv pool on socket %d\n", > - socket_id); > -} > +//static void > +//session_priv_pool_init(struct socket_ctx *ctx, int32_t socket_id, > +// size_t sess_sz) > +//{ > +// char mp_name[RTE_MEMPOOL_NAMESIZE]; > +// struct rte_mempool *sess_mp; > +// uint32_t nb_sess; > +// > +// snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, > +// "sess_mp_priv_%u", socket_id); > +// nb_sess =3D (get_nb_crypto_sessions() + CDEV_MP_CACHE_SZ * > +// rte_lcore_count()); > +// nb_sess =3D RTE_MAX(nb_sess, CDEV_MP_CACHE_SZ * > +// CDEV_MP_CACHE_MULTIPLIER); > +// sess_mp =3D rte_mempool_create(mp_name, > +// nb_sess, > +// sess_sz, > +// CDEV_MP_CACHE_SZ, > +// 0, NULL, NULL, NULL, > +// NULL, socket_id, > +// 0); > +// ctx->session_priv_pool =3D sess_mp; > +// > +// if (ctx->session_priv_pool =3D=3D NULL) > +// rte_exit(EXIT_FAILURE, > +// "Cannot init session priv pool on socket %d\n", > +// socket_id); > +// else > +// printf("Allocated session priv pool on socket %d\n", > +// socket_id); > +//} >=20 > static void > pool_init(struct socket_ctx *ctx, int32_t socket_id, uint32_t nb_mbuf) > @@ -2938,8 +2932,8 @@ main(int32_t argc, char **argv) >=20 > pool_init(&socket_ctx[socket_id], socket_id, > nb_bufs_in_pool); > session_pool_init(&socket_ctx[socket_id], socket_id, > sess_sz); > - session_priv_pool_init(&socket_ctx[socket_id], socket_id, > - sess_sz); > +// session_priv_pool_init(&socket_ctx[socket_id], socket_id, > +// sess_sz); > } > printf("Number of mbufs in packet pool %d\n", nb_bufs_in_pool); >=20 > diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c > index 03d907cba8..a5921de11c 100644 > --- a/examples/ipsec-secgw/ipsec.c > +++ b/examples/ipsec-secgw/ipsec.c > @@ -143,8 +143,7 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx, > struct ipsec_sa *sa, > ips->crypto.ses =3D rte_cryptodev_sym_session_create( > ipsec_ctx->session_pool); > rte_cryptodev_sym_session_init(ipsec_ctx- > >tbl[cdev_id_qp].id, > - ips->crypto.ses, sa->xforms, > - ipsec_ctx->session_priv_pool); > + ips->crypto.ses, sa->xforms); >=20 > rte_cryptodev_info_get(ipsec_ctx->tbl[cdev_id_qp].id, > &cdev_info); > diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h > index 8405c48171..673c64e8dc 100644 > --- a/examples/ipsec-secgw/ipsec.h > +++ b/examples/ipsec-secgw/ipsec.h > @@ -243,7 +243,6 @@ struct socket_ctx { > struct rte_mempool *mbuf_pool; > struct rte_mempool *mbuf_pool_indir; > struct rte_mempool *session_pool; > - struct rte_mempool *session_priv_pool; > }; >=20 > struct cnt_blk { > diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec- > secgw/ipsec_worker.c > index c545497cee..04bcce49db 100644 > --- a/examples/ipsec-secgw/ipsec_worker.c > +++ b/examples/ipsec-secgw/ipsec_worker.c > @@ -537,14 +537,10 @@ ipsec_wrkr_non_burst_int_port_app_mode(struct > eh_event_link_info *links, > lconf.inbound.sp6_ctx =3D socket_ctx[socket_id].sp_ip6_in; > lconf.inbound.sa_ctx =3D socket_ctx[socket_id].sa_in; > lconf.inbound.session_pool =3D socket_ctx[socket_id].session_pool; > - lconf.inbound.session_priv_pool =3D > - socket_ctx[socket_id].session_priv_pool; > lconf.outbound.sp4_ctx =3D socket_ctx[socket_id].sp_ip4_out; > lconf.outbound.sp6_ctx =3D socket_ctx[socket_id].sp_ip6_out; > lconf.outbound.sa_ctx =3D socket_ctx[socket_id].sa_out; > lconf.outbound.session_pool =3D socket_ctx[socket_id].session_pool; > - lconf.outbound.session_priv_pool =3D > - socket_ctx[socket_id].session_priv_pool; >=20 > RTE_LOG(INFO, IPSEC, > "Launching event mode worker (non-burst - Tx internal port - > " > diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c > index 66d1491bf7..bdc3da731c 100644 > --- a/examples/l2fwd-crypto/main.c > +++ b/examples/l2fwd-crypto/main.c > @@ -188,7 +188,7 @@ struct l2fwd_crypto_params { > struct l2fwd_iv auth_iv; > struct l2fwd_iv aead_iv; > struct l2fwd_key aad; > - struct rte_cryptodev_sym_session *session; > + void *session; >=20 > uint8_t do_cipher; > uint8_t do_hash; > @@ -229,7 +229,6 @@ struct rte_mempool *l2fwd_pktmbuf_pool; > struct rte_mempool *l2fwd_crypto_op_pool; > static struct { > struct rte_mempool *sess_mp; > - struct rte_mempool *priv_mp; > } session_pool_socket[RTE_MAX_NUMA_NODES]; >=20 > /* Per-port statistics struct */ > @@ -671,11 +670,11 @@ generate_random_key(uint8_t *key, unsigned > length) > } >=20 > /* Session is created and is later attached to the crypto operation. 8< = */ > -static struct rte_cryptodev_sym_session * > +static void * > initialize_crypto_session(struct l2fwd_crypto_options *options, uint8_t > cdev_id) > { > struct rte_crypto_sym_xform *first_xform; > - struct rte_cryptodev_sym_session *session; > + void *session; > int retval =3D rte_cryptodev_socket_id(cdev_id); >=20 > if (retval < 0) > @@ -703,8 +702,7 @@ initialize_crypto_session(struct l2fwd_crypto_options > *options, uint8_t cdev_id) > return NULL; >=20 > if (rte_cryptodev_sym_session_init(cdev_id, session, > - first_xform, > - session_pool_socket[socket_id].priv_mp) < 0) > + first_xform) < 0) > return NULL; >=20 > return session; > @@ -730,7 +728,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options > *options) > US_PER_S * BURST_TX_DRAIN_US; > struct l2fwd_crypto_params *cparams; > struct l2fwd_crypto_params port_cparams[qconf->nb_crypto_devs]; > - struct rte_cryptodev_sym_session *session; > + void *session; >=20 > if (qconf->nb_rx_ports =3D=3D 0) { > RTE_LOG(INFO, L2FWD, "lcore %u has nothing to do\n", > lcore_id); > @@ -2388,30 +2386,6 @@ initialize_cryptodevs(struct l2fwd_crypto_options > *options, unsigned nb_ports, > } else > sessions_needed =3D enabled_cdev_count; >=20 > - if (session_pool_socket[socket_id].priv_mp =3D=3D NULL) { > - char mp_name[RTE_MEMPOOL_NAMESIZE]; > - > - snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, > - "priv_sess_mp_%u", socket_id); > - > - session_pool_socket[socket_id].priv_mp =3D > - rte_mempool_create(mp_name, > - sessions_needed, > - max_sess_sz, > - 0, 0, NULL, NULL, NULL, > - NULL, socket_id, > - 0); > - > - if (session_pool_socket[socket_id].priv_mp =3D=3D NULL) > { > - printf("Cannot create pool on socket %d\n", > - socket_id); > - return -ENOMEM; > - } > - > - printf("Allocated pool \"%s\" on socket %d\n", > - mp_name, socket_id); > - } > - > if (session_pool_socket[socket_id].sess_mp =3D=3D NULL) { > char mp_name[RTE_MEMPOOL_NAMESIZE]; > snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, > @@ -2421,7 +2395,8 @@ initialize_cryptodevs(struct l2fwd_crypto_options > *options, unsigned nb_ports, >=20 > rte_cryptodev_sym_session_pool_create( > mp_name, > sessions_needed, > - 0, 0, 0, socket_id); > + max_sess_sz, > + 0, 0, socket_id); >=20 > if (session_pool_socket[socket_id].sess_mp =3D=3D NULL) > { > printf("Cannot create pool on socket %d\n", > @@ -2573,8 +2548,6 @@ initialize_cryptodevs(struct l2fwd_crypto_options > *options, unsigned nb_ports, >=20 > qp_conf.nb_descriptors =3D 2048; > qp_conf.mp_session =3D > session_pool_socket[socket_id].sess_mp; > - qp_conf.mp_session_private =3D > - session_pool_socket[socket_id].priv_mp; >=20 > retval =3D rte_cryptodev_queue_pair_setup(cdev_id, 0, > &qp_conf, > socket_id); > diff --git a/examples/vhost_crypto/main.c b/examples/vhost_crypto/main.c > index dea7dcbd07..cbb97aaf76 100644 > --- a/examples/vhost_crypto/main.c > +++ b/examples/vhost_crypto/main.c > @@ -46,7 +46,6 @@ struct vhost_crypto_info { > int vids[MAX_NB_SOCKETS]; > uint32_t nb_vids; > struct rte_mempool *sess_pool; > - struct rte_mempool *sess_priv_pool; > struct rte_mempool *cop_pool; > uint8_t cid; > uint32_t qid; > @@ -304,7 +303,6 @@ new_device(int vid) > } >=20 > ret =3D rte_vhost_crypto_create(vid, info->cid, info->sess_pool, > - info->sess_priv_pool, > rte_lcore_to_socket_id(options.los[i].lcore_id)); > if (ret) { > RTE_LOG(ERR, USER1, "Cannot create vhost crypto\n"); > @@ -458,7 +456,6 @@ free_resource(void) >=20 > rte_mempool_free(info->cop_pool); > rte_mempool_free(info->sess_pool); > - rte_mempool_free(info->sess_priv_pool); >=20 > for (j =3D 0; j < lo->nb_sockets; j++) { > rte_vhost_driver_unregister(lo->socket_files[i]); > @@ -544,16 +541,12 @@ main(int argc, char *argv[]) >=20 > snprintf(name, 127, "SESS_POOL_%u", lo->lcore_id); > info->sess_pool =3D > rte_cryptodev_sym_session_pool_create(name, > - SESSION_MAP_ENTRIES, 0, 0, 0, > - rte_lcore_to_socket_id(lo->lcore_id)); > - > - snprintf(name, 127, "SESS_POOL_PRIV_%u", lo->lcore_id); > - info->sess_priv_pool =3D rte_mempool_create(name, > SESSION_MAP_ENTRIES, >=20 > rte_cryptodev_sym_get_private_session_size( > - info->cid), 64, 0, NULL, NULL, NULL, NULL, > - rte_lcore_to_socket_id(lo->lcore_id), 0); > - if (!info->sess_priv_pool || !info->sess_pool) { > + info->cid), 0, 0, > + rte_lcore_to_socket_id(lo->lcore_id)); > + > + if (!info->sess_pool) { > RTE_LOG(ERR, USER1, "Failed to create mempool"); > goto error_exit; > } > @@ -574,7 +567,6 @@ main(int argc, char *argv[]) >=20 > qp_conf.nb_descriptors =3D NB_CRYPTO_DESCRIPTORS; > qp_conf.mp_session =3D info->sess_pool; > - qp_conf.mp_session_private =3D info->sess_priv_pool; >=20 > for (j =3D 0; j < dev_info.max_nb_queue_pairs; j++) { > ret =3D rte_cryptodev_queue_pair_setup(info->cid, j, > diff --git a/lib/cryptodev/cryptodev_pmd.h > b/lib/cryptodev/cryptodev_pmd.h > index ae3aac59ae..d758b3b85d 100644 > --- a/lib/cryptodev/cryptodev_pmd.h > +++ b/lib/cryptodev/cryptodev_pmd.h > @@ -242,7 +242,6 @@ typedef unsigned int > (*cryptodev_asym_get_session_private_size_t)( > * @param dev Crypto device pointer > * @param xform Single or chain of crypto xforms > * @param session Pointer to cryptodev's private session > structure > - * @param mp Mempool where the private session is > allocated > * > * @return > * - Returns 0 if private session structure have been created successfu= lly. > @@ -251,9 +250,7 @@ typedef unsigned int > (*cryptodev_asym_get_session_private_size_t)( > * - Returns -ENOMEM if the private session could not be allocated. > */ > typedef int (*cryptodev_sym_configure_session_t)(struct rte_cryptodev > *dev, > - struct rte_crypto_sym_xform *xform, > - struct rte_cryptodev_sym_session *session, > - struct rte_mempool *mp); > + struct rte_crypto_sym_xform *xform, void *session); > /** > * Configure a Crypto asymmetric session on a device. > * > @@ -279,7 +276,7 @@ typedef int > (*cryptodev_asym_configure_session_t)(struct rte_cryptodev *dev, > * @param sess Cryptodev session structure > */ > typedef void (*cryptodev_sym_free_session_t)(struct rte_cryptodev *dev, > - struct rte_cryptodev_sym_session *sess); > + void *sess); > /** > * Free asymmetric session private data. > * > diff --git a/lib/cryptodev/rte_crypto.h b/lib/cryptodev/rte_crypto.h > index a864f5036f..200617f623 100644 > --- a/lib/cryptodev/rte_crypto.h > +++ b/lib/cryptodev/rte_crypto.h > @@ -420,7 +420,7 @@ rte_crypto_op_sym_xforms_alloc(struct > rte_crypto_op *op, uint8_t nb_xforms) > */ > static inline int > rte_crypto_op_attach_sym_session(struct rte_crypto_op *op, > - struct rte_cryptodev_sym_session *sess) > + void *sess) > { > if (unlikely(op->type !=3D RTE_CRYPTO_OP_TYPE_SYMMETRIC)) > return -1; > diff --git a/lib/cryptodev/rte_crypto_sym.h > b/lib/cryptodev/rte_crypto_sym.h > index 58c0724743..848da1942c 100644 > --- a/lib/cryptodev/rte_crypto_sym.h > +++ b/lib/cryptodev/rte_crypto_sym.h > @@ -932,7 +932,7 @@ __rte_crypto_sym_op_sym_xforms_alloc(struct > rte_crypto_sym_op *sym_op, > */ > static inline int > __rte_crypto_sym_op_attach_sym_session(struct rte_crypto_sym_op > *sym_op, > - struct rte_cryptodev_sym_session *sess) > + void *sess) > { > sym_op->session =3D sess; >=20 > diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.= c > index 9fa3aff1d3..a31cae202a 100644 > --- a/lib/cryptodev/rte_cryptodev.c > +++ b/lib/cryptodev/rte_cryptodev.c > @@ -199,6 +199,8 @@ struct > rte_cryptodev_sym_session_pool_private_data { > /**< number of elements in sess_data array */ > uint16_t user_data_sz; > /**< session user data will be placed after sess_data */ > + uint16_t sess_priv_sz; > + /**< session user data will be placed after sess_data */ > }; >=20 > int > @@ -1223,8 +1225,7 @@ rte_cryptodev_queue_pair_setup(uint8_t dev_id, > uint16_t queue_pair_id, > return -EINVAL; > } >=20 > - if ((qp_conf->mp_session && !qp_conf->mp_session_private) || > - (!qp_conf->mp_session && qp_conf- > >mp_session_private)) { > + if (!qp_conf->mp_session) { > CDEV_LOG_ERR("Invalid mempools\n"); > return -EINVAL; > } > @@ -1232,7 +1233,6 @@ rte_cryptodev_queue_pair_setup(uint8_t dev_id, > uint16_t queue_pair_id, > if (qp_conf->mp_session) { > struct rte_cryptodev_sym_session_pool_private_data > *pool_priv; > uint32_t obj_size =3D qp_conf->mp_session->elt_size; > - uint32_t obj_priv_size =3D qp_conf->mp_session_private- > >elt_size; > struct rte_cryptodev_sym_session s =3D {0}; >=20 > pool_priv =3D rte_mempool_get_priv(qp_conf->mp_session); > @@ -1244,11 +1244,11 @@ rte_cryptodev_queue_pair_setup(uint8_t > dev_id, uint16_t queue_pair_id, >=20 > s.nb_drivers =3D pool_priv->nb_drivers; > s.user_data_sz =3D pool_priv->user_data_sz; > + s.priv_sz =3D pool_priv->sess_priv_sz; >=20 > - if > ((rte_cryptodev_sym_get_existing_header_session_size(&s) > > - obj_size) || (s.nb_drivers <=3D dev->driver_id) || > - > rte_cryptodev_sym_get_private_session_size(dev_id) > > - obj_priv_size) { > + if > (((rte_cryptodev_sym_get_existing_header_session_size(&s) + > + (s.nb_drivers * s.priv_sz)) > obj_size) || > + (s.nb_drivers <=3D dev->driver_id)) { > CDEV_LOG_ERR("Invalid mempool\n"); > return -EINVAL; > } > @@ -1710,11 +1710,11 @@ rte_cryptodev_pmd_callback_process(struct > rte_cryptodev *dev, >=20 > int > rte_cryptodev_sym_session_init(uint8_t dev_id, > - struct rte_cryptodev_sym_session *sess, > - struct rte_crypto_sym_xform *xforms, > - struct rte_mempool *mp) > + void *sess_opaque, > + struct rte_crypto_sym_xform *xforms) > { > struct rte_cryptodev *dev; > + struct rte_cryptodev_sym_session *sess =3D sess_opaque; > uint32_t sess_priv_sz =3D > rte_cryptodev_sym_get_private_session_size( > dev_id); > uint8_t index; > @@ -1727,10 +1727,10 @@ rte_cryptodev_sym_session_init(uint8_t dev_id, >=20 > dev =3D rte_cryptodev_pmd_get_dev(dev_id); >=20 > - if (sess =3D=3D NULL || xforms =3D=3D NULL || dev =3D=3D NULL || mp =3D= =3D NULL) > + if (sess =3D=3D NULL || xforms =3D=3D NULL || dev =3D=3D NULL) > return -EINVAL; >=20 > - if (mp->elt_size < sess_priv_sz) > + if (sess->priv_sz < sess_priv_sz) > return -EINVAL; >=20 > index =3D dev->driver_id; > @@ -1740,8 +1740,11 @@ rte_cryptodev_sym_session_init(uint8_t dev_id, > RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops- > >sym_session_configure, -ENOTSUP); >=20 > if (sess->sess_data[index].refcnt =3D=3D 0) { > + sess->sess_data[index].data =3D (void *)((uint8_t *)sess + > + > rte_cryptodev_sym_get_header_session_size() + > + (index * sess->priv_sz)); > ret =3D dev->dev_ops->sym_session_configure(dev, xforms, > - sess, mp); > + sess->sess_data[index].data); > if (ret < 0) { > CDEV_LOG_ERR( > "dev_id %d failed to configure session > details", > @@ -1750,7 +1753,7 @@ rte_cryptodev_sym_session_init(uint8_t dev_id, > } > } >=20 > - rte_cryptodev_trace_sym_session_init(dev_id, sess, xforms, mp); > + rte_cryptodev_trace_sym_session_init(dev_id, sess, xforms); > sess->sess_data[index].refcnt++; > return 0; > } > @@ -1795,6 +1798,21 @@ rte_cryptodev_asym_session_init(uint8_t dev_id, > rte_cryptodev_trace_asym_session_init(dev_id, sess, xforms, mp); > return 0; > } > +static size_t > +get_max_sym_sess_priv_sz(void) > +{ > + size_t max_sz, sz; > + int16_t cdev_id, n; > + > + max_sz =3D 0; > + n =3D rte_cryptodev_count(); > + for (cdev_id =3D 0; cdev_id !=3D n; cdev_id++) { > + sz =3D rte_cryptodev_sym_get_private_session_size(cdev_id); > + if (sz > max_sz) > + max_sz =3D sz; > + } > + return max_sz; > +} >=20 > struct rte_mempool * > rte_cryptodev_sym_session_pool_create(const char *name, uint32_t > nb_elts, > @@ -1804,15 +1822,15 @@ rte_cryptodev_sym_session_pool_create(const > char *name, uint32_t nb_elts, > struct rte_mempool *mp; > struct rte_cryptodev_sym_session_pool_private_data *pool_priv; > uint32_t obj_sz; > + uint32_t sess_priv_sz =3D get_max_sym_sess_priv_sz(); >=20 > obj_sz =3D rte_cryptodev_sym_get_header_session_size() + > user_data_size; > - if (obj_sz > elt_size) > + if (elt_size < obj_sz + (sess_priv_sz * nb_drivers)) { > CDEV_LOG_INFO("elt_size %u is expanded to %u\n", > elt_size, > - obj_sz); > - else > - obj_sz =3D elt_size; > - > - mp =3D rte_mempool_create(name, nb_elts, obj_sz, cache_size, > + obj_sz + (sess_priv_sz * nb_drivers)); > + elt_size =3D obj_sz + (sess_priv_sz * nb_drivers); > + } > + mp =3D rte_mempool_create(name, nb_elts, elt_size, cache_size, > (uint32_t)(sizeof(*pool_priv)), > NULL, NULL, NULL, NULL, > socket_id, 0); > @@ -1832,6 +1850,7 @@ rte_cryptodev_sym_session_pool_create(const > char *name, uint32_t nb_elts, >=20 > pool_priv->nb_drivers =3D nb_drivers; > pool_priv->user_data_sz =3D user_data_size; > + pool_priv->sess_priv_sz =3D sess_priv_sz; >=20 > rte_cryptodev_trace_sym_session_pool_create(name, nb_elts, > elt_size, cache_size, user_data_size, mp); > @@ -1865,7 +1884,7 @@ rte_cryptodev_sym_is_valid_session_pool(struct > rte_mempool *mp) > return 1; > } >=20 > -struct rte_cryptodev_sym_session * > +void * > rte_cryptodev_sym_session_create(struct rte_mempool *mp) > { > struct rte_cryptodev_sym_session *sess; > @@ -1886,6 +1905,7 @@ rte_cryptodev_sym_session_create(struct > rte_mempool *mp) >=20 > sess->nb_drivers =3D pool_priv->nb_drivers; > sess->user_data_sz =3D pool_priv->user_data_sz; > + sess->priv_sz =3D pool_priv->sess_priv_sz; > sess->opaque_data =3D 0; >=20 > /* Clear device session pointer. > @@ -1895,7 +1915,7 @@ rte_cryptodev_sym_session_create(struct > rte_mempool *mp) > rte_cryptodev_sym_session_data_size(sess)); >=20 > rte_cryptodev_trace_sym_session_create(mp, sess); > - return sess; > + return (void *)sess; > } >=20 > struct rte_cryptodev_asym_session * > @@ -1933,9 +1953,9 @@ rte_cryptodev_asym_session_create(struct > rte_mempool *mp) > } >=20 > int > -rte_cryptodev_sym_session_clear(uint8_t dev_id, > - struct rte_cryptodev_sym_session *sess) > +rte_cryptodev_sym_session_clear(uint8_t dev_id, void *s) > { > + struct rte_cryptodev_sym_session *sess =3D s; > struct rte_cryptodev *dev; > uint8_t driver_id; >=20 > @@ -1957,7 +1977,7 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id, >=20 > RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->sym_session_clear, > -ENOTSUP); >=20 > - dev->dev_ops->sym_session_clear(dev, sess); > + dev->dev_ops->sym_session_clear(dev, sess- > >sess_data[driver_id].data); >=20 > rte_cryptodev_trace_sym_session_clear(dev_id, sess); > return 0; > @@ -1988,10 +2008,11 @@ rte_cryptodev_asym_session_clear(uint8_t > dev_id, > } >=20 > int > -rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess) > +rte_cryptodev_sym_session_free(void *s) > { > uint8_t i; > struct rte_mempool *sess_mp; > + struct rte_cryptodev_sym_session *sess =3D s; >=20 > if (sess =3D=3D NULL) > return -EINVAL; > diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.= h > index bb01f0f195..25af6fa7b9 100644 > --- a/lib/cryptodev/rte_cryptodev.h > +++ b/lib/cryptodev/rte_cryptodev.h > @@ -537,8 +537,6 @@ struct rte_cryptodev_qp_conf { > uint32_t nb_descriptors; /**< Number of descriptors per queue pair > */ > struct rte_mempool *mp_session; > /**< The mempool for creating session in sessionless mode */ > - struct rte_mempool *mp_session_private; > - /**< The mempool for creating sess private data in sessionless mode > */ > }; >=20 > /** > @@ -1126,6 +1124,8 @@ struct rte_cryptodev_sym_session { > /**< number of elements in sess_data array */ > uint16_t user_data_sz; > /**< session user data will be placed after sess_data */ > + uint16_t priv_sz; > + /**< Maximum private session data size which each driver can use */ > __extension__ struct { > void *data; > uint16_t refcnt; > @@ -1177,10 +1177,10 @@ rte_cryptodev_sym_session_pool_create(const > char *name, uint32_t nb_elts, > * @param mempool Symmetric session mempool to allocate session > * objects from > * @return > - * - On success return pointer to sym-session > + * - On success return opaque pointer to sym-session > * - On failure returns NULL > */ > -struct rte_cryptodev_sym_session * > +void * > rte_cryptodev_sym_session_create(struct rte_mempool *mempool); >=20 > /** > @@ -1209,7 +1209,7 @@ rte_cryptodev_asym_session_create(struct > rte_mempool *mempool); > * - -EBUSY if not all device private data has been freed. > */ > int > -rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session > *sess); > +rte_cryptodev_sym_session_free(void *sess); >=20 > /** > * Frees asymmetric crypto session header, after checking that all > @@ -1229,25 +1229,23 @@ rte_cryptodev_asym_session_free(struct > rte_cryptodev_asym_session *sess); >=20 > /** > * Fill out private data for the device id, based on its device type. > + * Memory for private data is already allocated in sess, driver need > + * to fill the content. > * > * @param dev_id ID of device that we want the session to be used on > * @param sess Session where the private data will be attached to > * @param xforms Symmetric crypto transform operations to apply on > flow > * processed with this session > - * @param mempool Mempool where the private data is allocated. > * > * @return > * - On success, zero. > * - -EINVAL if input parameters are invalid. > * - -ENOTSUP if crypto device does not support the crypto transform or > * does not support symmetric operations. > - * - -ENOMEM if the private session could not be allocated. > */ > int > -rte_cryptodev_sym_session_init(uint8_t dev_id, > - struct rte_cryptodev_sym_session *sess, > - struct rte_crypto_sym_xform *xforms, > - struct rte_mempool *mempool); > +rte_cryptodev_sym_session_init(uint8_t dev_id, void *sess, > + struct rte_crypto_sym_xform *xforms); >=20 > /** > * Initialize asymmetric session on a device with specific asymmetric xf= orm > @@ -1286,8 +1284,7 @@ rte_cryptodev_asym_session_init(uint8_t dev_id, > * - -ENOTSUP if crypto device does not support symmetric operations. > */ > int > -rte_cryptodev_sym_session_clear(uint8_t dev_id, > - struct rte_cryptodev_sym_session *sess); > +rte_cryptodev_sym_session_clear(uint8_t dev_id, void *sess); >=20 > /** > * Frees resources held by asymmetric session during > rte_cryptodev_session_init > diff --git a/lib/cryptodev/rte_cryptodev_trace.h > b/lib/cryptodev/rte_cryptodev_trace.h > index d1f4f069a3..44da04c425 100644 > --- a/lib/cryptodev/rte_cryptodev_trace.h > +++ b/lib/cryptodev/rte_cryptodev_trace.h > @@ -56,7 +56,6 @@ RTE_TRACE_POINT( > rte_trace_point_emit_u16(queue_pair_id); > rte_trace_point_emit_u32(conf->nb_descriptors); > rte_trace_point_emit_ptr(conf->mp_session); > - rte_trace_point_emit_ptr(conf->mp_session_private); > ) >=20 > RTE_TRACE_POINT( > @@ -106,15 +105,13 @@ RTE_TRACE_POINT( > RTE_TRACE_POINT( > rte_cryptodev_trace_sym_session_init, > RTE_TRACE_POINT_ARGS(uint8_t dev_id, > - struct rte_cryptodev_sym_session *sess, void *xforms, > - void *mempool), > + struct rte_cryptodev_sym_session *sess, void *xforms), > rte_trace_point_emit_u8(dev_id); > rte_trace_point_emit_ptr(sess); > rte_trace_point_emit_u64(sess->opaque_data); > rte_trace_point_emit_u16(sess->nb_drivers); > rte_trace_point_emit_u16(sess->user_data_sz); > rte_trace_point_emit_ptr(xforms); > - rte_trace_point_emit_ptr(mempool); > ) >=20 > RTE_TRACE_POINT( > diff --git a/lib/pipeline/rte_table_action.c b/lib/pipeline/rte_table_act= ion.c > index ad7904c0ee..efdba9c899 100644 > --- a/lib/pipeline/rte_table_action.c > +++ b/lib/pipeline/rte_table_action.c > @@ -1719,7 +1719,7 @@ struct sym_crypto_data { > uint16_t op_mask; >=20 > /** Session pointer. */ > - struct rte_cryptodev_sym_session *session; > + void *session; >=20 > /** Direction of crypto, encrypt or decrypt */ > uint16_t direction; > @@ -1780,7 +1780,7 @@ sym_crypto_apply(struct sym_crypto_data *data, > const struct rte_crypto_auth_xform *auth_xform =3D NULL; > const struct rte_crypto_aead_xform *aead_xform =3D NULL; > struct rte_crypto_sym_xform *xform =3D p->xform; > - struct rte_cryptodev_sym_session *session; > + void *session; > int ret; >=20 > memset(data, 0, sizeof(*data)); > @@ -1905,7 +1905,7 @@ sym_crypto_apply(struct sym_crypto_data *data, > return -ENOMEM; >=20 > ret =3D rte_cryptodev_sym_session_init(cfg->cryptodev_id, session, > - p->xform, cfg->mp_init); > + p->xform); > if (ret < 0) { > rte_cryptodev_sym_session_free(session); > return ret; > @@ -2858,7 +2858,7 @@ rte_table_action_time_read(struct > rte_table_action *action, > return 0; > } >=20 > -struct rte_cryptodev_sym_session * > +void * > rte_table_action_crypto_sym_session_get(struct rte_table_action *action, > void *data) > { > diff --git a/lib/pipeline/rte_table_action.h b/lib/pipeline/rte_table_act= ion.h > index 82bc9d9ac9..68db453a8b 100644 > --- a/lib/pipeline/rte_table_action.h > +++ b/lib/pipeline/rte_table_action.h > @@ -1129,7 +1129,7 @@ rte_table_action_time_read(struct > rte_table_action *action, > * The pointer to the session on success, NULL otherwise. > */ > __rte_experimental > -struct rte_cryptodev_sym_session * > +void * > rte_table_action_crypto_sym_session_get(struct rte_table_action *action, > void *data); >=20 > diff --git a/lib/vhost/rte_vhost_crypto.h b/lib/vhost/rte_vhost_crypto.h > index f54d731139..d9b7beed9c 100644 > --- a/lib/vhost/rte_vhost_crypto.h > +++ b/lib/vhost/rte_vhost_crypto.h > @@ -50,8 +50,6 @@ rte_vhost_crypto_driver_start(const char *path); > * multiple Vhost-crypto devices. > * @param sess_pool > * The pointer to the created cryptodev session pool. > - * @param sess_priv_pool > - * The pointer to the created cryptodev session private data mempool. > * @param socket_id > * NUMA Socket ID to allocate resources on. * > * @return > @@ -61,7 +59,6 @@ rte_vhost_crypto_driver_start(const char *path); > int > rte_vhost_crypto_create(int vid, uint8_t cryptodev_id, > struct rte_mempool *sess_pool, > - struct rte_mempool *sess_priv_pool, > int socket_id); >=20 > /** > diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c > index 926b5c0bd9..b4464c4253 100644 > --- a/lib/vhost/vhost_crypto.c > +++ b/lib/vhost/vhost_crypto.c > @@ -338,7 +338,7 @@ vhost_crypto_create_sess(struct vhost_crypto > *vcrypto, > VhostUserCryptoSessionParam *sess_param) > { > struct rte_crypto_sym_xform xform1 =3D {0}, xform2 =3D {0}; > - struct rte_cryptodev_sym_session *session; > + void *session; > int ret; >=20 > switch (sess_param->op_type) { > @@ -383,8 +383,7 @@ vhost_crypto_create_sess(struct vhost_crypto > *vcrypto, > return; > } >=20 > - if (rte_cryptodev_sym_session_init(vcrypto->cid, session, &xform1, > - vcrypto->sess_priv_pool) < 0) { > + if (rte_cryptodev_sym_session_init(vcrypto->cid, session, &xform1) > < 0) { > VC_LOG_ERR("Failed to initialize session"); > sess_param->session_id =3D -VIRTIO_CRYPTO_ERR; > return; > @@ -1425,7 +1424,6 @@ rte_vhost_crypto_driver_start(const char *path) > int > rte_vhost_crypto_create(int vid, uint8_t cryptodev_id, > struct rte_mempool *sess_pool, > - struct rte_mempool *sess_priv_pool, > int socket_id) > { > struct virtio_net *dev =3D get_device(vid); > @@ -1447,7 +1445,6 @@ rte_vhost_crypto_create(int vid, uint8_t > cryptodev_id, > } >=20 > vcrypto->sess_pool =3D sess_pool; > - vcrypto->sess_priv_pool =3D sess_priv_pool; > vcrypto->cid =3D cryptodev_id; > vcrypto->cache_session_id =3D UINT64_MAX; > vcrypto->last_session_id =3D 1; > -- > 2.25.1