[3/4] common/dpaax/caamflib: fix 12 bit NULL auth case

Message ID 20200706183500.29862-3-akhil.goyal@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [1/4] crypto/dpaax_sec: fix inline query for descriptors |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Akhil Goyal July 6, 2020, 6:34 p.m. UTC
  Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 drivers/common/dpaax/caamflib/desc/pdcp.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
  

Comments

Akhil Goyal July 7, 2020, 10:35 p.m. UTC | #1
Updated patch description
    In cases of NULL auth in PDCP, the desciptors
    should be based on ALGORITHM command instead of
    PROTOCOL command.
    It was done in case of encap, but was missing in
    decap.

    Fixes: 526cdf60f1e5 ("crypto/dpaa2_sec: update desc for PDCP 18-bit enc-auth")
    Cc: stable@dpdk.org

> 
> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> ---
  

Patch

diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h
index 99eb0f71a..476115323 100644
--- a/drivers/common/dpaax/caamflib/desc/pdcp.h
+++ b/drivers/common/dpaax/caamflib/desc/pdcp.h
@@ -1,6 +1,6 @@ 
 /* SPDX-License-Identifier: BSD-3-Clause or GPL-2.0+
  * Copyright 2008-2013 Freescale Semiconductor, Inc.
- * Copyright 2019 NXP
+ * Copyright 2019-2020 NXP
  */
 
 #ifndef __DESC_PDCP_H__
@@ -3528,6 +3528,15 @@  cnstr_shdsc_pdcp_u_plane_decap(uint32_t *descbuf,
 				KEY(p, KEY2, authdata->key_enc_flags,
 				    (uint64_t)authdata->key, authdata->keylen,
 				    INLINE_KEY(authdata));
+			else if (authdata && authdata->algtype == 0) {
+				err = pdcp_insert_uplane_with_int_op(p, swap,
+						cipherdata, authdata,
+						sn_size, era_2_sw_hfn_ovrd,
+						OP_TYPE_DECAP_PROTOCOL);
+				if (err)
+					return err;
+				break;
+			}
 
 			/* Insert Cipher Key */
 			KEY(p, KEY1, cipherdata->key_enc_flags,