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 E17F541D8C for ; Mon, 27 Feb 2023 08:02:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD7F240A84; Mon, 27 Feb 2023 08:02:21 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2081.outbound.protection.outlook.com [40.107.244.81]) by mails.dpdk.org (Postfix) with ESMTP id 7E544410EE for ; Mon, 27 Feb 2023 08:02:20 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NedGdtZfIW2OdiFoygXuJedlpDuUU0U0vxfH8DRKvSITgQZtbWFS7CBL4u3VI9oz39ArKNwzM9qDZXDMilhOHhgiZlc9RKprpm3Jgsna/6kUzPR44zPpqrUj2EEKSDbwJAAGadtcwT69p3xiKLPyieKi53+d8i38PJXmgnu5XmdB0yxWkBynmlRHPOAfx4EfW64c+7BLhpNiZ685nmi0PqZhYuLuW3827dldJqbAjFYRN4V9t8oIkCEYxUnpla/AIKtd6cDJelDCr8pKuHpU8PHTRRcL6AOxPSpu4J7ZUgQ3AW3IXuh8Uu1Z9zuUqGp6jOJxmZj4iX1eumSwZFjvow== 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=Ny4PNGglEPT+n/owZsNfjkBlPym1ej4YIeBn4Zyu0CI=; b=JKeXF9meKWzO2ND8FUn+Mn4P8E7o4MkC5vlgfTlz2g9/ewFFVu61KudKOKB0lijSDCS4hIpa4SxuHNIq0sDOD2oS4O6fkh7zanWp14xtPfOtJYReR0PgnRJz1yQev2nKvxY3kGtpNhTPoq6SuAm/RjCInoSHm+UZUbcz1BOTAv6BcrYLX63jEZb9PD4O15gC7mOO8imAW9CrVk8hKnaUthDPa8lnLXNA+zgYxvlB8i5Q35Rzt72UDsjrA8Zygwk0oWNOnCRRdV8bBKZcwW3u5JzdNOCjMgGnidujXzbyzDxsj6RP0Cj8vAuW89zSzumwVMtM80Z6P17oE+/pNAtlSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ny4PNGglEPT+n/owZsNfjkBlPym1ej4YIeBn4Zyu0CI=; b=JQ3Orbqm6MJaODlzOgTfuB/hhzrNAItD9qdcJgRk5pAjnBOwFVZaFV2LCqJcLr8pGKU4x667BvpXH9t/tod0D/Ndc7scj6Q4fyNqIx1cbCRI/94a9zz/aoOipQ355m7w5v93iY9FYIJ6PGBewSqXJwMho2PUMd76MHNb6Thm4cLpU0cP83kH+A2honuuA813hN4NRDIHuQ787ESnUovU+8tipB+QF1qEWp9KXyw4mjb+ycgeJU7klZx8Vo9l0FuqoHJ9k2j71W0+mHIK9BnlAjLhpGG+4MA7qSz0/d9VD9ozHgy6oAjS6yC6OSCgbfuVjT7RaySg04+saiMTbl8dpw== Received: from MN2PR16CA0004.namprd16.prod.outlook.com (2603:10b6:208:134::17) by BL0PR12MB4882.namprd12.prod.outlook.com (2603:10b6:208:1c3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29; Mon, 27 Feb 2023 07:02:18 +0000 Received: from BL02EPF000108E9.namprd05.prod.outlook.com (2603:10b6:208:134:cafe::c6) by MN2PR16CA0004.outlook.office365.com (2603:10b6:208:134::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29 via Frontend Transport; Mon, 27 Feb 2023 07:02:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF000108E9.mail.protection.outlook.com (10.167.241.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.12 via Frontend Transport; Mon, 27 Feb 2023 07:02:18 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 26 Feb 2023 23:02:06 -0800 Received: from nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 26 Feb 2023 23:02:03 -0800 From: Xueming Li To: Anoob Joseph CC: Akhil Goyal , dpdk stable Subject: patch 'app/crypto-perf: fix session freeing' has been queued to stable release 22.11.2 Date: Mon, 27 Feb 2023 14:58:37 +0800 Message-ID: <20230227070107.15664-9-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227070107.15664-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230227070107.15664-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000108E9:EE_|BL0PR12MB4882:EE_ X-MS-Office365-Filtering-Correlation-Id: d658bca4-7c30-406a-9da1-08db189090ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MjmxYgjYbcnPH2uu0WY587+DCvYqqELPzAK2dVrzOABf8PTIcX2aAzZsWCmIf3nqdxKIki9NEaZiDFrtJ+DEno8ytvvrpq6KBDDHOINGHjGZ9+++LPV2mMMSfjYA9ik4TH5uB0izfx37l6AmFW/Cc5X5MXyq3DtUlKwSBsCPdBTGKYuC1hwNjrne/xpa3Ipev9B/Dxt3OvgUEjt3mSKKnjK6qZ49qcx5ENy90fy89UIo47dlSBI3WwGQ8PslMWUWUcPGuopLuHlMaqYM05BQlwUQAyhG98QVvbpKrn7+kD72Vs+B9XTuMJDnYd4mToJZnPJRXDgoj/RSVIX4mdPtP8ZXjl1HjM2smvIJ6tipyT3vegYJOqJY5BjiePkN6DSzs4b9jjrIskUZwnX95XJOjs48+PteV/U0xTQyyEUaDdjTLqkiQREyCfAiKANGsqJwb4tSggxtyb9QwdU//NVPLup31+RTEYOo+lc/VJC/8j6FqeWi9C7ahEB2JTqJUMbJySc1vGe3X/BhM5qnH7sEmmzjCrCG4Pdj0FGgN90bS/7Xxi0r1pkMHlnunpyH8CYRUJYprWqPVMR5gLcDfosyQiXCpOPGtQwT1eGBtgQYHXK3g/PZwIPDxcD03ZadQny7iItigByWIp9cO7F61ue1j+n58Lp88XKoJ5bCnfOfJnrScnCZm/ahFhUa94W2UatrUW5rLhLzcHIVEabOd+fSz6gpAeuhZvXvnvmUUjbId3hQndnoq+sVnYpmhdxkdOQ8 X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(346002)(396003)(136003)(376002)(39850400004)(451199018)(46966006)(36840700001)(356005)(336012)(2616005)(86362001)(316002)(966005)(40480700001)(70586007)(70206006)(36756003)(6666004)(55016003)(478600001)(7696005)(54906003)(41300700001)(4326008)(6916009)(53546011)(8676002)(1076003)(6286002)(16526019)(26005)(186003)(7636003)(36860700001)(2906002)(82740400003)(8936002)(47076005)(426003)(83380400001)(5660300002)(82310400005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 07:02:18.4843 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d658bca4-7c30-406a-9da1-08db189090ce X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000108E9.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4882 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/01/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=bbba565c73c986a16612ac45389951fc570fe9cb Thanks. Xueming Li --- >From bbba565c73c986a16612ac45389951fc570fe9cb Mon Sep 17 00:00:00 2001 From: Anoob Joseph Date: Mon, 2 Jan 2023 17:16:53 +0530 Subject: [PATCH] app/crypto-perf: fix session freeing Cc: Xueming Li [ upstream commit c5b531d6ee03e552301aa6295531ae2312a16c6e ] Use the right API for session freeing. Sessions can be asymmetric, symmetric or security. Fixes: 28dde5da503e ("app/crypto-perf: support lookaside IPsec") Fixes: a538d1d2d01e ("test/crypto-perf: extend asymmetric crypto throughput test") Signed-off-by: Anoob Joseph Acked-by: Akhil Goyal --- app/test-crypto-perf/cperf_test_latency.c | 27 +++++++++++++++++------ app/test-crypto-perf/cperf_test_verify.c | 25 ++++++++++++++++----- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c index 49bf421c01..406e082e4e 100644 --- a/app/test-crypto-perf/cperf_test_latency.c +++ b/app/test-crypto-perf/cperf_test_latency.c @@ -43,15 +43,28 @@ struct priv_op_data { static void cperf_latency_test_free(struct cperf_latency_ctx *ctx) { - if (ctx) { - if (ctx->sess) - rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess); - - rte_mempool_free(ctx->pool); + if (ctx == NULL) + return; - rte_free(ctx->res); - rte_free(ctx); + if (ctx->sess != NULL) { + if (ctx->options->op_type == CPERF_ASYM_MODEX) + rte_cryptodev_asym_session_free(ctx->dev_id, ctx->sess); +#ifdef RTE_LIB_SECURITY + else if (ctx->options->op_type == CPERF_PDCP || + ctx->options->op_type == CPERF_DOCSIS || + ctx->options->op_type == CPERF_IPSEC) { + struct rte_security_ctx *sec_ctx = + rte_cryptodev_get_sec_ctx(ctx->dev_id); + rte_security_session_destroy(sec_ctx, ctx->sess); + } +#endif + else + rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess); } + + rte_mempool_free(ctx->pool); + rte_free(ctx->res); + rte_free(ctx); } void * diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c index c03e1d5ba5..8042c94e04 100644 --- a/app/test-crypto-perf/cperf_test_verify.c +++ b/app/test-crypto-perf/cperf_test_verify.c @@ -38,14 +38,27 @@ struct cperf_op_result { static void cperf_verify_test_free(struct cperf_verify_ctx *ctx) { - if (ctx) { - if (ctx->sess) - rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess); - - rte_mempool_free(ctx->pool); + if (ctx == NULL) + return; - rte_free(ctx); + if (ctx->sess != NULL) { + if (ctx->options->op_type == CPERF_ASYM_MODEX) + rte_cryptodev_asym_session_free(ctx->dev_id, ctx->sess); +#ifdef RTE_LIB_SECURITY + else if (ctx->options->op_type == CPERF_PDCP || + ctx->options->op_type == CPERF_DOCSIS || + ctx->options->op_type == CPERF_IPSEC) { + struct rte_security_ctx *sec_ctx = + rte_cryptodev_get_sec_ctx(ctx->dev_id); + rte_security_session_destroy(sec_ctx, ctx->sess); + } +#endif + else + rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess); } + + rte_mempool_free(ctx->pool); + rte_free(ctx); } void * -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-27 14:08:41.320968600 +0800 +++ 0010-app-crypto-perf-fix-session-freeing.patch 2023-02-27 14:08:40.719237000 +0800 @@ -1 +1 @@ -From c5b531d6ee03e552301aa6295531ae2312a16c6e Mon Sep 17 00:00:00 2001 +From bbba565c73c986a16612ac45389951fc570fe9cb Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit c5b531d6ee03e552301aa6295531ae2312a16c6e ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org