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 B3AC8A04AF for ; Thu, 20 Aug 2020 17:34:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AC5421C0B0; Thu, 20 Aug 2020 17:34:18 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id 04AE31C0B0 for ; Thu, 20 Aug 2020 17:34:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597937656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QWAilpt9NIf4elhY6YfRTgV93WTPhOmuOt0r39jq3s0=; b=I+A5DqjvbNH7EK/4xmopq/ApgPVPJs9aNxXxb35+6lK7ToC13k0ZgUr4Ep+mg217BWHo9y u9+9ELQ0fULudfUEwu3fNPzSRxoISIV4U4Ugva58XTG1L2KTQSPfa9t8GXchdLIwQ6UxOc KJF/5zoyAi+j3jNT01Q8xntPrJ/Mwj4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-385-SQsZ_6PAP-SnpcBtUw3FCA-1; Thu, 20 Aug 2020 11:34:12 -0400 X-MC-Unique: SQsZ_6PAP-SnpcBtUw3FCA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D7C8E1084C8F; Thu, 20 Aug 2020 15:34:11 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A79A10027A6; Thu, 20 Aug 2020 15:34:10 +0000 (UTC) From: Kevin Traynor To: Ankur Dwivedi Cc: dpdk stable Date: Thu, 20 Aug 2020 16:33:13 +0100 Message-Id: <20200820153341.171927-8-ktraynor@redhat.com> In-Reply-To: <20200820153341.171927-1-ktraynor@redhat.com> References: <20200820153341.171927-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'common/cpt: fix encryption offset' has been queued to LTS release 18.11.10 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 LTS release 18.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/25/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. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/380fb4d751781f214a0055211700a88a8f730505 Thanks. Kevin. --- >From 380fb4d751781f214a0055211700a88a8f730505 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 f47c96d934..ac6cd8d1eb 100644 --- a/drivers/common/cpt/cpt_ucode.h +++ b/drivers/common/cpt/cpt_ucode.h @@ -732,7 +732,4 @@ cpt_enc_hmac_prep(uint32_t flags, m_dma += size; - if (hash_type == GMAC_TYPE) - encr_data_len = 0; - if (unlikely(!(flags & VALID_IV_BUF))) { iv_len = 0; @@ -766,4 +763,9 @@ cpt_enc_hmac_prep(uint32_t flags, 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; @@ -776,9 +778,4 @@ cpt_enc_hmac_prep(uint32_t flags, } - if (unlikely(hash_type == GMAC_TYPE)) { - encr_offset = auth_dlen; - enc_dlen = 0; - } - if (unlikely(auth_dlen > enc_dlen)) { inputlen = auth_dlen; @@ -1085,7 +1082,4 @@ cpt_dec_hmac_prep(uint32_t flags, mac_len = cpt_ctx->mac_len; - if (hash_type == GMAC_TYPE) - encr_data_len = 0; - if (unlikely(!(flags & VALID_IV_BUF))) { iv_len = 0; @@ -1144,4 +1138,9 @@ cpt_dec_hmac_prep(uint32_t flags, 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; @@ -1155,7 +1154,4 @@ cpt_dec_hmac_prep(uint32_t flags, } - if (hash_type == GMAC_TYPE) - encr_offset = inputlen; - vq_cmd_w0.u64 = 0; vq_cmd_w0.s.param1 = rte_cpu_to_be_16(encr_data_len); -- 2.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-08-20 16:26:16.183979376 +0100 +++ 0008-common-cpt-fix-encryption-offset.patch 2020-08-20 16:26:15.767323807 +0100 @@ -1 +1 @@ -From 0058f30514f13e5d5412e97973a9c9254e36edb1 Mon Sep 17 00:00:00 2001 +From 380fb4d751781f214a0055211700a88a8f730505 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0058f30514f13e5d5412e97973a9c9254e36edb1 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -18 +19 @@ -index 34ccd08a40..ab595eb580 100644 +index f47c96d934..ac6cd8d1eb 100644 @@ -21 +22 @@ -@@ -683,7 +683,4 @@ cpt_enc_hmac_prep(uint32_t flags, +@@ -732,7 +732,4 @@ cpt_enc_hmac_prep(uint32_t flags, @@ -29 +30 @@ -@@ -717,4 +714,9 @@ cpt_enc_hmac_prep(uint32_t flags, +@@ -766,4 +763,9 @@ cpt_enc_hmac_prep(uint32_t flags, @@ -39 +40 @@ -@@ -727,9 +729,4 @@ cpt_enc_hmac_prep(uint32_t flags, +@@ -776,9 +778,4 @@ cpt_enc_hmac_prep(uint32_t flags, @@ -49 +50 @@ -@@ -1034,7 +1031,4 @@ cpt_dec_hmac_prep(uint32_t flags, +@@ -1085,7 +1082,4 @@ cpt_dec_hmac_prep(uint32_t flags, @@ -57 +58 @@ -@@ -1093,4 +1087,9 @@ cpt_dec_hmac_prep(uint32_t flags, +@@ -1144,4 +1138,9 @@ cpt_dec_hmac_prep(uint32_t flags, @@ -67 +68 @@ -@@ -1104,7 +1103,4 @@ cpt_dec_hmac_prep(uint32_t flags, +@@ -1155,7 +1154,4 @@ cpt_dec_hmac_prep(uint32_t flags, @@ -74 +75 @@ - vq_cmd_w0.s.param1 = encr_data_len; + vq_cmd_w0.s.param1 = rte_cpu_to_be_16(encr_data_len);