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 A2C66A034F for ; Wed, 10 Nov 2021 07:57:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B89B410FE; Wed, 10 Nov 2021 07:57:43 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2081.outbound.protection.outlook.com [40.107.102.81]) by mails.dpdk.org (Postfix) with ESMTP id 14FFB41103 for ; Wed, 10 Nov 2021 07:57:42 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d2R8htyUtHk/uQveLz0G8NGwRP5YXE6vGkcO5diSQpQtOeTQfZkRpmdeJVrxGrXlQ8uJtggniij4op0GUesJ6Ss16u+yNIBfJtaTYdyU1UQxfe+U2aCvhSJG22QPu2iLOx90GgiVfFJIiIDcjRVMhhkBTCexZkrFunwKuaG4mw6IfjAsknlEocPG8RaTNbNZcUahuEJocnzRuISbOzQY/TDL7ktQ8vjmCZ1r4G1DO6As/0zCIZuR9/rltMkUrwGqobfhXBsPwFqmuDT0gKZWl9tVebflzLipWVUm/YaCJxoRDwxvw+6reGa9Npr++tfhDlYA95F3r4+JtXCtpMRO5A== 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=Ru2pQUpPv4p2W2sUvLAuqS0iFUn0miwynGzDDHXCPT8=; b=CorBiRc8do00fixZ8caAL6mbskqTchdmxLnqD+Zknr3NH7Fg4eM6R0kLVj25OtljANRijjsclAjpufP0606WwT8tfBZuKMqf7I89BVtUGItH0Ys8ZJy7FGUqAa4vYisIuTGxgg+gS3hpMG9fZfREDCyRG5w+p/G+8GdYqluNhfFFJ3IGBqZXxt0s8OQ/DjryFqc8HZkXm3PwEZtcNA+XyqbZHKtrhzyxVf9ABcsXlnqbPGglxp833mOiD+O2kTak2uhYPKFwZU1w59OAHMG9Kg7xn/ECA7aA4Sk1AGZqnddoPDW/rv1gnKF4Vj/uLMBxXXqVSnGc/tAVtXI4nzFyqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=Ru2pQUpPv4p2W2sUvLAuqS0iFUn0miwynGzDDHXCPT8=; b=WpGXwwDfHK0T/q+AloUQ+dDysMQrQzTcROrcrcpB3D9OyrJ6OpmAkmK6m3xdSQTU9R4+MmIylaPMv6SG4FcG2GBp9swTWbMjLLZG4HyhkDmEvs35ALZNgZJeCBX553zBt+0ydDewRhPxv9/CZhfkubwD9zOSA1acEr18b2QcP7HQiMYqglJa57DZKap92evjGrR8D8XJIelRcSxSwe37nrmjSmDXrfdx45PejUQGB2qoFm8GPIVyCVmx+vTe82uW1F/KC7Bxi4UiMIva3CMCyQW3rhEgUll3eYG/R6gQWHyZjOa+zCyiZ3+0MjchQrpu9MYXq+dbVo8mgpNu7xWZ2Q== Received: from DM5PR07CA0119.namprd07.prod.outlook.com (2603:10b6:4:ae::48) by DM6PR12MB3787.namprd12.prod.outlook.com (2603:10b6:5:1c1::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 06:57:39 +0000 Received: from DM6NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ae:cafe::3) by DM5PR07CA0119.outlook.office365.com (2603:10b6:4:ae::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:57:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT051.mail.protection.outlook.com (10.13.172.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:57:39 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:57:33 +0000 From: Xueming Li To: Kai Ji CC: Luca Boccassi , Akhil Goyal , dpdk stable Date: Wed, 10 Nov 2021 14:31:52 +0800 Message-ID: <20211110063216.2744012-229-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 956800ad-a399-438a-4797-08d9a417629d X-MS-TrafficTypeDiagnostic: DM6PR12MB3787: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +MwS3KTZ7MHTsjMewlYPgLXcSf2R6MMAAQ4OrQIwsA6j54NfSTi4jefvoqJI3nW2/+YQdMsVZJjII+c2w77yuWWhYc/po+RZGb/OUicSISKAWN9QFzLjAmK5hTZNndKYzmcZeE9Usf0Lj+F4XMg99RSDwaC+FnsevZQlG20f3Iecd7O/YbXU7k1BBaisIFlt0bpbHMkvYiUTtIQswEYHsTeH1RwWWR6GHmxg4zaOGuQI6M6ONyw+1sF2HNybmwST+vZvSaS+WVUSZ8DsVk42cMN+Bqnq1CZ3iPY+KdWOuny53t3D6kfXokgInYVihOikR6tAP08ci4tQImjTWAqkDF4gUiktH6/ucdvRvoJbTGq2945laCpoFeX/aoCHYHk8SGlqsSRrV/1Icj0Y6zF7keCd3lYncwH1SHnrHSF+rQ4BTZ1U+CcNQVNBw5L1Ngi2niDb9AHxLAfBdxhJbmbPDkDB9LDf6nVIzbkuZGXWuRFa6KQxCL+r63WHodZweqrqZxkkWji35FrOkzn5KE9SUcYVIRKQGK1XYsg4lHRlzHioBR9ctpmEX1gTkFEkLxwH+iupP407MLlkhyqoggK6MNUw6tUwSue7Js0XuJXEZ1Uc1q3/u36uJICebUR3uqbMEmOr33CU6MaqRa4HwcGbM0uLMxb2S9ZBf8TZiFrM3dvwTDgH+NpHxZgZOmcp/6g+6sFQV29kwe0jwk4MLXZaKgl7a3bA6qG2qvtPzHd6VriAo7P306lqwtBxVDRXl7oPOo8yrgEHGYfUijMp8ulTW0L525kZdvEEIrnCXSkmg041W9fDGBSnd583v6OGpP4uYvtLet6Qyhnt32N2zZa+tg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(508600001)(86362001)(6666004)(966005)(2616005)(26005)(6286002)(4326008)(70586007)(53546011)(7696005)(8676002)(82310400003)(336012)(55016002)(316002)(16526019)(186003)(47076005)(70206006)(1076003)(36756003)(6916009)(8936002)(36860700001)(4001150100001)(5660300002)(356005)(54906003)(83380400001)(426003)(2906002)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:57:39.4194 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 956800ad-a399-438a-4797-08d9a417629d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3787 Subject: [dpdk-stable] patch 'test/crypto: fix max length for raw data path' has been queued to stable release 20.11.4 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. 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://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/1ce38454223d075dc9ad3ca64b18e337db92e07f Thanks. Xueming Li --- >From 1ce38454223d075dc9ad3ca64b18e337db92e07f Mon Sep 17 00:00:00 2001 From: Kai Ji Date: Fri, 8 Oct 2021 12:33:45 +0100 Subject: [PATCH] test/crypto: fix max length for raw data path Cc: Xueming Li [ upstream commit 6d4c594e46529b6243f851b3a5e682b88829f3b3 ] Update the calculation of the max length needed when converting mbuf to data vec in partial digest test case. This update make sure the enough vec buffers are allocated for the appended digest in sgl op for raw datapath api. Fixes: 4868f6591c6f ("test/crypto: add cases for raw datapath API") Signed-off-by: Kai Ji Acked-by: Akhil Goyal --- app/test/test_cryptodev.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index dd2b035b77..4772eea30c 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -178,6 +178,10 @@ post_process_raw_dp_op(void *user_data, uint32_t index __rte_unused, RTE_CRYPTO_OP_STATUS_ERROR; } +static struct crypto_testsuite_params testsuite_params = { NULL }; +struct crypto_testsuite_params *p_testsuite_params = &testsuite_params; +static struct crypto_unittest_params unittest_params; + void process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, struct rte_crypto_op *op, uint8_t is_cipher, uint8_t is_auth, @@ -192,6 +196,7 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, struct rte_crypto_sgl sgl; uint32_t max_len; union rte_cryptodev_session_ctx sess; + uint64_t auth_end_iova; uint32_t count = 0; struct rte_crypto_raw_dp_ctx *ctx; uint32_t cipher_offset = 0, cipher_len = 0, auth_offset = 0, @@ -201,6 +206,8 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, int ctx_service_size; int32_t status = 0; int enqueue_status, dequeue_status; + struct crypto_unittest_params *ut_params = &unittest_params; + int is_sgl = sop->m_src->nb_segs > 1; ctx_service_size = rte_cryptodev_get_raw_dp_ctx_size(dev_id); if (ctx_service_size < 0) { @@ -266,6 +273,28 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, digest.va = (void *)sop->auth.digest.data; digest.iova = sop->auth.digest.phys_addr; + if (is_sgl) { + uint32_t remaining_off = auth_offset + auth_len; + struct rte_mbuf *sgl_buf = sop->m_src; + + while (remaining_off >= rte_pktmbuf_data_len(sgl_buf) + && sgl_buf->next != NULL) { + remaining_off -= rte_pktmbuf_data_len(sgl_buf); + sgl_buf = sgl_buf->next; + } + + auth_end_iova = (uint64_t)rte_pktmbuf_iova_offset( + sgl_buf, remaining_off); + } else { + auth_end_iova = rte_pktmbuf_iova(op->sym->m_src) + + auth_offset + auth_len; + } + /* Then check if digest-encrypted conditions are met */ + if ((auth_offset + auth_len < cipher_offset + cipher_len) && + (digest.iova == auth_end_iova) && is_sgl) + max_len = RTE_MAX(max_len, auth_offset + auth_len + + ut_params->auth_xform.auth.digest_length); + } else if (is_cipher) { cipher_offset = sop->cipher.data.offset; cipher_len = sop->cipher.data.length; @@ -488,9 +517,6 @@ process_crypto_request(uint8_t dev_id, struct rte_crypto_op *op) return op; } -static struct crypto_testsuite_params testsuite_params = { NULL }; -static struct crypto_unittest_params unittest_params; - static int testsuite_setup(void) { -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:11.958440160 +0800 +++ 0228-test-crypto-fix-max-length-for-raw-data-path.patch 2021-11-10 14:17:02.060744536 +0800 @@ -1 +1 @@ -From 6d4c594e46529b6243f851b3a5e682b88829f3b3 Mon Sep 17 00:00:00 2001 +From 1ce38454223d075dc9ad3ca64b18e337db92e07f Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 6d4c594e46529b6243f851b3a5e682b88829f3b3 ] @@ -12 +14,0 @@ -Cc: stable@dpdk.org @@ -17,2 +19,2 @@ - app/test/test_cryptodev.c | 33 +++++++++++++++++++++++++++++---- - 1 file changed, 29 insertions(+), 4 deletions(-) + app/test/test_cryptodev.c | 32 +++++++++++++++++++++++++++++--- + 1 file changed, 29 insertions(+), 3 deletions(-) @@ -21 +23 @@ -index 814a0b401d..f5f82abbd7 100644 +index dd2b035b77..4772eea30c 100644 @@ -24 +26 @@ -@@ -179,6 +179,10 @@ post_process_raw_dp_op(void *user_data, uint32_t index __rte_unused, +@@ -178,6 +178,10 @@ post_process_raw_dp_op(void *user_data, uint32_t index __rte_unused, @@ -35,2 +37,2 @@ -@@ -193,6 +197,7 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, - struct rte_crypto_sgl sgl, dest_sgl; +@@ -192,6 +196,7 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, + struct rte_crypto_sgl sgl; @@ -43 +45 @@ -@@ -202,6 +207,8 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, +@@ -201,6 +206,8 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, @@ -52 +54 @@ -@@ -267,6 +274,28 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, +@@ -266,6 +273,28 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, @@ -81 +83 @@ -@@ -503,10 +532,6 @@ process_crypto_request(uint8_t dev_id, struct rte_crypto_op *op) +@@ -488,9 +517,6 @@ process_crypto_request(uint8_t dev_id, struct rte_crypto_op *op) @@ -86 +87,0 @@ --struct crypto_testsuite_params *p_testsuite_params = &testsuite_params;