From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 083BEA00BE for ; Thu, 17 Mar 2022 09:56:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89AC4410EC; Thu, 17 Mar 2022 09:56:26 +0100 (CET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2064.outbound.protection.outlook.com [40.107.22.64]) by mails.dpdk.org (Postfix) with ESMTP id 8CD2B40151; Thu, 17 Mar 2022 09:56:24 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bIqQfSiDJCYa1vvS4GihZq39SLC3XXWuTpcVNccPLlWSgtWXTTnriaxEiNGiFGChm/t21dHkI6yMPOVXMbTrmcLsJJgFSkWq6t6hZQe9HIp+86uUyZ+J0QzRZRGAw0BDjE0VelPhsqA2bM8OwGyublyubx579j8CaGPYBi4PZlX+6BIYoiHrqhTaBmazSuw+1YLO7C185q6aD5vPsJldzUeT1pLZnYNp3UBKL44p0mDIv6FQH/XKNehgcGdvSxuZXIj7XtMGNn/RhcZcycmGpD4cqXz41Ao0vCIh4VmuqCJVTY55HeC7QK22AO7Z2mNvg2Z/dBPz3dAv6Bbuyn6Spg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TA3izKzPZPog1BrJD6+1W7vMLOepTKg6lbSXU30HCAo=; b=E9179BM7fNnv0A9Q6ur+Bm7pLAKY1XU03zruZkobQKM10QoFjhozMbqwk0AdjgfVX4b1Jj53WTVbilftVUgyCh3Z1gnzfSADvn9XAm/2pLU1GMm5+K5a4pspMmTY0a8cOyayrE59Omc7UQX4a22b8QRhHSa/yZKOH214tMxQPngMGS7GpNZDgqdK4AoxGsq5pvgZrcvM+w10M3aDVCKFFRx1jZLVy+S/dn+3tjwO20tJ6fJNcGH7nAkIWK/0mN4dzWw+k8g6+6rDFRshPCXaV8btKE9rCR5ZySumnStW8yD1pQBzvvqnVjjbzkUmqpU/7fjdx8nOWuNGg5GoWDqBlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TA3izKzPZPog1BrJD6+1W7vMLOepTKg6lbSXU30HCAo=; b=PGiS9CaJtR/CLzI/ARuLsM9MdNCpenEfbv8e/HGqHCYCeMXCCPa8sL8iumtFEGDwbRMsVi//Jl22x2NClQC4/3Zm9wGroMVngDque08cvtT9Rv2QGK0INuTEWTjjb7uPy9N/vp/l2RxFkkciBRkd4jMwYOFMNn5jPCavwwssmp4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by AM0PR04MB5458.eurprd04.prod.outlook.com (2603:10a6:208:110::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.17; Thu, 17 Mar 2022 08:56:22 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::c99e:702:9368:f27a]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::c99e:702:9368:f27a%2]) with mapi id 15.20.5081.017; Thu, 17 Mar 2022 08:56:22 +0000 From: Gagandeep Singh To: gakhil@marvell.com, dev@dpdk.org Cc: Gagandeep Singh , stable@dpdk.org Subject: [PATCH 1/2] common/dpaax: remove dead code Date: Thu, 17 Mar 2022 14:25:57 +0530 Message-Id: <20220317085558.2575554-1-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR04CA0004.apcprd04.prod.outlook.com (2603:1096:4:197::22) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d17a1297-8910-40bd-584d-08da07f40239 X-MS-TrafficTypeDiagnostic: AM0PR04MB5458:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4jMNoyatWV0z9GsShY7X0XAkEqC07PBtk+LW3cOdkS4sdlcL4xKc7nbrVw3x38Gdb8yOIQqi0aI19OZlltop1uKqtr6vI9GXBfj0wzqe1nx4s7ZV6IKAPr0rKIxgQk60ZVGz6NMO5tLnRGhdS1sBBGwJPVBiVPW09+NwWFwL73Y5Zgdbzh40ab82/Awl0/QdHB/mCRD7T2phMTcU6Oroy7sAVpMm9JYfwwHG/+eHWJrYrY/WINswRWAGMjuffdOAxNALC9v0DpDNcks8tzp3VkxosuTDAbZ0QGrXI+mu4CwhZkCNxXJKgU8bogsllS3tM7urhO3sDLnRnloM+5H6JCPefuoyyvT9/BQHq0daxaLsWIAiXHGl4zapAjzDIZh9pqg6LNJsPkSvmVCcAmO9GVILjQMfRSE9pj0pbUKlq0DBHS2TDdH7fP0c27ZaC7Ro48Dl3nou4R48Bk5D2bbYvvB+dMXp580KKaIPhqcFCwqjsWqKXJX9aw7NmRM0YR1WrlYSj/TQK8LXzmEaHFcEWG9k4SuuK39MlfOAn62gM8QeO6V2JKxmfz4GJ2M778TqfwBNXgpNrAuTploLlYmh/T+hv55SrcCkVnRE9luW3UQe7pucV0oE7QkxgXKcVysm/yMtzvq95vDx2sFV2F6uNUHvq8VxOJPv61JOyxo5p0GH8WEOTBYEZ3V6h0yXceNh9K4zE0Bs0TqdUFQGa3oCZA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(8936002)(5660300002)(52116002)(8676002)(4326008)(186003)(1076003)(2616005)(2906002)(26005)(316002)(66946007)(83380400001)(66476007)(66556008)(55236004)(6512007)(6666004)(6506007)(38100700002)(36756003)(38350700002)(6486002)(86362001)(508600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?XGQhVbUuDylV5pXihZIDblPCqrn3EW2jM3iLnv2AWJzGzf0YF1uEAG/gmCi5?= =?us-ascii?Q?5mRjWao1BWaeNVticPMKpC9ItM7D0HfK+AZHdp/zNpNCUGxC2deGJw3Kg9wc?= =?us-ascii?Q?WuqmEsC55gg2IeZPmIlxkLZidFzB8d464tkKsIvq8CpzukjJZyl97vFh5r0f?= =?us-ascii?Q?rHCXEx28PF2v+ZLOqxHLxZ7kj8pgx9j1gx3i1gXe2zhY8bCJ0cdRtw7B0Ucv?= =?us-ascii?Q?2K2eATvfUghs6py8IFJ4mK+NdMYxuoHjqGYy0sOXRJEv5GFAf1n5GSjxUW9i?= =?us-ascii?Q?P3uqeTRpNp37j6nl8qmcCE9fxk5BYBvsGOFh294Dfh6tyXHt34iSdQbS5VDD?= =?us-ascii?Q?pASFR1inv0+hDLdviIt7VpL5EZ9lmbHDEgIuYrPu5N1B+XFQVgsFYL9xg3h/?= =?us-ascii?Q?p26fTad/Q8KyeDC6LdRhPQ88Eq+YiIZlfL5FwnVIcvw2LgHkDp+2zlXyYQVJ?= =?us-ascii?Q?ubAehpRaHXSrLn/ti+JR4zZGpPSaAKcwu12L+beqVaZrAQZFp6o9ZSKtJlO6?= =?us-ascii?Q?49b6u8+5mE4HYQJeE4VcBaMxaHZuDuRErdSCqpdYBUMWrcNz9nQ8v1VppvAU?= =?us-ascii?Q?DIOAcpgjqVAvGCEAXXAMJ+mW6XjHzq+G3CiAsdCwFSkfmbGWrLph7l89hpz4?= =?us-ascii?Q?Fkoc0rPdP16dicFFcqv7Eled2pHmxhze2sRZtEXnndotGLlYSguG2gV6T963?= =?us-ascii?Q?mQ1HMZAB/1nE/HsDhg/nxhql3JePRmso6ChT9a/p9eC0E2c70+JlUukwRGyG?= =?us-ascii?Q?FilwR/Go0V2ylsVkQyNdk8nXq2gG4W55zFFXMQ3n0k/rgAADDQGm+ZyJBUmI?= =?us-ascii?Q?WMAmrC1Hpwd8zb2Eh3uZzpO2YFCNCEXEXfa7u9B8s6fom04ga3eDJELQrRp8?= =?us-ascii?Q?gn1Uy6KReKONexqZpy8kbBoglvsdR+jk5bjbMpUjpl1kLCyLOSNvCC6vSVkv?= =?us-ascii?Q?wwpJ2NndjgzQ71rpITQVx1X3vzt1cVkbAm+0voDI/FdLpOfdNcVIRM3thGYy?= =?us-ascii?Q?f5XNPYjfa8l6uefKodHG5DunewQQhdkWSYodwkklALbH+fgSHcOU2UtwCWcE?= =?us-ascii?Q?ijiXeV2tbLUWu1Cxo6ptN3hWqyO4VE+JOyiM2/USm7012nN+9E/ltNYkiNv7?= =?us-ascii?Q?yq7UMkCWOV+4mMo0UvZrWlWiZ5AzNR9NCnipUg+7vxlW+sfx8Wd70YClHm6S?= =?us-ascii?Q?oW499uxdug/oaOAHQtaOBgtUgd97h2Jh08Kb2lCOaMxERt5D8ExhkLAheQXY?= =?us-ascii?Q?cqbeG8nzfB/h4GlVSGpPf6jWmziuPO9UDwC7dqXd/grfYNmwdKaHijWIET6v?= =?us-ascii?Q?4wBT7hZX7nwi4gGmdgxiqD0ZoXRPixRyX3YUVA2/vplMpe+I/TPuyoOgNplG?= =?us-ascii?Q?LVnzbKjjiY4+bRi6ISwoGnajcDIVYMGS51hOBKJwM+4TlNUEGFLVaUvPpc1p?= =?us-ascii?Q?w45sU1opVxFoVmLz60cZtbqjivkhLIsl?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d17a1297-8910-40bd-584d-08da07f40239 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2022 08:56:22.2697 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xfIlWIGP/5Xmx0DtDkB/OT/9cxKjbRdP81r5vCHTY3eavV5oxrGu/TRIJqgSVy1w X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5458 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org This patch remove structural and logical dead code from caamflib. coverity issues: 375251 375258 375261 375267 375269 375285 373161 375249 375257 Fixes: 6127fff842a7 ("common/dpaax: remove outdated caamflib code") Fixes: 81eb760d2207 ("common/dpaax/caamflib: remove some inline keys") Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh --- drivers/common/dpaax/caamflib/desc/pdcp.h | 196 +++++----------------- drivers/common/dpaax/caamflib/desc/sdap.h | 44 +---- 2 files changed, 45 insertions(+), 195 deletions(-) diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h index 2fe56c53c6..46153b9c29 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-2021 NXP + * Copyright 2019-2022 NXP */ #ifndef __DESC_PDCP_H__ @@ -776,21 +776,11 @@ pdcp_insert_uplane_snow_snow_op(struct program *p, return 0; } - /* Non-proto is supported only for 5bit cplane and 18bit uplane */ - switch (sn_size) { - case PDCP_SN_SIZE_18: - offset = 5; - length = 3; - sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : - PDCP_U_PLANE_18BIT_SN_MASK_BE; - break; - case PDCP_SN_SIZE_5: - case PDCP_SN_SIZE_7: - case PDCP_SN_SIZE_12: - case PDCP_SN_SIZE_15: - pr_err("Invalid sn_size for %s\n", __func__); - return -ENOTSUP; - } + /* sn_size is 18 */ + offset = 5; + length = 3; + sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : + PDCP_U_PLANE_18BIT_SN_MASK_BE; if (dir == OP_TYPE_ENCAP_PROTOCOL) MATHB(p, SEQINSZ, SUB, length, VSEQINSZ, 4, IMMED2); @@ -901,21 +891,11 @@ pdcp_insert_uplane_zuc_zuc_op(struct program *p, return 0; } - /* Non-proto is supported only for 5bit cplane and 18bit uplane */ - switch (sn_size) { - case PDCP_SN_SIZE_18: - offset = 5; - length = 3; - sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : - PDCP_U_PLANE_18BIT_SN_MASK_BE; - break; - case PDCP_SN_SIZE_5: - case PDCP_SN_SIZE_7: - case PDCP_SN_SIZE_12: - case PDCP_SN_SIZE_15: - pr_err("Invalid sn_size for %s\n", __func__); - return -ENOTSUP; - } + /* sn_size is 18 */ + offset = 5; + length = 3; + sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : + PDCP_U_PLANE_18BIT_SN_MASK_BE; SEQLOAD(p, MATH0, offset, length, 0); JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM); @@ -1190,27 +1170,11 @@ pdcp_insert_cplane_snow_aes_op(struct program *p, return 0; } - /* Non-proto is supported only for 5bit cplane and 18bit uplane */ - switch (sn_size) { - case PDCP_SN_SIZE_5: - offset = 7; - length = 1; - sn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK : - PDCP_C_PLANE_SN_MASK_BE; - break; - case PDCP_SN_SIZE_18: - offset = 5; - length = 3; - sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : - PDCP_U_PLANE_18BIT_SN_MASK_BE; - break; - case PDCP_SN_SIZE_7: - case PDCP_SN_SIZE_12: - case PDCP_SN_SIZE_15: - pr_err("Invalid sn_size for %s\n", __func__); - return -ENOTSUP; - - } + /* sn_size is 18 */ + offset = 5; + length = 3; + sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : + PDCP_U_PLANE_18BIT_SN_MASK_BE; SEQLOAD(p, MATH0, offset, length, 0); JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM); @@ -1421,27 +1385,11 @@ pdcp_insert_cplane_aes_snow_op(struct program *p, return 0; } - /* Non-proto is supported only for 5bit cplane and 18bit uplane */ - switch (sn_size) { - case PDCP_SN_SIZE_5: - offset = 7; - length = 1; - sn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK : - PDCP_C_PLANE_SN_MASK_BE; - break; - case PDCP_SN_SIZE_18: - offset = 5; - length = 3; - sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : - PDCP_U_PLANE_18BIT_SN_MASK_BE; - break; - case PDCP_SN_SIZE_7: - case PDCP_SN_SIZE_12: - case PDCP_SN_SIZE_15: - pr_err("Invalid sn_size for %s\n", __func__); - return -ENOTSUP; - - } + /* sn_size is 18 */ + offset = 5; + length = 3; + sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : + PDCP_U_PLANE_18BIT_SN_MASK_BE; if (dir == OP_TYPE_ENCAP_PROTOCOL) MATHB(p, SEQINSZ, SUB, length, VSEQINSZ, 4, IMMED2); @@ -1548,27 +1496,11 @@ pdcp_insert_cplane_snow_zuc_op(struct program *p, (uint16_t)authdata->algtype); return 0; } - /* Non-proto is supported only for 5bit cplane and 18bit uplane */ - switch (sn_size) { - case PDCP_SN_SIZE_5: - offset = 7; - length = 1; - sn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK : - PDCP_C_PLANE_SN_MASK_BE; - break; - case PDCP_SN_SIZE_18: - offset = 5; - length = 3; - sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : - PDCP_U_PLANE_18BIT_SN_MASK_BE; - break; - case PDCP_SN_SIZE_7: - case PDCP_SN_SIZE_12: - case PDCP_SN_SIZE_15: - pr_err("Invalid sn_size for %s\n", __func__); - return -ENOTSUP; - - } + /* sn_size is 18 */ + offset = 5; + length = 3; + sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : + PDCP_U_PLANE_18BIT_SN_MASK_BE; pkeyjump = JUMP(p, keyjump, LOCAL_JUMP, ALL_TRUE, SHRD | SELF | BOTH); KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key, @@ -1667,27 +1599,12 @@ pdcp_insert_cplane_aes_zuc_op(struct program *p, return 0; } - /* Non-proto is supported only for 5bit cplane and 18bit uplane */ - switch (sn_size) { - case PDCP_SN_SIZE_5: - offset = 7; - length = 1; - sn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK : - PDCP_C_PLANE_SN_MASK_BE; - break; - case PDCP_SN_SIZE_18: - offset = 5; - length = 3; - sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : - PDCP_U_PLANE_18BIT_SN_MASK_BE; - break; - case PDCP_SN_SIZE_7: - case PDCP_SN_SIZE_12: - case PDCP_SN_SIZE_15: - pr_err("Invalid sn_size for %s\n", __func__); - return -ENOTSUP; + /* sn_size is 18 */ + offset = 5; + length = 3; + sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : + PDCP_U_PLANE_18BIT_SN_MASK_BE; - } 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)); @@ -1789,27 +1706,12 @@ pdcp_insert_cplane_zuc_snow_op(struct program *p, return 0; } - /* Non-proto is supported only for 5bit cplane and 18bit uplane */ - switch (sn_size) { - case PDCP_SN_SIZE_5: - offset = 7; - length = 1; - sn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK : - PDCP_C_PLANE_SN_MASK_BE; - break; - case PDCP_SN_SIZE_18: - offset = 5; - length = 3; - sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : - PDCP_U_PLANE_18BIT_SN_MASK_BE; - break; - case PDCP_SN_SIZE_7: - case PDCP_SN_SIZE_12: - case PDCP_SN_SIZE_15: - pr_err("Invalid sn_size for %s\n", __func__); - return -ENOTSUP; + /* sn_size is 18 */ + offset = 5; + length = 3; + sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : + PDCP_U_PLANE_18BIT_SN_MASK_BE; - } 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)); @@ -1929,26 +1831,12 @@ pdcp_insert_cplane_zuc_aes_op(struct program *p, (uint16_t)authdata->algtype); return 0; } - /* Non-proto is supported only for 5bit cplane and 18bit uplane */ - switch (sn_size) { - case PDCP_SN_SIZE_5: - offset = 7; - length = 1; - sn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK : - PDCP_C_PLANE_SN_MASK_BE; - break; - case PDCP_SN_SIZE_18: - offset = 5; - length = 3; - sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : - PDCP_U_PLANE_18BIT_SN_MASK_BE; - break; - case PDCP_SN_SIZE_7: - case PDCP_SN_SIZE_12: - case PDCP_SN_SIZE_15: - pr_err("Invalid sn_size for %s\n", __func__); - return -ENOTSUP; - } + + /* sn_size is 18 */ + offset = 5; + length = 3; + sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : + PDCP_U_PLANE_18BIT_SN_MASK_BE; SEQLOAD(p, MATH0, offset, length, 0); JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM); diff --git a/drivers/common/dpaax/caamflib/desc/sdap.h b/drivers/common/dpaax/caamflib/desc/sdap.h index 07a544295e..b38c15a24f 100644 --- a/drivers/common/dpaax/caamflib/desc/sdap.h +++ b/drivers/common/dpaax/caamflib/desc/sdap.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2020-2021 NXP + * Copyright 2020-2022 NXP */ #ifndef __DESC_SDAP_H__ @@ -29,52 +29,14 @@ static inline int rta_inline_pdcp_sdap_query(enum auth_type_pdcp auth_alg, enum cipher_type_pdcp cipher_alg, - enum pdcp_sn_size sn_size, - int8_t hfn_ovd) + __rte_unused enum pdcp_sn_size sn_size, + __rte_unused int8_t hfn_ovd) { - int nb_key_to_inline = 0; - if ((cipher_alg != PDCP_CIPHER_TYPE_NULL) && (auth_alg != PDCP_AUTH_TYPE_NULL)) return 2; else return 0; - - /** - * Shared Descriptors for some of the cases does not fit in the - * MAX_DESC_SIZE of the descriptor - * The cases which exceed are for RTA_SEC_ERA=8 and HFN override - * enabled and 12/18 bit uplane and either of following Algo combo. - * - AES-SNOW - * - AES-ZUC - * - SNOW-SNOW - * - SNOW-ZUC - * - ZUC-SNOW - * - ZUC-SNOW - * - * We cannot make inline for all cases, as this will impact performance - * due to extra memory accesses for the keys. - */ - - /* Inline only the cipher key */ - if ((rta_sec_era == RTA_SEC_ERA_8) && hfn_ovd && - ((sn_size == PDCP_SN_SIZE_12) || - (sn_size == PDCP_SN_SIZE_18)) && - (cipher_alg != PDCP_CIPHER_TYPE_NULL) && - ((auth_alg == PDCP_AUTH_TYPE_SNOW) || - (auth_alg == PDCP_AUTH_TYPE_ZUC))) { - - nb_key_to_inline++; - - /* Sub case where inlining another key is required */ - if ((cipher_alg == PDCP_CIPHER_TYPE_AES) && - (auth_alg == PDCP_AUTH_TYPE_SNOW)) - nb_key_to_inline++; - } - - /* Inline both keys */ - - return nb_key_to_inline; } static inline void key_loading_opti(struct program *p, -- 2.25.1