DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <akhil.goyal@nxp.com>
To: dev@dpdk.org, hemant.agrawal@nxp.com
Cc: Akhil Goyal <akhil.goyal@nxp.com>
Subject: [dpdk-dev] [PATCH 4/4] common/dpaax/caamflib: remove unnecessary jump for few PDCP cases
Date: Tue,  7 Jul 2020 00:05:00 +0530
Message-ID: <20200706183500.29862-4-akhil.goyal@nxp.com> (raw)
In-Reply-To: <20200706183500.29862-1-akhil.goyal@nxp.com>

In case of LX2160, PROTOCOL command can be used in some of the PDCP
cases, in those the jump command prior to KEY command may not be
required.

The issue observed due to these JUMP command on LX2160 is that,
the CAAM gets stuck and the processing never get completed. The
system becomes unusable.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 drivers/common/dpaax/caamflib/desc/pdcp.h | 51 ++++++++++++++---------
 1 file changed, 31 insertions(+), 20 deletions(-)

diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h
index 476115323..95d1416c2 100644
--- a/drivers/common/dpaax/caamflib/desc/pdcp.h
+++ b/drivers/common/dpaax/caamflib/desc/pdcp.h
@@ -1887,17 +1887,13 @@ pdcp_insert_cplane_snow_zuc_op(struct program *p,
 		return -ENOTSUP;
 	}
 
-	pkeyjump = JUMP(p, keyjump, LOCAL_JUMP, ALL_TRUE, SHRD | SELF | BOTH);
-	KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,
-	    cipherdata->keylen, INLINE_KEY(cipherdata));
-	KEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen,
-	    INLINE_KEY(authdata));
-
-	SET_LABEL(p, keyjump);
-
 	if ((rta_sec_era >= RTA_SEC_ERA_8 && sn_size != PDCP_SN_SIZE_18) ||
 		(rta_sec_era == RTA_SEC_ERA_10)) {
 		int pclid;
+		KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,
+		    cipherdata->keylen, INLINE_KEY(cipherdata));
+		KEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen,
+		    INLINE_KEY(authdata));
 
 		if (sn_size == PDCP_SN_SIZE_5)
 			pclid = OP_PCLID_LTE_PDCP_CTRL_MIXED;
@@ -1931,6 +1927,13 @@ pdcp_insert_cplane_snow_zuc_op(struct program *p,
 
 	}
 
+	pkeyjump = JUMP(p, keyjump, LOCAL_JUMP, ALL_TRUE, SHRD | SELF | BOTH);
+	KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,
+	    cipherdata->keylen, INLINE_KEY(cipherdata));
+	KEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen,
+	    INLINE_KEY(authdata));
+
+	SET_LABEL(p, keyjump);
 	SEQLOAD(p, MATH0, offset, length, 0);
 	JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);
 	MOVEB(p, MATH0, offset, IFIFOAB2, 0, length, IMMED);
@@ -2008,15 +2011,13 @@ pdcp_insert_cplane_aes_zuc_op(struct program *p,
 		return -ENOTSUP;
 	}
 
-	pkeyjump = JUMP(p, keyjump, LOCAL_JUMP, ALL_TRUE, SHRD | SELF | BOTH);
-	KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,
-	    cipherdata->keylen, INLINE_KEY(cipherdata));
-	KEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen,
-	    INLINE_KEY(authdata));
-
 	if ((rta_sec_era >= RTA_SEC_ERA_8 && sn_size != PDCP_SN_SIZE_18) ||
 		(rta_sec_era == RTA_SEC_ERA_10)) {
 		int pclid;
+		KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,
+		    cipherdata->keylen, INLINE_KEY(cipherdata));
+		KEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen,
+		    INLINE_KEY(authdata));
 
 		if (sn_size == PDCP_SN_SIZE_5)
 			pclid = OP_PCLID_LTE_PDCP_CTRL_MIXED;
@@ -2050,8 +2051,14 @@ pdcp_insert_cplane_aes_zuc_op(struct program *p,
 		return -ENOTSUP;
 
 	}
+	pkeyjump = JUMP(p, keyjump, LOCAL_JUMP, ALL_TRUE, SHRD | SELF | BOTH);
+	KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,
+	    cipherdata->keylen, INLINE_KEY(cipherdata));
+	KEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen,
+	    INLINE_KEY(authdata));
 
 	SET_LABEL(p, keyjump);
+
 	SEQLOAD(p, MATH0, offset, length, 0);
 	JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);
 	MOVEB(p, MATH0, offset, IFIFOAB2, 0, length, IMMED);
@@ -2132,15 +2139,13 @@ pdcp_insert_cplane_zuc_snow_op(struct program *p,
 		return -ENOTSUP;
 	}
 
-	pkeyjump = JUMP(p, keyjump, LOCAL_JUMP, ALL_TRUE, SHRD | SELF | BOTH);
-	KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,
-	    cipherdata->keylen, INLINE_KEY(cipherdata));
-	KEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen,
-	    INLINE_KEY(authdata));
-
 	if ((rta_sec_era >= RTA_SEC_ERA_8 && sn_size != PDCP_SN_SIZE_18) ||
 		(rta_sec_era == RTA_SEC_ERA_10)) {
 		int pclid;
+		KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,
+		    cipherdata->keylen, INLINE_KEY(cipherdata));
+		KEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen,
+		    INLINE_KEY(authdata));
 
 		if (sn_size == PDCP_SN_SIZE_5)
 			pclid = OP_PCLID_LTE_PDCP_CTRL_MIXED;
@@ -2174,6 +2179,12 @@ pdcp_insert_cplane_zuc_snow_op(struct program *p,
 		return -ENOTSUP;
 
 	}
+	pkeyjump = JUMP(p, keyjump, LOCAL_JUMP, ALL_TRUE, SHRD | SELF | BOTH);
+	KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,
+	    cipherdata->keylen, INLINE_KEY(cipherdata));
+	KEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen,
+	    INLINE_KEY(authdata));
+
 	SET_LABEL(p, keyjump);
 	SEQLOAD(p, MATH0, offset, length, 0);
 	JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);
-- 
2.17.1


  parent reply	other threads:[~2020-07-06 18:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06 18:34 [dpdk-dev] [PATCH 1/4] crypto/dpaax_sec: fix inline query for descriptors Akhil Goyal
2020-07-06 18:34 ` [dpdk-dev] [PATCH 2/4] crypto/dpaa2_sec: fix HFN override Akhil Goyal
2020-07-07 22:34   ` Akhil Goyal
2020-07-06 18:34 ` [dpdk-dev] [PATCH 3/4] common/dpaax/caamflib: fix 12 bit NULL auth case Akhil Goyal
2020-07-07 22:35   ` Akhil Goyal
2020-07-06 18:35 ` Akhil Goyal [this message]
2020-07-07  3:48 ` [dpdk-dev] [PATCH 1/4] crypto/dpaax_sec: fix inline query for descriptors Hemant Agrawal (OSS)
2020-07-07 22:32   ` 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=20200706183500.29862-4-akhil.goyal@nxp.com \
    --to=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git