DPDK patches and discussions
 help / color / mirror / Atom feed
From: Vidya Sagar Velumuri <vvelumuri@marvell.com>
To: <adwivedi@marvell.com>, <anoobj@marvell.com>,
	<ktejasree@marvell.com>, <ndabilpuram@marvell.com>,
	<kirankumark@marvell.com>, <skori@marvell.com>,
	<skoteshwar@marvell.com>, <gakhil@marvell.com>,
	<declan.doherty@intel.com>
Cc: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH v1 1/3] common/cnxk: set key length setting for PDCP algos
Date: Wed, 15 Sep 2021 06:11:01 +0000	[thread overview]
Message-ID: <20210915061103.28375-1-vvelumuri@marvell.com> (raw)

Set proper bits in the context based on key length for PDCP

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>

diff --git a/drivers/common/cnxk/roc_se.c b/drivers/common/cnxk/roc_se.c
index 03fbc5f2f7..4edbc8e547 100644
--- a/drivers/common/cnxk/roc_se.c
+++ b/drivers/common/cnxk/roc_se.c
@@ -160,6 +160,13 @@ cpt_pdcp_mac_len_set(struct roc_se_zuc_snow3g_ctx *zs_ctx, uint16_t mac_len)
 {
 	roc_se_pdcp_mac_len_type mac_type = 0;
 
+	if (roc_model_is_cn9k()) {
+		if (mac_len != 4) {
+			plt_err("Only mac len 4 is supported on cn9k");
+			return -ENOTSUP;
+		}
+	}
+
 	switch (mac_len) {
 	case 4:
 		mac_type = ROC_SE_PDCP_MAC_LEN_32_BIT;
@@ -230,6 +237,9 @@ roc_se_auth_key_set(struct roc_se_ctx *se_ctx, roc_se_auth_type type,
 		case ROC_SE_ZUC_EIA3:
 			zs_ctx->zuc.otk_ctx.w0.s.alg_type =
 				ROC_SE_PDCP_ALG_TYPE_ZUC;
+			ret = cpt_pdcp_key_type_set(zs_ctx, key_len);
+			if (ret)
+				return ret;
 			ret = cpt_pdcp_mac_len_set(zs_ctx, mac_len);
 			if (ret)
 				return ret;
-- 
2.31.1


             reply	other threads:[~2021-09-15  6:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  6:11 Vidya Sagar Velumuri [this message]
2021-09-15  6:11 ` [dpdk-dev] [PATCH v1 2/3] crypto/cnxk: support for 256 bit key length in ZUC Vidya Sagar Velumuri
2021-09-15  6:11 ` [dpdk-dev] [PATCH v1 3/3] test/crypto: add ZUC test cases for 256 bit key Vidya Sagar Velumuri
2021-10-01 12:08   ` De Lara Guarch, Pablo
2021-10-07  4:44     ` Vidya Sagar Velumuri
2021-09-29 15:43 ` [dpdk-dev] [PATCH v1 1/3] common/cnxk: set key length setting for PDCP algos Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210915061103.28375-1-vvelumuri@marvell.com \
    --to=vvelumuri@marvell.com \
    --cc=adwivedi@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ktejasree@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).