[dpdk-stable] patch 'common/cpt: fix encryption offset' has been queued to stable release 19.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Jul 24 13:58:52 CEST 2020


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 <adwivedi at marvell.com>
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 <adwivedi at marvell.com>
---
 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 <adwivedi at marvell.com>
 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 at dpdk.org
 
 Signed-off-by: Ankur Dwivedi <adwivedi at marvell.com>
 ---
@@ -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;
  	}
  


More information about the stable mailing list