From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EF86EA0518 for ; Fri, 24 Jul 2020 14:06:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DAED51C02E; Fri, 24 Jul 2020 14:06:56 +0200 (CEST) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by dpdk.org (Postfix) with ESMTP id 16F6B1C12F for ; Fri, 24 Jul 2020 14:06:55 +0200 (CEST) Received: by mail-wr1-f50.google.com with SMTP id b6so8075000wrs.11 for ; Fri, 24 Jul 2020 05:06:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=icgBGkJvcY7QdbauaYEQOLgDrB62rSlsNhBMWY6PuTM=; b=IQ2U8Vs5S2fM185d/fibRf1UMc8WMPiaamglKXea5ViqU91/aT46eI5b5NOTR600B2 niYFvX1ffo3umNWjya4wVnOMsyTGuyYbltiuwjUedV8PtF3ij7BZbIKGavMUj747Xvik TPBoTLNQwZtzACwdzr5KImJq5bx4lSLV+Sn+uUiQutqgBaiy44KF/xj5ycwKw6RuXe1n /d4+Nkak19zesGEnFUvZp7/m5BBUwmr/xgxZ0WSzRPMdxe9TIwJFPWi54T6zOILPV5GH 4OX1Ym5tUDavhYXfogQtK6omx++t3nX5NUABnWH42nKgo2QUBgbbxNJ5px9njWrNGgmh q8lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=icgBGkJvcY7QdbauaYEQOLgDrB62rSlsNhBMWY6PuTM=; b=f7YP294G8L7UEb6DN2xfQkceGJ5RFzpl73EqlrmuSWwmoCJO+xZZe1YOTA6oPODy7x EjF8hivjyc2GLe6SidqPbHsZaL4k12xzJJ1+KYlqMBsjGWibUVQWW3EPP4UCYspz5Uwu jEo4HL9XTbNVOKxVlwYtU42/jQMGguDANnIT2hXTayQVUef29MNJEYMLvzNShmA6eRGa XwgrlXO/mHeoXJLiFNQOrPtQxy7AcBStA3HfQoGm4anVH8mk9r22Oos1uZoSyl4Mz4Uh j3t95B/clwA80vFsRcCgvl3ic18RVkQCKBdE6AUH2DGH/G0+9q4TJU0LwBWzvhIbK0vN UXSA== X-Gm-Message-State: AOAM532x8eDnbxkJvH09wFbYwBVAfZQx6y//evSUFlrBjYCaUortTWlM fPL87GTO2srJIEzJj1ipxctZ5ZTCB3+/Dw== X-Google-Smtp-Source: ABdhPJxyc6kalfZVCCEkcpmClxKSNvtMBA+9kqzwaNY+Ke4RG0emaBauknWOqAmUm2ef4rwxsAO3tA== X-Received: by 2002:adf:80c7:: with SMTP id 65mr8511377wrl.246.1595592414721; Fri, 24 Jul 2020 05:06:54 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id w2sm1379864wre.5.2020.07.24.05.06.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:06:53 -0700 (PDT) From: luca.boccassi@gmail.com To: Ankur Dwivedi Cc: dpdk stable Date: Fri, 24 Jul 2020 12:58:52 +0100 Message-Id: <20200724120030.1863487-94-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'common/cpt: fix encryption offset' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 19.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 07/26/20. 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. Thanks. Luca Boccassi --- >From 094550b236fd9acc5954a910b5c1ec8e953351d1 Mon Sep 17 00:00:00 2001 From: Ankur Dwivedi Date: Fri, 3 Jul 2020 11:11:37 +0530 Subject: [PATCH] common/cpt: fix encryption offset [ upstream commit 0058f30514f13e5d5412e97973a9c9254e36edb1 ] In case of gmac auth the encryption offset should be set to zero. Fixes: b74652f3a91f ("common/cpt: add microcode interface for encryption") Fixes: 177b41ceee61 ("common/cpt: add microcode interface for decryption") Signed-off-by: Ankur Dwivedi --- drivers/common/cpt/cpt_ucode.h | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h index 9dc0fc652..e92e3678c 100644 --- a/drivers/common/cpt/cpt_ucode.h +++ b/drivers/common/cpt/cpt_ucode.h @@ -718,9 +718,6 @@ cpt_enc_hmac_prep(uint32_t flags, m_vaddr = (uint8_t *)m_vaddr + size; m_dma += size; - if (hash_type == GMAC_TYPE) - encr_data_len = 0; - if (unlikely(!(flags & VALID_IV_BUF))) { iv_len = 0; iv_offset = ENCR_IV_OFFSET(d_offs); @@ -752,6 +749,11 @@ cpt_enc_hmac_prep(uint32_t flags, opcode.s.major = CPT_MAJOR_OP_FC; opcode.s.minor = 0; + if (hash_type == GMAC_TYPE) { + encr_offset = 0; + encr_data_len = 0; + } + auth_dlen = auth_offset + auth_data_len; enc_dlen = encr_data_len + encr_offset; if (unlikely(encr_data_len & 0xf)) { @@ -762,11 +764,6 @@ cpt_enc_hmac_prep(uint32_t flags, enc_dlen = ROUNDUP16(encr_data_len) + encr_offset; } - if (unlikely(hash_type == GMAC_TYPE)) { - encr_offset = auth_dlen; - enc_dlen = 0; - } - if (unlikely(auth_dlen > enc_dlen)) { inputlen = auth_dlen; outputlen = auth_dlen + mac_len; @@ -1069,9 +1066,6 @@ cpt_dec_hmac_prep(uint32_t flags, hash_type = cpt_ctx->hash_type; mac_len = cpt_ctx->mac_len; - if (hash_type == GMAC_TYPE) - encr_data_len = 0; - if (unlikely(!(flags & VALID_IV_BUF))) { iv_len = 0; iv_offset = ENCR_IV_OFFSET(d_offs); @@ -1128,6 +1122,11 @@ cpt_dec_hmac_prep(uint32_t flags, opcode.s.major = CPT_MAJOR_OP_FC; opcode.s.minor = 1; + if (hash_type == GMAC_TYPE) { + encr_offset = 0; + encr_data_len = 0; + } + enc_dlen = encr_offset + encr_data_len; auth_dlen = auth_offset + auth_data_len; @@ -1139,9 +1138,6 @@ cpt_dec_hmac_prep(uint32_t flags, outputlen = enc_dlen; } - if (hash_type == GMAC_TYPE) - encr_offset = inputlen; - vq_cmd_w0.u64 = 0; vq_cmd_w0.s.param1 = encr_data_len; vq_cmd_w0.s.param2 = auth_data_len; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:52.168539463 +0100 +++ 0094-common-cpt-fix-encryption-offset.patch 2020-07-24 12:53:48.323007130 +0100 @@ -1,13 +1,14 @@ -From 0058f30514f13e5d5412e97973a9c9254e36edb1 Mon Sep 17 00:00:00 2001 +From 094550b236fd9acc5954a910b5c1ec8e953351d1 Mon Sep 17 00:00:00 2001 From: Ankur Dwivedi Date: Fri, 3 Jul 2020 11:11:37 +0530 Subject: [PATCH] common/cpt: fix encryption offset +[ upstream commit 0058f30514f13e5d5412e97973a9c9254e36edb1 ] + In case of gmac auth the encryption offset should be set to zero. Fixes: b74652f3a91f ("common/cpt: add microcode interface for encryption") Fixes: 177b41ceee61 ("common/cpt: add microcode interface for decryption") -Cc: stable@dpdk.org Signed-off-by: Ankur Dwivedi --- @@ -15,10 +16,10 @@ 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h -index 34ccd08a4..ab595eb58 100644 +index 9dc0fc652..e92e3678c 100644 --- a/drivers/common/cpt/cpt_ucode.h +++ b/drivers/common/cpt/cpt_ucode.h -@@ -682,9 +682,6 @@ cpt_enc_hmac_prep(uint32_t flags, +@@ -718,9 +718,6 @@ cpt_enc_hmac_prep(uint32_t flags, m_vaddr = (uint8_t *)m_vaddr + size; m_dma += size; @@ -28,7 +29,7 @@ if (unlikely(!(flags & VALID_IV_BUF))) { iv_len = 0; iv_offset = ENCR_IV_OFFSET(d_offs); -@@ -716,6 +713,11 @@ cpt_enc_hmac_prep(uint32_t flags, +@@ -752,6 +749,11 @@ cpt_enc_hmac_prep(uint32_t flags, opcode.s.major = CPT_MAJOR_OP_FC; opcode.s.minor = 0; @@ -40,7 +41,7 @@ auth_dlen = auth_offset + auth_data_len; enc_dlen = encr_data_len + encr_offset; if (unlikely(encr_data_len & 0xf)) { -@@ -726,11 +728,6 @@ cpt_enc_hmac_prep(uint32_t flags, +@@ -762,11 +764,6 @@ cpt_enc_hmac_prep(uint32_t flags, enc_dlen = ROUNDUP16(encr_data_len) + encr_offset; } @@ -52,7 +53,7 @@ if (unlikely(auth_dlen > enc_dlen)) { inputlen = auth_dlen; outputlen = auth_dlen + mac_len; -@@ -1033,9 +1030,6 @@ cpt_dec_hmac_prep(uint32_t flags, +@@ -1069,9 +1066,6 @@ cpt_dec_hmac_prep(uint32_t flags, hash_type = cpt_ctx->hash_type; mac_len = cpt_ctx->mac_len; @@ -62,7 +63,7 @@ if (unlikely(!(flags & VALID_IV_BUF))) { iv_len = 0; iv_offset = ENCR_IV_OFFSET(d_offs); -@@ -1092,6 +1086,11 @@ cpt_dec_hmac_prep(uint32_t flags, +@@ -1128,6 +1122,11 @@ cpt_dec_hmac_prep(uint32_t flags, opcode.s.major = CPT_MAJOR_OP_FC; opcode.s.minor = 1; @@ -74,7 +75,7 @@ enc_dlen = encr_offset + encr_data_len; auth_dlen = auth_offset + auth_data_len; -@@ -1103,9 +1102,6 @@ cpt_dec_hmac_prep(uint32_t flags, +@@ -1139,9 +1138,6 @@ cpt_dec_hmac_prep(uint32_t flags, outputlen = enc_dlen; }