From patchwork Mon Jul 6 18:35:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 73286 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CF0C2A00C5; Mon, 6 Jul 2020 20:35:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B634D1DC51; Mon, 6 Jul 2020 20:35:14 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id B88401DBE6 for ; Mon, 6 Jul 2020 20:35:09 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9EC0120071F; Mon, 6 Jul 2020 20:35:09 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B95EB20052A; Mon, 6 Jul 2020 20:35:07 +0200 (CEST) Received: from lsv03273.swis.in-blr01.nxp.com (lsv03273.swis.in-blr01.nxp.com [92.120.147.113]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 60CBE402FA; Tue, 7 Jul 2020 02:35:05 +0800 (SGT) From: Akhil Goyal To: dev@dpdk.org, hemant.agrawal@nxp.com Cc: Akhil Goyal Date: Tue, 7 Jul 2020 00:05:00 +0530 Message-Id: <20200706183500.29862-4-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706183500.29862-1-akhil.goyal@nxp.com> References: <20200706183500.29862-1-akhil.goyal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 4/4] common/dpaax/caamflib: remove unnecessary jump for few PDCP cases X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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);