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 518EDA0548 for ; Sun, 28 Nov 2021 16:01:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B30B42761; Sun, 28 Nov 2021 16:01:24 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2078.outbound.protection.outlook.com [40.107.94.78]) by mails.dpdk.org (Postfix) with ESMTP id ED6DE4275B for ; Sun, 28 Nov 2021 16:01:21 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hysRnxqDlJ7zxTM2NKfQZe8/F0b/Uuns0VAxbDR//9CYteP/mPWwg7dPqBia+ZHZPc5S238lX3Nvr1fFVdiYPryya7ThazHJBc5ZUwKFJSWTIhCO/QgOUWaVIjv6F2s+nx8JspaY6bOP9sjHt9t6WUapKL65hJuvuw+FvazoZgzgW/p08iLF+WNZDZ0c1s3YO8teucFLmbpN2yQO/tCATZNhLCeD4BV+yfhnoIc8+u5IYSYORUIjG4TSNJCM7bb3NwyvfThGFPyr0wbewYbZ2QZvLJK1RIEwRGecbMJwuoA/o3iLgqmOPNNvuk1/xlhkgJ6i4isaH1IaxaPiqrbBXw== 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=gvBVLXkLDQy+D94lPpvQOCfI4XQnoCl7FIOoyrCxzCc=; b=k+ou3FYMzzefsh2OPu/9jxqHOSpDosJ0WWby3YHRisTklNq2MfHioCTXtIS0YhC2kArwlJh53ATUtisB/9lbBFZRvj1JYoF/FQU/WKUzVPMaMqGowKxB66PF75FvJhH/hPMzy+2IYWQh3yyPJk30S10l1L8lVGbmlbsUeB73QMhfUYF8U8pN336/RV7lTp2T4/+HD8X6mM4ICrPn0CYVtQIK+fZa8U8daILOQWNDTDucOwzJzDKDmazWNRoQjEPnwc4fKtbif9FLPy/MOxB7qNJzFokBU4TnJfa38h7hTaXK4Ze/yst2ZwNZ4+89JpeyuVGmlo0zrX/+B8dyaBr1BA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.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=gvBVLXkLDQy+D94lPpvQOCfI4XQnoCl7FIOoyrCxzCc=; b=pvO6RmAAzu4L1gsWChUHtTSvtTsaKdqvrvxMEGEUg+NswXHHFXe+Oe1fPgX47GCF7xadARRARi/WF+JIwD+H2eSimpAhEa6f73TxFaTwQngBYIXNYIHEb0UsJQ30EqTaGwJYA++YwNgmhh9JVRXsWwXawBRm6uhw99DXz5UbP2eWkzVISF0oFK23U/aPhKTMEqTTa53X8oiHfJHTm2CXsRAOqmxOaLWDu6S+ieC/7vlZF8TlbKbRkD8h5glKVaWJHDojNLw8J9uYTyNNOBiWJJZ6MbhUd/IyayudYMZWEEQMHijBRtoDRZJhRREIcNcTQ4NLVxlpDqKfhp45OYEyCw== Received: from BN6PR13CA0058.namprd13.prod.outlook.com (2603:10b6:404:11::20) by CH2PR12MB3685.namprd12.prod.outlook.com (2603:10b6:610:2d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.19; Sun, 28 Nov 2021 15:01:19 +0000 Received: from BN8NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:404:11:cafe::b3) by BN6PR13CA0058.outlook.office365.com (2603:10b6:404:11::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.9 via Frontend Transport; Sun, 28 Nov 2021 15:01:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) 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.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 BN8NAM11FT064.mail.protection.outlook.com (10.13.176.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4734.22 via Frontend Transport; Sun, 28 Nov 2021 15:01:19 +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; Sun, 28 Nov 2021 15:01:04 +0000 From: Xueming Li To: Pablo de Lara CC: Luca Boccassi , Ciara Power , "Fan Zhang" , dpdk stable Subject: patch 'crypto/ipsec_mb: fix cipher key setting' has been queued to stable release 20.11.4 Date: Sun, 28 Nov 2021 22:54:01 +0800 Message-ID: <20211128145423.3974892-58-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211128145423.3974892-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> <20211128145423.3974892-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: 8c070614-0e93-46c5-4530-08d9b27fef3e X-MS-TrafficTypeDiagnostic: CH2PR12MB3685: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bxN3ByIByAs3xyBd2tcuc3cGHHvZbqAL+DqdSBuMPeeG39utmEOOgsytHb/TRrqXFLq2hEXF1iQMzhvj/1GXOzNQYWGAhyvcjxnK9O3154KjWU+7ayU5kJlMg/LFWGbwguMBRs+B2OdLofvnCvqOlw9/czwdHzKec8nMNCEMIkFS3ZsjkVA7vTZNqiJ59pjshSM5kGSINyqwhJe5FE51nDPCZcqyOxyQyrFh5jhL94+9zWRGO0HcLAwansWR7BqUdw0u2UD2SAS3bRDl+FNunbMYkujpaVQ1Vwlhwk/AWRESCJibDXarujzFk6ojPPK8diJzD5nCvHXB+aS3U0cDHgW7zrfvm2+w8NtLocTULwZd847rWYWMc7jaYhSgImQWDEBAXoWX4gmx1nTO3h1QH25zlJNPVGLKryTtk49qGXvbB1GOA3pF/+7QhdGZQnCbxJ3ybJDSQ7b+1xHR4FckX97xvFOahvk/udqJncxOy7Tbet9i+TG0pT4W8I9kdx0fnmKdUFvmJCJh8dQ0TxzJq/8DnKZLNIZjUcLamYLj8lp8c2whf4iDUN1c9gIm+fazxe6pADOvyl++wbyyAVUVBLsuh0cyw+uencj2u3dV6Cn8HTzqyGlgecRGSBV6xtaA+6BKJyJQtQ+TgkSQ7JM+rq+vX8dgr+9lVRlQpUem7yEELySE7Vb7qzjHpp6ny/Sh8zS/R2lqjHMucQ3E6yXFqYM1A7W6mgLu7Pt1fuKIEN5SYlJKdJbPgvxT/7Y6KnIZLtMbWmK081rYfQWGqhK+B3DMJTOIa3KUmKIyGyIhVBbKCmakCtDtgn96uS9SZd/KI81P4NOV8CX5oyQHLoRc4g== 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)(54906003)(966005)(86362001)(70206006)(47076005)(53546011)(7696005)(70586007)(356005)(5660300002)(186003)(8676002)(36860700001)(426003)(336012)(6916009)(16526019)(508600001)(7636003)(83380400001)(316002)(26005)(6286002)(36756003)(4001150100001)(55016003)(2906002)(82310400004)(8936002)(6666004)(4326008)(1076003)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2021 15:01:19.2383 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c070614-0e93-46c5-4530-08d9b27fef3e 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: BN8NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3685 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 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/30/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/6096e4200509865f35a2cf9383da0af76bc68aff Thanks. Xueming Li --- >From 6096e4200509865f35a2cf9383da0af76bc68aff Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Mon, 22 Nov 2021 17:47:29 +0000 Subject: [PATCH] crypto/ipsec_mb: fix cipher key setting Cc: Xueming Li [ upstream commit b0a37e8cd2ac559202086d88c1761e0b6406b445 ] When authenticating with SNOW3G, KASUMI and ZUC, the pointers for encryption/decryption keys is not set. If a cipher algorithm such as AES-CBC is also used, the application would seg fault. Hence, these pointers should be set to some value by default. Command line to replicate the issue: ./build/app/dpdk-test-crypto-perf -l 4,5 -n 6 --vdev="crypto_aesni_mb" -- \ --devtype="crypto_aesni_mb" --optype=cipher-then-auth --auth-algo \ snow3g-uia2 --auth-key-sz 16 --auth-iv-sz 16 --digest-sz 4 --silent \ --total-ops 1000000 --auth-op generate --burst-sz 32 \ --cipher-algo aes-ctr --cipher-key-sz 16 --cipher-iv-sz 16 Fixes: ae8e085c608d ("crypto/aesni_mb: support KASUMI F8/F9") Fixes: 6c42e0cf4d12 ("crypto/aesni_mb: support SNOW3G-UEA2/UIA2") Fixes: fd8df85487c4 ("crypto/aesni_mb: support ZUC-EEA3/EIA3") Signed-off-by: Pablo de Lara Acked-by: Ciara Power Acked-by: Fan Zhang --- drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index 03186485f9..6e14788fd0 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -1267,6 +1267,14 @@ set_mb_job_params(JOB_AES_HMAC *job, struct aesni_mb_qp *qp, const int aead = is_aead_algo(job->hash_alg, job->cipher_mode); + if (job->cipher_mode == IMB_CIPHER_DES3) { + job->enc_keys = session->cipher.exp_3des_keys.ks_ptr; + job->dec_keys = session->cipher.exp_3des_keys.ks_ptr; + } else { + job->enc_keys = session->cipher.expanded_aes_keys.encode; + job->dec_keys = session->cipher.expanded_aes_keys.decode; + } + switch (job->hash_alg) { case AES_XCBC: job->u.XCBC._k1_expanded = session->auth.xcbc.k1_expanded; @@ -1339,17 +1347,6 @@ set_mb_job_params(JOB_AES_HMAC *job, struct aesni_mb_qp *qp, job->u.HMAC._hashed_auth_key_xor_ipad = session->auth.pads.inner; job->u.HMAC._hashed_auth_key_xor_opad = session->auth.pads.outer; - if (job->cipher_mode == DES3) { - job->aes_enc_key_expanded = - session->cipher.exp_3des_keys.ks_ptr; - job->aes_dec_key_expanded = - session->cipher.exp_3des_keys.ks_ptr; - } else { - job->aes_enc_key_expanded = - session->cipher.expanded_aes_keys.encode; - job->aes_dec_key_expanded = - session->cipher.expanded_aes_keys.decode; - } } if (aead) -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-28 22:41:06.220130340 +0800 +++ 0057-crypto-ipsec_mb-fix-cipher-key-setting.patch 2021-11-28 22:41:03.393539652 +0800 @@ -1 +1 @@ -From b0a37e8cd2ac559202086d88c1761e0b6406b445 Mon Sep 17 00:00:00 2001 +From 6096e4200509865f35a2cf9383da0af76bc68aff Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit b0a37e8cd2ac559202086d88c1761e0b6406b445 ] @@ -22 +24,0 @@ -Cc: stable@dpdk.org @@ -28,2 +30,2 @@ - drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) + drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 19 ++++++++----------- + 1 file changed, 8 insertions(+), 11 deletions(-) @@ -31,5 +33,5 @@ -diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c -index e05bc04c3b..a308d42ffa 100644 ---- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c -+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c -@@ -1120,6 +1120,14 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp, +diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +index 03186485f9..6e14788fd0 100644 +--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c ++++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +@@ -1267,6 +1267,14 @@ set_mb_job_params(JOB_AES_HMAC *job, struct aesni_mb_qp *qp, @@ -48 +50 @@ - case IMB_AUTH_AES_XCBC: + case AES_XCBC: @@ -50,3 +52,3 @@ -@@ -1189,13 +1197,6 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp, - job->u.HMAC._hashed_auth_key_xor_opad = - session->auth.pads.outer; +@@ -1339,17 +1347,6 @@ set_mb_job_params(JOB_AES_HMAC *job, struct aesni_mb_qp *qp, + job->u.HMAC._hashed_auth_key_xor_ipad = session->auth.pads.inner; + job->u.HMAC._hashed_auth_key_xor_opad = session->auth.pads.outer; @@ -54,3 +56,5 @@ -- if (job->cipher_mode == IMB_CIPHER_DES3) { -- job->enc_keys = session->cipher.exp_3des_keys.ks_ptr; -- job->dec_keys = session->cipher.exp_3des_keys.ks_ptr; +- if (job->cipher_mode == DES3) { +- job->aes_enc_key_expanded = +- session->cipher.exp_3des_keys.ks_ptr; +- job->aes_dec_key_expanded = +- session->cipher.exp_3des_keys.ks_ptr; @@ -58,2 +62,4 @@ -- job->enc_keys = session->cipher.expanded_aes_keys.encode; -- job->dec_keys = session->cipher.expanded_aes_keys.decode; +- job->aes_enc_key_expanded = +- session->cipher.expanded_aes_keys.encode; +- job->aes_dec_key_expanded = +- session->cipher.expanded_aes_keys.decode;