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 C611543F04; Wed, 12 Jun 2024 12:38:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9DCCD40395; Wed, 12 Jun 2024 12:38:38 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by mails.dpdk.org (Postfix) with ESMTP id 1ABD3402AB for ; Wed, 12 Jun 2024 12:38:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718188717; x=1749724717; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=v/dGUGDv1HKozlPKyuYQP6koo4DCYlimaoNeempL0IY=; b=KgptOlxWSLgf+DlN1W3J4S1wYkfrwBDSiCH2sAArBXn0yPZbISvLVS1m z8mdQ2O0fwyXUjAOH+A8GukeK41Jti5Si7Hv5DQgK9DmUwBdYaSJQtN1o zJQ9cf89QseIUmeD/FBuY1aSla/BVAUR5A20wzOGHQ8Z09tDjd9+GlTMD vtPK8TPiTzuw2A1t8VcLNguMXr0qXrpJshsMQwXldoFW7IQHBioh0Vd/7 cp5eNInVG8ONrcRdWTFD5Ox0wuB+qM3B2WPTXI00lsnkZmdBJys65MA0O /YKH5gnQj2aKyI9T5lXa5h/4UeniJZlH+NBaCCR6W6i6EAjWba4vQ7Ioo g==; X-CSE-ConnectionGUID: 0XnDy/7RQmGafzCtsSndgw== X-CSE-MsgGUID: 6oQOkDsIQdG3yD/CuIPzAw== X-IronPort-AV: E=McAfee;i="6600,9927,11100"; a="14906645" X-IronPort-AV: E=Sophos;i="6.08,232,1712646000"; d="scan'208";a="14906645" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 03:38:36 -0700 X-CSE-ConnectionGUID: VHaD32LWSy2mNXR55jL1ag== X-CSE-MsgGUID: gnzjmOEeSXi2NeiftmQr0g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,232,1712646000"; d="scan'208";a="70553878" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orviesa002.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 12 Jun 2024 03:38:36 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 12 Jun 2024 03:38:35 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 12 Jun 2024 03:38:35 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 12 Jun 2024 03:38:35 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.173) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Jun 2024 03:38:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M1ChmBGE142V9f8+x/rlhLzk8buTLzlI/D2PawQb7q8zZ0krZDw73EGxUvGT9mxCLqg4ITT/YPxtxoUHf2e9Sk6XXe3h7Zmh5ba4ww2kO5k76FSDVYwkM7wpIZImBL1piUtnNaiXJL7oy7S/JWtIcKTor5Ag7qI8dN9z+ZGkzsgbIluWTNdUwPP6foA4j4tzP0KJIbfM1SySNVxo/8ZImBvHQ4iXLC8ntk0hMI+n/LWhZHjnhjBcgeiIAik8rnh8jC6qqGHIXQWwIfPFsl5YOnU1maIli0crtejCp1IXoxUDfd0mSf0VD9/k9d5PtJmYQ8PQ/S82AN2Y7OnwNqix3g== 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=whiPWRM7hyBuG3Qy8c1Q3McYg2EauQ4YLub1+a2bxFQ=; b=FHIKx7yG1ViCNAEXfNOIsBZ0eGVX2WYjBMJzTBPEljPOhgrsn00Na9OQ2BDo+dX0sZMEsVD8viGNi/VKlPy2enEwaoAYe9nkVa8mJ2UzzBXxe+zwmi2dG5PyvmMbF4rXkziVcknXokDebTK9qVtvYEiTRycIC97WqVDawMgAwugSoep4QB64qODYD1mk5qLvELi4IaC2eHj0ZUSfUiwF7p4b4B01ZIflsFEzEOv8tmK9uT0+RXTNA8TTLUol+99GH+tnIx1jmxIEpw09eWgL7RHgV7AJQuGb3Zqw/1z+ROw7/KF/B+MwnZntoK2bKr8MOQM1MQDxKY5V+JYy27sMkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SJ0PR11MB5056.namprd11.prod.outlook.com (2603:10b6:a03:2d5::6) by IA0PR11MB7212.namprd11.prod.outlook.com (2603:10b6:208:43e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Wed, 12 Jun 2024 10:38:27 +0000 Received: from SJ0PR11MB5056.namprd11.prod.outlook.com ([fe80::4f35:279e:a725:ad08]) by SJ0PR11MB5056.namprd11.prod.outlook.com ([fe80::4f35:279e:a725:ad08%6]) with mapi id 15.20.7677.019; Wed, 12 Jun 2024 10:38:27 +0000 From: "Dooley, Brian" To: Jack Bond-Preston , Ciara Power CC: "dev@dpdk.org" , Wathsala Vithanage , Paul Szczepanek Subject: RE: [PATCH] app/test-crypto-perf: add shared session option Thread-Topic: [PATCH] app/test-crypto-perf: add shared session option Thread-Index: AQHato89F2703Ci53UG3DmyaKRtAprHD+6DA Date: Wed, 12 Jun 2024 10:38:26 +0000 Message-ID: References: <20240604145446.2216337-1-jack.bond-preston@foss.arm.com> In-Reply-To: <20240604145446.2216337-1-jack.bond-preston@foss.arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR11MB5056:EE_|IA0PR11MB7212:EE_ x-ms-office365-filtering-correlation-id: 734d94c9-e9d3-4803-0d52-08dc8acbcb1b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230032|1800799016|366008|376006|38070700010; x-microsoft-antispam-message-info: =?us-ascii?Q?FEAnDq0zmKQbGECTEBXBB80Q9nigAogHXvMu74Z3GbovAaiIaOQZb5WNkzSX?= =?us-ascii?Q?D01ZCUcHPhrFg1Kqs+GhKuGVmAjXDAKJxOny5C5u0YPZT7kG3KIvU96+3HhL?= =?us-ascii?Q?cwB5WCbhK0N/rTBNkjrItiqMfQv5+9/Q4IlU3Zgf8U3PL24NIwBzP01dVpg+?= =?us-ascii?Q?62ibp4URJg+HfsrurnE2++EQvP5wWEiWiZRx2XDvJADaJung1MBTtY4fg8dY?= =?us-ascii?Q?ZNOdPtw9sFRRcdA1TbJGUp23UcJxjm8sKyKbb45YjVBeL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mj0sPB3Y/HdDMCbrgseAjnHCAB3hybojy6xQQlkzR21c1FOQN75?= =?us-ascii?Q?Je2TFs+v6Cdfkox1hVMuA5MRmqn5dhumA+ofAgp/fJfCbXQ0BL8zcSFQCaqS?= =?us-ascii?Q?Al7Xyl4wIcJcZ35dxKxk6N00nn4CzEmwlovW/RjIdMF2Qt0gn+rC7JVLYjGb?= =?us-ascii?Q?zm3Y/pTAo7Pm9ajXlAyADwqC3tZE24lNVSNWr3Tm7rI7nkFRV31B6H0DV0g6?= =?us-ascii?Q?M/7tNLI=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB5056.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230032)(1800799016)(366008)(376006)(38070700010); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?JxB6XdRd0YrPGXLfbqZZ/0yzOKKbmNMbctkZjsUQu+YDIhCYhu9+KQEhSRRO?= =?us-ascii?Q?L/dzGUY7siOPIzxDFOsrxkXz/ar1hfMTapEk2YDuvmvL9ZPWhOIWriYZri2a?= =?us-ascii?Q?vapCIQPpvCvxeKMgkshS6SQqlTpu8c0Sw/ZSkwmugHM9p6ZFtFiStjm0oylW?= =?us-ascii?Q?KktG42lASp2aENgilN7LF9MoZeTpxCLxIr7wMZikhDjrNucd2MEIVnAHB/lu?= =?us-ascii?Q?h6Mq3yQFzkIx8i079fNYFbJef63q3wJTY4tEzdXi7hqNMop5VL5/FQpRsfAc?= =?us-ascii?Q?0zHDUlY11g/HRWHV9rHk3wJ7GbQ2/annywVePeDsCkYXk2aQsNipsh4rpi/f?= =?us-ascii?Q?XJT729v9UZ9KVoIeJukW5wUS0C3BwTy9c5NGemQyrJAp5rK9omu6K6BLQCZE?= =?us-ascii?Q?Fxt5lvvaCwOCOR7gPeaQ8daCZmsXY/WKTBA12lZ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B0BaqOiT/4OJTEMjsjE2mIuwf+P8Ow4aRA1g6yOXlohRDrx9Hum?= =?us-ascii?Q?RRTaafBhTU5KFiYykYg9qBGqXXY51mFnpgD8Ff8qlval033j9MSsU+ZO5RDd?= =?us-ascii?Q?HRuhH814zH828LM0Oh1OOJvoe3T1zHnJhrv/1ro59iijFJVt7QsngpbLrKMI?= =?us-ascii?Q?W7tEhwwd+HMUVP9PN7oOCpIkLqdx+YUmuKrLfJO8F9/k9Hsdf3+3r0Q1KBdk?= =?us-ascii?Q?iF2r0GGcbKRlgYCr6Rr+pnGq3E4C8+ydRxhwupSP?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5056.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 734d94c9-e9d3-4803-0d52-08dc8acbcb1b X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jun 2024 10:38:26.9844 (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: Cp6polHvCpNIYcxIO8OvFx+JayrpMkeRupt+OAa4KUfpK15LH8TP36aq+QuqJUaK9IAwqFywPLPMqffvivC4/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7212 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Jack, > -----Original Message----- > From: Jack Bond-Preston > Sent: Tuesday, June 4, 2024 3:55 PM > To: Ciara Power > Cc: dev@dpdk.org; Wathsala Vithanage ; Paul > Szczepanek > Subject: [PATCH] app/test-crypto-perf: add shared session option >=20 > Add the option to create one session for the PMD, and share it across all= of the > queue pairs. This may help to discover/debug concurrency issues (both > correctness and performance) that can occur when using this configuration= . >=20 > Signed-off-by: Jack Bond-Preston > Reviewed-by: Wathsala Vithanage > Reviewed-by: Paul Szczepanek > --- > app/test-crypto-perf/cperf.h | 3 ++- > app/test-crypto-perf/cperf_options.h | 2 ++ > app/test-crypto-perf/cperf_options_parsing.c | 12 ++++++++++ > app/test-crypto-perf/cperf_test_latency.c | 23 +++++++++++++------ > app/test-crypto-perf/cperf_test_latency.h | 3 ++- > .../cperf_test_pmd_cyclecount.c | 21 ++++++++++++----- > .../cperf_test_pmd_cyclecount.h | 3 ++- > app/test-crypto-perf/cperf_test_throughput.c | 21 ++++++++++++----- > app/test-crypto-perf/cperf_test_throughput.h | 3 ++- > app/test-crypto-perf/cperf_test_verify.c | 21 ++++++++++++----- > app/test-crypto-perf/cperf_test_verify.h | 3 ++- > app/test-crypto-perf/main.c | 23 +++++++++++++++++-- > 12 files changed, 106 insertions(+), 32 deletions(-) >=20 > diff --git a/app/test-crypto-perf/cperf.h b/app/test-crypto-perf/cperf.h = index > db58228dce..06df5d88ad 100644 > --- a/app/test-crypto-perf/cperf.h > +++ b/app/test-crypto-perf/cperf.h > @@ -19,7 +19,8 @@ typedef void *(*cperf_constructor_t)( > uint16_t qp_id, > const struct cperf_options *options, > const struct cperf_test_vector *t_vec, > - const struct cperf_op_fns *op_fns); > + const struct cperf_op_fns *op_fns, > + void **sess); >=20 > typedef int (*cperf_runner_t)(void *test_ctx); typedef void > (*cperf_destructor_t)(void *test_ctx); diff --git a/app/test-crypto- > perf/cperf_options.h b/app/test-crypto-perf/cperf_options.h > index be36c70be1..69312a8f7f 100644 > --- a/app/test-crypto-perf/cperf_options.h > +++ b/app/test-crypto-perf/cperf_options.h > @@ -27,6 +27,7 @@ > #define CPERF_DEVTYPE ("devtype") > #define CPERF_OPTYPE ("optype") > #define CPERF_SESSIONLESS ("sessionless") > +#define CPERF_SHARED_SESSION ("shared-session") > #define CPERF_OUT_OF_PLACE ("out-of-place") > #define CPERF_TEST_FILE ("test-file") > #define CPERF_TEST_NAME ("test-name") > @@ -104,6 +105,7 @@ struct cperf_options { > uint16_t nb_qps; >=20 > uint32_t sessionless:1; > + uint32_t shared_session:1; > uint32_t out_of_place:1; > uint32_t silent:1; > uint32_t csv:1; > diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-cryp= to- > perf/cperf_options_parsing.c > index 8c20974273..55f858fa1b 100644 > --- a/app/test-crypto-perf/cperf_options_parsing.c > +++ b/app/test-crypto-perf/cperf_options_parsing.c > @@ -39,6 +39,7 @@ usage(char *progname) > " --optype cipher-only / auth-only / cipher-then-auth / auth- > then-cipher /\n" > " aead / pdcp / docsis / ipsec / modex / tls-record : set > operation type\n" > " --sessionless: enable session-less crypto operations\n" > + " --shared-session: share 1 session across all queue pairs on > crypto device\n" > " --out-of-place: enable out-of-place crypto operations\n" > " --test-file NAME: set the test vector file path\n" > " --test-name NAME: set specific test name section in test > file\n" > @@ -508,6 +509,14 @@ parse_sessionless(struct cperf_options *opts, > return 0; > } >=20 > +static int > +parse_shared_session(struct cperf_options *opts, > + const char *arg __rte_unused) > +{ > + opts->shared_session =3D 1; > + return 0; > +} > + > static int > parse_out_of_place(struct cperf_options *opts, > const char *arg __rte_unused) > @@ -910,6 +919,7 @@ static struct option lgopts[] =3D { >=20 > { CPERF_SILENT, no_argument, 0, 0 }, > { CPERF_SESSIONLESS, no_argument, 0, 0 }, > + { CPERF_SHARED_SESSION, no_argument, 0, 0 }, > { CPERF_OUT_OF_PLACE, no_argument, 0, 0 }, > { CPERF_TEST_FILE, required_argument, 0, 0 }, > { CPERF_TEST_NAME, required_argument, 0, 0 }, @@ -1035,6 > +1045,7 @@ cperf_opts_parse_long(int opt_idx, struct cperf_options *opts) > { CPERF_DEVTYPE, parse_device_type }, > { CPERF_OPTYPE, parse_op_type }, > { CPERF_SESSIONLESS, parse_sessionless }, > + { CPERF_SHARED_SESSION, parse_shared_session }, > { CPERF_OUT_OF_PLACE, parse_out_of_place }, > { CPERF_IMIX, parse_imix }, > { CPERF_TEST_FILE, parse_test_file }, > @@ -1439,6 +1450,7 @@ cperf_options_dump(struct cperf_options *opts) > printf("# number of queue pairs per device: %u\n", opts->nb_qps); > printf("# crypto operation: %s\n", cperf_op_type_strs[opts- > >op_type]); > printf("# sessionless: %s\n", opts->sessionless ? "yes" : "no"); > + printf("# shared session: %s\n", opts->shared_session ? "yes" : "no"); > printf("# out of place: %s\n", opts->out_of_place ? "yes" : "no"); > if (opts->test =3D=3D CPERF_TEST_TYPE_PMDCC) > printf("# inter-burst delay: %u ms\n", opts->pmdcc_delay); > diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto- > perf/cperf_test_latency.c > index b8ad6bf4d4..bbf33fa03d 100644 > --- a/app/test-crypto-perf/cperf_test_latency.c > +++ b/app/test-crypto-perf/cperf_test_latency.c > @@ -1,7 +1,6 @@ > /* SPDX-License-Identifier: BSD-3-Clause > * Copyright(c) 2016-2017 Intel Corporation > */ > - > #include > #include > #include > @@ -25,6 +24,7 @@ struct cperf_latency_ctx { > struct rte_mempool *pool; >=20 > void *sess; > + uint8_t sess_owner; >=20 > cperf_populate_ops_t populate_ops; >=20 > @@ -46,7 +46,7 @@ cperf_latency_test_free(struct cperf_latency_ctx *ctx) > if (ctx =3D=3D NULL) > return; >=20 > - if (ctx->sess !=3D NULL) { > + if (ctx->sess !=3D NULL && ctx->sess_owner) { > if (ctx->options->op_type =3D=3D CPERF_ASYM_MODEX) > rte_cryptodev_asym_session_free(ctx->dev_id, ctx- > >sess); #ifdef RTE_LIB_SECURITY @@ -72,7 +72,8 @@ > cperf_latency_test_constructor(struct rte_mempool *sess_mp, > uint8_t dev_id, uint16_t qp_id, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > - const struct cperf_op_fns *op_fns) > + const struct cperf_op_fns *op_fns, > + void **sess) > { > struct cperf_latency_ctx *ctx =3D NULL; > size_t extra_op_priv_size =3D sizeof(struct priv_op_data); @@ -93,10 > +94,18 @@ 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, dev_id, options, > - test_vector, iv_offset); > - if (ctx->sess =3D=3D NULL) > - goto err; > + > + if (*sess !=3D NULL) { > + ctx->sess =3D *sess; > + ctx->sess_owner =3D false; > + } else { > + ctx->sess =3D op_fns->sess_create(sess_mp, dev_id, options, > test_vector, > + iv_offset); > + if (ctx->sess =3D=3D NULL) > + goto err; > + *sess =3D ctx->sess; > + ctx->sess_owner =3D true; > + } >=20 > if (cperf_alloc_common_memory(options, test_vector, dev_id, qp_id, > extra_op_priv_size, > diff --git a/app/test-crypto-perf/cperf_test_latency.h b/app/test-crypto- > perf/cperf_test_latency.h > index d3fc3218d7..0f2b61e21f 100644 > --- a/app/test-crypto-perf/cperf_test_latency.h > +++ b/app/test-crypto-perf/cperf_test_latency.h > @@ -21,7 +21,8 @@ cperf_latency_test_constructor( > uint16_t qp_id, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > - const struct cperf_op_fns *ops_fn); > + const struct cperf_op_fns *ops_fn, > + void **sess); >=20 > int > cperf_latency_test_runner(void *test_ctx); diff --git a/app/test-crypto- > perf/cperf_test_pmd_cyclecount.c b/app/test-crypto- > perf/cperf_test_pmd_cyclecount.c > index 7191d99ea4..07a842f40a 100644 > --- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c > +++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c > @@ -29,6 +29,7 @@ struct cperf_pmd_cyclecount_ctx { > struct rte_crypto_op **ops_processed; >=20 > void *sess; > + uint8_t sess_owner; >=20 > cperf_populate_ops_t populate_ops; >=20 > @@ -63,7 +64,7 @@ cperf_pmd_cyclecount_test_free(struct > cperf_pmd_cyclecount_ctx *ctx) > if (!ctx) > return; >=20 > - if (ctx->sess) { > + if (ctx->sess !=3D NULL && ctx->sess_owner) { > #ifdef RTE_LIB_SECURITY > if (ctx->options->op_type =3D=3D CPERF_PDCP || > ctx->options->op_type =3D=3D CPERF_DOCSIS) { > @@ -89,7 +90,8 @@ cperf_pmd_cyclecount_test_constructor(struct > rte_mempool *sess_mp, > uint8_t dev_id, uint16_t qp_id, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > - const struct cperf_op_fns *op_fns) > + const struct cperf_op_fns *op_fns, > + void **sess) > { > struct cperf_pmd_cyclecount_ctx *ctx =3D NULL; >=20 > @@ -112,10 +114,17 @@ 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, dev_id, options, > - test_vector, iv_offset); > - if (ctx->sess =3D=3D NULL) > - goto err; > + if (*sess !=3D NULL) { > + ctx->sess =3D *sess; > + ctx->sess_owner =3D false; > + } else { > + ctx->sess =3D op_fns->sess_create(sess_mp, dev_id, options, > test_vector, > + iv_offset); > + if (ctx->sess =3D=3D NULL) > + goto err; > + *sess =3D ctx->sess; > + ctx->sess_owner =3D true; > + } >=20 > if (cperf_alloc_common_memory(options, test_vector, dev_id, qp_id, > 0, > &ctx->src_buf_offset, &ctx->dst_buf_offset, diff --git > a/app/test-crypto-perf/cperf_test_pmd_cyclecount.h b/app/test-crypto- > perf/cperf_test_pmd_cyclecount.h > index beb4419910..417fdbbed4 100644 > --- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.h > +++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.h > @@ -22,7 +22,8 @@ cperf_pmd_cyclecount_test_constructor( > uint16_t qp_id, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > - const struct cperf_op_fns *ops_fn); > + const struct cperf_op_fns *ops_fn, > + void **sess); >=20 > int > cperf_pmd_cyclecount_test_runner(void *test_ctx); diff --git a/app/test- > crypto-perf/cperf_test_throughput.c b/app/test-crypto- > perf/cperf_test_throughput.c > index c0891e7c99..54f2f6a060 100644 > --- a/app/test-crypto-perf/cperf_test_throughput.c > +++ b/app/test-crypto-perf/cperf_test_throughput.c > @@ -21,6 +21,7 @@ struct cperf_throughput_ctx { > struct rte_mempool *pool; >=20 > void *sess; > + uint8_t sess_owner; >=20 > cperf_populate_ops_t populate_ops; >=20 > @@ -36,7 +37,7 @@ cperf_throughput_test_free(struct > cperf_throughput_ctx *ctx) { > if (!ctx) > return; > - if (ctx->sess) { > + if (ctx->sess !=3D NULL && ctx->sess_owner) { > if (ctx->options->op_type =3D=3D CPERF_ASYM_MODEX) > rte_cryptodev_asym_session_free(ctx->dev_id, > (void *)ctx->sess); > @@ -63,7 +64,8 @@ cperf_throughput_test_constructor(struct > rte_mempool *sess_mp, > uint8_t dev_id, uint16_t qp_id, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > - const struct cperf_op_fns *op_fns) > + const struct cperf_op_fns *op_fns, > + void **sess) > { > struct cperf_throughput_ctx *ctx =3D NULL; >=20 > @@ -82,10 +84,17 @@ 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, dev_id, options, > - test_vector, iv_offset); > - if (ctx->sess =3D=3D NULL) > - goto err; > + if (*sess !=3D NULL) { > + ctx->sess =3D *sess; > + ctx->sess_owner =3D false; > + } else { > + ctx->sess =3D op_fns->sess_create(sess_mp, dev_id, options, > test_vector, > + iv_offset); > + if (ctx->sess =3D=3D NULL) > + goto err; > + *sess =3D ctx->sess; > + ctx->sess_owner =3D true; > + } >=20 > if (cperf_alloc_common_memory(options, test_vector, dev_id, qp_id, > 0, > &ctx->src_buf_offset, &ctx->dst_buf_offset, diff --git > a/app/test-crypto-perf/cperf_test_throughput.h b/app/test-crypto- > perf/cperf_test_throughput.h > index 439ec8e559..d9011b6a51 100644 > --- a/app/test-crypto-perf/cperf_test_throughput.h > +++ b/app/test-crypto-perf/cperf_test_throughput.h > @@ -22,7 +22,8 @@ cperf_throughput_test_constructor( > uint16_t qp_id, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > - const struct cperf_op_fns *ops_fn); > + const struct cperf_op_fns *ops_fn, > + void **sess); >=20 > int > cperf_throughput_test_runner(void *test_ctx); diff --git a/app/test-cryp= to- > perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c > index 222c7a1cd8..7f6a244794 100644 > --- a/app/test-crypto-perf/cperf_test_verify.c > +++ b/app/test-crypto-perf/cperf_test_verify.c > @@ -21,6 +21,7 @@ struct cperf_verify_ctx { > struct rte_mempool *pool; >=20 > void *sess; > + uint8_t sess_owner; >=20 > cperf_populate_ops_t populate_ops; >=20 > @@ -41,7 +42,7 @@ cperf_verify_test_free(struct cperf_verify_ctx *ctx) > if (ctx =3D=3D NULL) > return; >=20 > - if (ctx->sess !=3D NULL) { > + if (ctx->sess !=3D NULL && ctx->sess_owner) { > if (ctx->options->op_type =3D=3D CPERF_ASYM_MODEX) > rte_cryptodev_asym_session_free(ctx->dev_id, ctx- > >sess); #ifdef RTE_LIB_SECURITY @@ -67,7 +68,8 @@ > cperf_verify_test_constructor(struct rte_mempool *sess_mp, > uint8_t dev_id, uint16_t qp_id, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > - const struct cperf_op_fns *op_fns) > + const struct cperf_op_fns *op_fns, > + void **sess) > { > struct cperf_verify_ctx *ctx =3D NULL; >=20 > @@ -86,10 +88,17 @@ 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, dev_id, options, > - test_vector, iv_offset); > - if (ctx->sess =3D=3D NULL) > - goto err; > + if (*sess !=3D NULL) { > + ctx->sess =3D *sess; > + ctx->sess_owner =3D false; > + } else { > + ctx->sess =3D op_fns->sess_create(sess_mp, dev_id, options, > + test_vector, iv_offset); > + if (ctx->sess =3D=3D NULL) > + goto err; > + *sess =3D ctx->sess; > + ctx->sess_owner =3D true; > + } >=20 > if (cperf_alloc_common_memory(options, test_vector, dev_id, qp_id, > 0, > &ctx->src_buf_offset, &ctx->dst_buf_offset, diff --git > a/app/test-crypto-perf/cperf_test_verify.h b/app/test-crypto- > perf/cperf_test_verify.h > index 9f70ad87ba..dcc10e6e98 100644 > --- a/app/test-crypto-perf/cperf_test_verify.h > +++ b/app/test-crypto-perf/cperf_test_verify.h > @@ -22,7 +22,8 @@ cperf_verify_test_constructor( > uint16_t qp_id, > const struct cperf_options *options, > const struct cperf_test_vector *test_vector, > - const struct cperf_op_fns *ops_fn); > + const struct cperf_op_fns *ops_fn, > + void **sess); >=20 > int > cperf_verify_test_runner(void *test_ctx); diff --git a/app/test-crypto- > perf/main.c b/app/test-crypto-perf/main.c index 40c0b4b54f..312c9dcc96 > 100644 > --- a/app/test-crypto-perf/main.c > +++ b/app/test-crypto-perf/main.c > @@ -647,6 +647,9 @@ main(int argc, char **argv) >=20 > i =3D 0; > uint8_t qp_id =3D 0, cdev_index =3D 0; > + > + void *sess =3D NULL; > + > RTE_LCORE_FOREACH_WORKER(lcore_id) { >=20 > if (i =3D=3D total_nb_qps) > @@ -663,14 +666,30 @@ main(int argc, char **argv) > ctx[i] =3D cperf_testmap[opts.test].constructor( > session_pool_socket[socket_id].sess_mp, > cdev_id, qp_id, > - &opts, t_vec, &op_fns); > + &opts, t_vec, &op_fns, &sess); > + > + /* > + * If sess was NULL, the constructor will have set it to a newly > + * created session. This means future calls to constructors will > + * provide this session, sharing it across all qps. If session > + * sharing is not enabled, re-set sess to NULL, to prevent this. > + */ > + if (!opts.shared_session) > + sess =3D NULL; > + > if (ctx[i] =3D=3D NULL) { > RTE_LOG(ERR, USER1, "Test run constructor > failed\n"); > goto err; > } > + > qp_id =3D (qp_id + 1) % opts.nb_qps; > - if (qp_id =3D=3D 0) > + if (qp_id =3D=3D 0) { > cdev_index++; > + /* If next qp is on a new cdev, don't share the session > + * - it shouldn't be shared across different cdevs. > + */ > + sess =3D NULL; > + } > i++; > } >=20 > -- > 2.34.1 Would be good to add a doc update too. Thanks. Acked-by: Brian Dooley