From patchwork Wed Sep 8 06:59:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507900 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp334851jai; Wed, 8 Sep 2021 00:04:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrS5agI9kyRBXnQGGDV7/LM4yvd6MwpY8jUGJvUpZAdo388CXPjbPc4qbkWlTVcelmfQp/ X-Received: by 2002:aa7:cf82:: with SMTP id z2mr2293687edx.254.1631084642754; Wed, 08 Sep 2021 00:04:02 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id di4si1403717ejc.505.2021.09.08.00.04.02; Wed, 08 Sep 2021 00:04:02 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=oZFevfux; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D2B64003E; Wed, 8 Sep 2021 09:04:02 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60070.outbound.protection.outlook.com [40.107.6.70]) by mails.dpdk.org (Postfix) with ESMTP id 00FAA4003C for ; Wed, 8 Sep 2021 09:04:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D79qZ00XimtCeOoP9Gd5vtEkGVTwYJwyqvQqAMOxvl21xCE7rSBfQ5pVCjnglZm84gfA+KwrvmjK28EwIDohlsMLDpvuDOdkoJr84FCTmyBvVSH5vz9DzYU1MLrMdCgTNyV5UM5vIWxJymqPr3o0IVFLk6DEpLjzF7Vv1BXjlz+lv1RezxaPA/PYjnC2kSku2aN7q+fgidsMRiaIv4uHWCIjpWjxrYC9uP/1wi+MTm062ElOtn1XYLapMtmYhAsLL79cJtHSZ38h8AVAOp9HuMxGdpR/y9KKYpM59lreiLUkXS4wQjavlK09Cfn09jPhuFiH8eXkNeH9oWMHDeB9+A== 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; bh=10gdtS94yVcrg9wJnrkev88ZZBCwFK65gIprnf4EQkA=; b=WG3KotUTx8Uk9cae1o5pyb+gjummCM4M46/BzohSrfuA7+4uNuAgdHSEhHVVC7jKdtcJ07/XARAL6lnTvbPi3Fef3RN8HQhwwyB27llkOaEh9UBBetWx7aPfrtXYc3PkcaZIZTDZ0+tnb1kZ6xLADedbhz8Zl9mGmZma1ChcP4BJLzrpwei+J9x9t4eV67NRbfJlviIbA93yx2pAGogj+79ZhfJtP84UZoBbcWV/MtGPw6QR9CnPYy5W4uYiyL95ZcVEcKhCUVKckDLZJN5+oHMmTkX1Bj8h2mhkcavVbHGdfdX4hbjgiN6tw6bZ1MzF30bFL7mnoAr2vVtTHCXsCw== 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=10gdtS94yVcrg9wJnrkev88ZZBCwFK65gIprnf4EQkA=; b=oZFevfuxctbVVuxsjVglUjTYaQX28yOaVP4H6uLPf+tiU6DcWWQMVGwT9wgcDT09rMyfcTR91irN4OkHHxOD4/x96Thb9oShcxZKS8fXF72KdyTvsSZCu3AtXTTw7FXQ9aL9rPNvwtD3Qp6/KXbe1GqkzM4PBgCxmukH/CAz4bk= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Wed, 8 Sep 2021 07:04:00 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Wed, 8 Sep 2021 07:04:00 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Wed, 8 Sep 2021 12:29:44 +0530 Message-Id: <20210908065953.28349-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907083953.8948-1-hemant.agrawal@nxp.com> References: <20210907083953.8948-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 07:03:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 72e5004c-60eb-45ba-27ca-08d97296d592 X-MS-TrafficTypeDiagnostic: DU2PR04MB8903: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:229; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jUW/SKWXzy43ykx8Cgnt+2CdRYWUnYZWet+gtNFvfTdhBApy5HJH2u3nRV4M4bmP3YDvo34+gRKl6zEFH0NMGVT3PvbsBNCa4tl/OR+4iIhMEV7D5CwjmLOfaLqPZIVdKm2PN1J3AVnEy84tIV8qcQmZPgwwhGXOmHr6AWJVmENknUihE/Ojvp/NyTP6lCrttwaEDz8Ta0U7Vvqv4JtzYG4yQdqcZQp/vWim2Ql9vqj/KJXOMHn35mO5ye76/aDO/W2Uf5tlvjAY/vdwyvqc/JJ0bZTurfbEBHjPxOwOz7U4Gg56Q1HuNZC4ss27IAPDx6O3TzBHznqaOL8llNQ8gggpZiS4Ro5iuC16H2digNa5KFiXpWasLKUCDdylwVs9vml/DxN0kffzoewtyl8uSTE2GqGiNHMgWEstCMQGlsoh6b62ioQ1yX2ZY+XeJOXwgZsI1ycWjv+MZ0SGyDZWNBfLbt4RBstnxteMimn3ElPxX+kGBk2tf/SxjIpNKaGvGqgDHw4nA2F18pPJ/LxgxIBDrnuXjeJf5dcpU/x5hMX86ysKHp3a7Lc/4Tf5E7CfCqcvIxJiMIR5i2uZe1tvfT0JrIZ/1ARw3Z551teUzKl8iuM29UsPxSzadFPsUr7KKdMgQ9IGxhtBYGQXyLnpayPHseBFmJu/S+i4p87NGbRpr+ZfXseFg70Ikz3TdnO30fJSKNw+z0GZRhBLxjlpKg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(396003)(39860400002)(346002)(376002)(52116002)(38100700002)(956004)(478600001)(83380400001)(86362001)(5660300002)(38350700002)(6666004)(6486002)(316002)(1076003)(2906002)(4326008)(44832011)(6512007)(6506007)(2616005)(36756003)(8936002)(66946007)(66556008)(186003)(66476007)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /xFQrLa0TZpu/OE6vG/3vfX2oLHHcYh4thEU3LFYfCLWOTeIxQhlUCo1Aj/lXXo5smZBn4paUiX8X+WH89hbVvdsK1N2xMCuHkiiVJax1ypfnuGMNIJkH3Az/HD61lD7ey2PqIvIBjYK7ze9CHio88DQwpV/bwvO8Ai1icDKMYycWywdacyPZIdvIYonQbORKTEuP5D0APOG2TYDQE32FhysRGBnfxeyC9P7HG5Dnu5Bh6m7D5mvR6HEMIpao2W1P+dNNhdGXGWEkn2n7l+RJCd8AqqrE7LWu2XEbt3oJqq8BDfIwiqAJgTkQKisQfoQCXPyOs+Axf8HGSdEWfk6vqHzCwJUCAJAa3r0uP441/gM//efOhk0cnV+n18ZW4MxGslRxfDW+L8rpGTVlR/jA+YHp5Zd2v3kqkiamrzT0WQ6JX2BK8AQ+zN465yARIvNcAXUVBdIg4QuwWrZtK9h8NbfoDJF9Tmdqtzy6p4wPiTrpUnQgcZvty71QrKEHLJltymp17rpt8Yfjp8eQfDCi9IxUNO9zj4XplXNjnRCarr1LFgimG0JYP2cXW1F96X+Pz13HwAvbH2Qa5PuMN9rWqW/aOtQvqrQ4vbi+NXlH/c5Hhoz6erIRWg3dV+gBWAPS2bHhdq0A7pq/wiuikquus+XYVQPfm47S4r1F3wlwITAIg4wNpARFi635CkhLnPTFBd90+YlZX+dAiyYycWiPSHNa2Tmb30dtBNKpb6HvLK19TPVJ3anhkqp+VRZIW43ikTqd7LlehtAkCOsgr95y0AA6JS1m62aAnVSsktqMeap16reCOPyPaHqt2b2GWoNInrL/GaU36TI995ukiFvxO3NgKdiXgzYnZzVIp2GenqTJCz9DpJG7WVX91GO2o7iD6XUOAJEEyav1H0EMIAidf9d6taWneqZHYuBUPHcbRgIFNJ1eQDnsq645ucbC1AvTY+PUsmQQwCUr9eccCt6jkjMJ4LjXRlSy4c9OFw/gO3SqgUK6v7b+K8NoVR1QE/vP7s4TUTDNGkPzD0pxW1rZBC7X/qrTxSD1fj0eeHcWdxvDvRZ2NQySntHzeMKfsMdXKkTs3EldZqfjpbl4NTKGkIfHPaDv4T3OM3ZCf1H5WX/ej/wwu3DgB1OKSBkjL2VJuzdwWKJ0wttnf3oJa+n6teZqWXbb8tOE5tFGfjm+O6l028ycjS/VVf7ZZwyL8n6AJcBKmeK6vEXy4F44DerIAwqcTcqooEnqpCsfALGY7uoWNojpLd/Im7BMZQNpSfnwT2c2a5Xg6U1237bCUtV6Qzq2DRib00CwGYvfQWy6/5gYGd2UrUTp/j4ENBKunii X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72e5004c-60eb-45ba-27ca-08d97296d592 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 07:04:00.6209 (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: 5aPoSD0DmQmaeRXwuEYU+blUEfzmBtdN/fHPAB72kMk+N1LsF6fFxTJ8OTuma3S3OyTDJ+Yg4PRJhpTeJxm6Og== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 Subject: [dpdk-dev] [PATCH v4 01/10] crypto/dpaa_sec: support DES-CBC X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Gagandeep Singh add DES-CBC support and enable available cipher-only test cases. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 1 + doc/guides/rel_notes/release_21_11.rst | 3 +++ drivers/crypto/dpaa_sec/dpaa_sec.c | 13 +++++++++++++ drivers/crypto/dpaa_sec/dpaa_sec.h | 20 ++++++++++++++++++++ 4 files changed, 37 insertions(+) -- 2.17.1 diff --git a/doc/guides/cryptodevs/features/dpaa_sec.ini b/doc/guides/cryptodevs/features/dpaa_sec.ini index 243f3e1d67..5d0d04d601 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -24,6 +24,7 @@ AES CBC (256) = Y AES CTR (128) = Y AES CTR (192) = Y AES CTR (256) = Y +DES CBC = Y 3DES CBC = Y SNOW3G UEA2 = Y ZUC EEA3 = Y diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 411fa9530a..4aa16d6915 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -73,6 +73,9 @@ New Features * Added event crypto adapter OP_FORWARD mode support. +* **Updated NXP dpaa_sec crypto PMD.** + + * Added DES-CBC algo support Removed Items ------------- diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 19d4684e24..af5c7c499c 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -454,6 +454,7 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) switch (ses->cipher_alg) { case RTE_CRYPTO_CIPHER_AES_CBC: case RTE_CRYPTO_CIPHER_3DES_CBC: + case RTE_CRYPTO_CIPHER_DES_CBC: case RTE_CRYPTO_CIPHER_AES_CTR: case RTE_CRYPTO_CIPHER_3DES_CTR: shared_desc_len = cnstr_shdsc_blkcipher( @@ -2043,6 +2044,10 @@ dpaa_sec_cipher_init(struct rte_cryptodev *dev __rte_unused, session->cipher_key.alg = OP_ALG_ALGSEL_AES; session->cipher_key.algmode = OP_ALG_AAI_CBC; break; + case RTE_CRYPTO_CIPHER_DES_CBC: + session->cipher_key.alg = OP_ALG_ALGSEL_DES; + session->cipher_key.algmode = OP_ALG_AAI_CBC; + break; case RTE_CRYPTO_CIPHER_3DES_CBC: session->cipher_key.alg = OP_ALG_ALGSEL_3DES; session->cipher_key.algmode = OP_ALG_AAI_CBC; @@ -2218,6 +2223,10 @@ dpaa_sec_chain_init(struct rte_cryptodev *dev __rte_unused, session->cipher_key.alg = OP_ALG_ALGSEL_AES; session->cipher_key.algmode = OP_ALG_AAI_CBC; break; + case RTE_CRYPTO_CIPHER_DES_CBC: + session->cipher_key.alg = OP_ALG_ALGSEL_DES; + session->cipher_key.algmode = OP_ALG_AAI_CBC; + break; case RTE_CRYPTO_CIPHER_3DES_CBC: session->cipher_key.alg = OP_ALG_ALGSEL_3DES; session->cipher_key.algmode = OP_ALG_AAI_CBC; @@ -2667,6 +2676,10 @@ dpaa_sec_ipsec_proto_init(struct rte_crypto_cipher_xform *cipher_xform, session->cipher_key.alg = OP_PCL_IPSEC_AES_CBC; session->cipher_key.algmode = OP_ALG_AAI_CBC; break; + case RTE_CRYPTO_CIPHER_DES_CBC: + session->cipher_key.alg = OP_PCL_IPSEC_DES; + session->cipher_key.algmode = OP_ALG_AAI_CBC; + break; case RTE_CRYPTO_CIPHER_3DES_CBC: session->cipher_key.alg = OP_PCL_IPSEC_3DES; session->cipher_key.algmode = OP_ALG_AAI_CBC; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h index 368699678b..216e8c8b6f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -456,6 +456,26 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* DES CBC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher = { + .algo = RTE_CRYPTO_CIPHER_DES_CBC, + .block_size = 8, + .key_size = { + .min = 8, + .max = 8, + .increment = 0 + }, + .iv_size = { + .min = 8, + .max = 8, + .increment = 0 + } + }, } + }, } + }, { /* 3DES CBC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { From patchwork Wed Sep 8 06:59:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507901 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp334893jai; Wed, 8 Sep 2021 00:04:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwG7rD7LatfuoSDN3biPEybadwf7qm9FlFrM2LTSK+1L7TvKE5knrMaK+fa+qipUYTDQH3g X-Received: by 2002:a17:906:a012:: with SMTP id p18mr2511054ejy.331.1631084647576; Wed, 08 Sep 2021 00:04:07 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id y12si1406144edd.393.2021.09.08.00.04.07; Wed, 08 Sep 2021 00:04:07 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=QHPQa61M; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D30941134; Wed, 8 Sep 2021 09:04:04 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60046.outbound.protection.outlook.com [40.107.6.46]) by mails.dpdk.org (Postfix) with ESMTP id 6C9524112E for ; Wed, 8 Sep 2021 09:04:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NI69GCMtnLI6HRatZVCpthhyNzdUxFjdRGn3t2SPeOCV8kPbXKeacAfL7hh5ayNuJdaYtJX5H1hi5e006OeMckX4gY8jja7Dml+pu9Fo/CVpVUKnmqq3DBSIvFj9gFCweCICdfI9UFAsjW4dV30p2HO1E3PIhjyBRHVf7HiAZc39POeh3Np4brG4jyTfastWkc4wItPwYXduTOEeVSRPhN1onIugvWY07j2R12x4tMGcEIdhRUXCyKh3hTBdRSYv/mxxrBr1OYwdFlEZMz7WqTouxhmjG0Y23tcX/4EbQZF+asNWHMaaTmNApwYLfBCs7yzy0EBfpnNlqWfX2h8M8w== 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; bh=d4O+ADMW8bsB9QHVli2s8cNEqht216Gu+5l9qki2DF0=; b=EeqPBB+sF4HZMLdU3sNOPvN28qH0NIGTwQz1KxT4sbWmrrepVNzWErUsIGHnwjphv6gi9/SnSB6w7WqfpgpafQ1eatU2/cXFByAuuQkqHoiD3m3kMIFinYwqxl/WLxE9T/xJzpXBpD8TdQwod9G80gVIDitKp8QSwGxG5O/q5itYdpdq3hylrVJ0X6YJSPE/Bk5Wu8qRK5F3Wk2e5s6XXYkcmXOe+JT9U1KCNEiZnlB7AjSeIf4QK+t0hefkA1cj290Q6xIko4kE1PZg0t9/ZF0B7NADq3j6aXwjACEYnEq5JT86omkd9EvaIarOOsbZyWHTimEQX1hJxDpnyjAN/w== 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=d4O+ADMW8bsB9QHVli2s8cNEqht216Gu+5l9qki2DF0=; b=QHPQa61MHY4GMjwFJhgf2Yb2RmlJAnqEGv9jHgED5U4Q/0D5Nw1xlKCHoAkfpU1Z2NmMWawarWEHavLB023VNlgvrc9RO2/yfuvffQhKWlVtz7GI4AouufBtIkvH7zLJ61FC6+qFtYTDQ5O6xx19Ri/pjNv0rq2qG/AcXOhYQts= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Wed, 8 Sep 2021 07:04:02 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Wed, 8 Sep 2021 07:04:02 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Wed, 8 Sep 2021 12:29:45 +0530 Message-Id: <20210908065953.28349-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210908065953.28349-1-hemant.agrawal@nxp.com> References: <20210907083953.8948-1-hemant.agrawal@nxp.com> <20210908065953.28349-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 07:04:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7a95d4a9-ce4b-4579-6c1d-08d97296d6ac X-MS-TrafficTypeDiagnostic: DU2PR04MB8903: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fv5NDgUFQTutjDl+K72T0+QMtCBWMtjWVK6uzQHgOGDjdjyVx1XDENEtmZNdmjHDa6u1iMO9q0+vdWIuJSEFG0TY011NkQqq4nS2Vp7gshEgz9oObTYnP5Hd5jEcB4oqHs6kNAF3rtpJZo76xftMnUs1t7eyqRpFT/hLrku5bHl6rnOMjH47A8bsQXLSKXEmo28+bC4bI8Rj/x7USHkwJu4HBLaExrbJsi9U18rwIXbHTcJe5rlARllxkpqCq7VJLZgttGneZzLS6yEYd6C5/gYY6G24jgZNdasdnNcEqDu9kLF6kwr17Ojl3XhOo0bIRQV/Sp1YSkxLQ3ltwezpTJMXegpnvgafVAP8ZlHzOvKIC5ZKXB62Q5a88kOXnevXSIXnDogYprNooGByLSEuUoryLdPW+Zh6O2W8gnqCezXAyicme+58HScHmB7pusIVQobfkflvp0oOe06R2pOvORxLulJ5ovCtTRi8FMFHDs4XRwq5UzX/pUtxTwY2UWLX+4IvwFkyhJArMAQ/slaPEGOZK5p8uJukCRx1NWSbyPqAaxWHNYFuL9zkFBjp8umpMMeqyFUKU2VdyArXavX+J87/MdcQzT/6+66eIVOlOl0NMJf2gL02Qj4heA50lzfUMU3oJZ0KP6m/qu3UEdcVRT2BgkJHPHrlGt4+CLreo8Bx/H8duDO4OVvyQenzg/yiFga4wK8drP9upsv1PxyGdg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(396003)(39860400002)(346002)(376002)(52116002)(38100700002)(956004)(478600001)(83380400001)(86362001)(5660300002)(38350700002)(6666004)(6486002)(316002)(1076003)(2906002)(4326008)(44832011)(6512007)(6506007)(2616005)(36756003)(8936002)(66946007)(66556008)(186003)(66476007)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yqN9G/pt+0gVqhdoYW4/7LzMZx9oo3rFD3+fDYUjJ7bzt1Lj7oGBeRHuS9jzWJvPB4OaCmUPgp9x35XZMy9D2aZTX/P5wMZLnc1pvN/zc1s4rgEPRs/4/b3paMBw9TLXi4WZIUkZPICV75y9MmK6kBJA/5tNXFq1DDJG8z7J1+ed76MkNgQmK9kafna5ZtvwRvjak/F7d2MUNnDrUaAGg+0DE2xAKSdJZSg+ddPrvqsOHCjIl6ITiLHwkjkm6+ByEHMQyqZAbikRMSqVXOoHlvhpMlXrcchZERNU/+D95K/jg1wxtkUVJDipYTcK2hA0XuEUHShy+23OJkHoCv5JfqS/HAXrmXZ9DqmwVloqH50lIZjm6Z+6PmPL9DMTlG3wSO5gA/0z1eGlnF8cmNNKpjRxPp1Bb9xoUtj4eSTpzQRe7zK6g1FSRAQhAollV4LUX1CwYVvekIkMK/OarHAHD4HJeffRnkv/ptXj1M20Gunpztjd6teomfnpMBEK/EAZVnZ8IC90aX1GX+VNKHoz/vnNQXAJnsLmEETlH5sWyg5N2WvqU90lW2JdwT98+4ciPmMqnBpkcUsnvfohA2VU8OjTjEH9K36s1O2kpSk8/Ot/ptdLrtLEmIxV9Y4q+hcKcvnLRVLvWFhjg32LXtOlStlHrgj4V+lxib2udjOmjODmObspRnpQGgvV30EAosap7ac7wyJ/GE0VkIJytyWZVATMhTEVu44/8P+tNpd+fawx6QFHasflfy3tIgMAFn9eWl9Mq7VDtNrvKspdNQnJaH/TT2aF6QV52cPx5TAcFcdpLt6hwM/pVXCJRdwQAo5Lvr8oJd5NFDPtmpis62VCWYNJGRKa368v3gFdjQNy0pG1FsH9fIvFshha75bQHGulrfFQYOwydRVD/W7xHVnmbBQRkoEK9KylmMgzvQ0JcRWfZQXRsPQ1J1Qw1B0BLs1LrXIp8kRxHhXDop9DVH/7UKsDJUOYl3yS5w02mikM07UAb0JkJ+qFgKGmy0WN3JJI9zlF3MRqEVBp/Zbm0kGi3uA44PEA455NT3nNH7v56XuoA0pGH9J3jJgp65QZvYpmgbwTtlljGzJVEI33CuH90OMnGLkg9aWJAutytN+DYOrlC+f4ilKabrk2odbBWf4WHPP1Fha0Jpp78lS8+5iDab5xr9O2Rj2lzQzdOwawlQBHKEQapkRfjnj5tcTjH8wV5messyfXwI5Qy2FCdlSdnEQgCwka4UBuP5MtcSMdAHvhEe1K2Df2+RGkBtfQNFvWe50xvcOTaL/E8FdAPorygthwuMCGLgE3Wb7P+kiexrDIKZ9dSz2rFq5/KsMBCqwb X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a95d4a9-ce4b-4579-6c1d-08d97296d6ac X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 07:04:02.4021 (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: WpTfwKMuHMzaoXW5DKhnmQvKqPX+JMBITyEHq9QpADtaK7oCkzkYzVnkoQIY4Uub8UZJqVXY3P0lVcZ72OJZcg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 Subject: [dpdk-dev] [PATCH v4 02/10] crypto/dpaa_sec: support non-HMAC auth algos X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Gagandeep Singh This patch add support for non-HMAC, md5, shax algos. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 8 +- doc/guides/rel_notes/release_21_11.rst | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 55 +++++++-- drivers/crypto/dpaa_sec/dpaa_sec.h | 126 ++++++++++++++++++++ 4 files changed, 181 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/doc/guides/cryptodevs/features/dpaa_sec.ini b/doc/guides/cryptodevs/features/dpaa_sec.ini index 5d0d04d601..eab14da96c 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -33,11 +33,17 @@ ZUC EEA3 = Y ; Supported authentication algorithms of the 'dpaa_sec' crypto driver. ; [Auth] +MD5 = Y MD5 HMAC = Y +SHA1 = Y SHA1 HMAC = Y +SHA224 = Y SHA224 HMAC = Y +SHA256 = Y SHA256 HMAC = Y +SHA384 = Y SHA384 HMAC = Y +SHA512 = Y SHA512 HMAC = Y SNOW3G UIA2 = Y ZUC EIA3 = Y @@ -53,4 +59,4 @@ AES GCM (256) = Y ; ; Supported Asymmetric algorithms of the 'dpaa_sec' crypto driver. ; -[Asymmetric] \ No newline at end of file +[Asymmetric] diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 4aa16d6915..88c2a31d49 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -75,7 +75,7 @@ New Features * **Updated NXP dpaa_sec crypto PMD.** - * Added DES-CBC algo support + * Added DES-CBC and non-HMAC algo support Removed Items ------------- diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index af5c7c499c..95b9d7414f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -489,6 +489,18 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) alginfo_a.algtype = ses->auth_key.alg; alginfo_a.algmode = ses->auth_key.algmode; switch (ses->auth_alg) { + case RTE_CRYPTO_AUTH_MD5: + case RTE_CRYPTO_AUTH_SHA1: + case RTE_CRYPTO_AUTH_SHA224: + case RTE_CRYPTO_AUTH_SHA256: + case RTE_CRYPTO_AUTH_SHA384: + case RTE_CRYPTO_AUTH_SHA512: + shared_desc_len = cnstr_shdsc_hash( + cdb->sh_desc, true, + swap, SHR_NEVER, &alginfo_a, + !ses->dir, + ses->digest_length); + break; case RTE_CRYPTO_AUTH_MD5_HMAC: case RTE_CRYPTO_AUTH_SHA1_HMAC: case RTE_CRYPTO_AUTH_SHA224_HMAC: @@ -2080,43 +2092,70 @@ dpaa_sec_auth_init(struct rte_cryptodev *dev __rte_unused, { session->ctxt = DPAA_SEC_AUTH; session->auth_alg = xform->auth.algo; - session->auth_key.data = rte_zmalloc(NULL, xform->auth.key.length, + session->auth_key.length = xform->auth.key.length; + if (xform->auth.key.length) { + session->auth_key.data = + rte_zmalloc(NULL, xform->auth.key.length, RTE_CACHE_LINE_SIZE); - if (session->auth_key.data == NULL && xform->auth.key.length > 0) { - DPAA_SEC_ERR("No Memory for auth key"); - return -ENOMEM; + if (session->auth_key.data == NULL) { + DPAA_SEC_ERR("No Memory for auth key"); + return -ENOMEM; + } + memcpy(session->auth_key.data, xform->auth.key.data, + xform->auth.key.length); + } - session->auth_key.length = xform->auth.key.length; session->digest_length = xform->auth.digest_length; if (session->cipher_alg == RTE_CRYPTO_CIPHER_NULL) { session->iv.offset = xform->auth.iv.offset; session->iv.length = xform->auth.iv.length; } - memcpy(session->auth_key.data, xform->auth.key.data, - xform->auth.key.length); - switch (xform->auth.algo) { + case RTE_CRYPTO_AUTH_SHA1: + session->auth_key.alg = OP_ALG_ALGSEL_SHA1; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA1_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA1; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_MD5: + session->auth_key.alg = OP_ALG_ALGSEL_MD5; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_MD5_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_MD5; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_SHA224: + session->auth_key.alg = OP_ALG_ALGSEL_SHA224; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA224_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA224; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_SHA256: + session->auth_key.alg = OP_ALG_ALGSEL_SHA256; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA256_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA256; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_SHA384: + session->auth_key.alg = OP_ALG_ALGSEL_SHA384; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA384_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA384; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_SHA512: + session->auth_key.alg = OP_ALG_ALGSEL_SHA512; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA512_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA512; session->auth_key.algmode = OP_ALG_AAI_HMAC; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h index 216e8c8b6f..d500a4c246 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -240,6 +240,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, }, }, }, }, + { /* MD5 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_MD5, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 16, + .max = 16, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* MD5 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -261,6 +282,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA1 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA1, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 20, + .max = 20, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA1 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -282,6 +324,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA224 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA224, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 28, + .max = 28, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA224 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -303,6 +366,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA256 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA256, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 32, + .max = 32, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA256 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -324,6 +408,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA384 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA384, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 48, + .max = 48, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA384 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -345,6 +450,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA512 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA512, + .block_size = 128, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 64, + .max = 64, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA512 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { From patchwork Wed Sep 8 06:59:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507902 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp334953jai; Wed, 8 Sep 2021 00:04:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCFsVJX6+wzMUQkDSL2kMH1KdINpJJP76V3mS86P2nL/ca2TY8JIlsexqt7ttAzU5V7a/X X-Received: by 2002:a17:907:7817:: with SMTP id la23mr2610926ejc.43.1631084653385; Wed, 08 Sep 2021 00:04:13 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id s9si1192826ejc.456.2021.09.08.00.04.13; Wed, 08 Sep 2021 00:04:13 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=IDmxMBHp; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B57884113D; Wed, 8 Sep 2021 09:04:05 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60079.outbound.protection.outlook.com [40.107.6.79]) by mails.dpdk.org (Postfix) with ESMTP id E9C3441139 for ; Wed, 8 Sep 2021 09:04:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZsBRWCuHg8GguZttNkMJGWCqVQQ1uRqeQZrtGosFbw6eRlUa/moCJRGDptE3bgK/ro5FTBnUUCKjd4S+w/ozA9GUtj/dcuthBf7RRh8SWFH/DldDJDWU4z8x/Y8RA55PFPUKMH0DDuCNB4Mcy2ukbhlRwk9HyQw6imi8NZcSl7i7ZcwAAer8nzMODyFaQ7/OGERboz2YDK50YtVw9dwVaprDEzkcT0CmUs1MwnammhcrEaXnokEaqKZSqwFjbwLoslt+YTykpPvaUYCOFcC3ik6uNYbzFFQZbM7ytt8CP2kmWQd8xjV2Cp8qlEfaGdibhaXef3dOjoaR4MMLCDJOHg== 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; bh=KEomj0Vd0vaEBxtfsU+K+9B5NMvjws9DUNkRgkzvrgw=; b=bCqfiKyBdAQ4WJ8CGHonRqj/bJxrGW1KvVUbLnfi/wEZ4AFFcPDOAA8VwI6LUvqP55b7t32uuKDHt9FkDmYY9HD7p2zcINsK1pRYKHmwDm1MRwLSzvjTfyCoqs/15NwytAIORmTwMS7S1vH7J70nUYLqyq+3asZF3MLFrhvEWHTD7ibOuo4Erc5PGOXkVpiUXzxvv7t/T6ezWVRMWN5WE56j6s6mJd4pRIOQuJjf+0pvwGjcjXBBR/Iw2lh37pdQT7ZxjvRS5rUvCzt9jgRpyeQJlNtss++TRQfYbFh9e/+QCC55logYRXvooxOJprqaNBJcDVX+2+Ew3Q5gDDV8RA== 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=KEomj0Vd0vaEBxtfsU+K+9B5NMvjws9DUNkRgkzvrgw=; b=IDmxMBHp6PUUY+h+FWWJBG0gSpx0z8tpEslUD0FIR9EnYQze9FPptrui+dES67H3DeEZYMdB+96ZlqnAZ8E3ZdcxZqtFswoL/uqT/7SDqAtf7eWY0GfwTCf2n8TXzgfG/AsVgmVYRW5HCzz6SkAwV45CXQtySDOmbAdN/qwsjf4= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Wed, 8 Sep 2021 07:04:04 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Wed, 8 Sep 2021 07:04:04 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Wed, 8 Sep 2021 12:29:46 +0530 Message-Id: <20210908065953.28349-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210908065953.28349-1-hemant.agrawal@nxp.com> References: <20210907083953.8948-1-hemant.agrawal@nxp.com> <20210908065953.28349-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 07:04:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33da4313-71c7-4f15-0b12-08d97296d7c3 X-MS-TrafficTypeDiagnostic: DU2PR04MB8903: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1122; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5thAaSr550hFLyCSrEU63Qc+yZZC7zdQYmBu7YzDKD4vqLbb1vbL1xuaZohsGD1yxUsw89ScFo+nkK67n4K8j38PJHuUpoUDqEy55+/LEROlnJpYk5XLHV21PbG9gEBKtodftUoUPaA70s416S9z7k5d8vSRvH2wDXqOcLvaHwhGDEMwKWsLYPxkt98NWgohHy2zEPejEQmft58qWse2FLMAZqFKbc5rAQw9cwReJvWdjjhBxctYqWL8QMxsRN0XcnIjpjibUgEnYohsElM5WD/bGF6lDUdnvrD0swN97EdwjX33IMwfYpaSR71w8k4GUeMssKyXG1HnNmK2ugzb3VKHSiOOBRCaTl1gQJvlMJ0VwUneeW10xcWfli8SzIsppli4g6vuL136HFM4bJuAw9F0HDh+wBh6p3t2cuTAd855XA9D6wETZREGrqh7jPWFAIX8zCB0Sg2yxuzjH6ntn09RjRNSvScqJVtjmlfy35KJmq+9EIMsW3+ZiEX/qVUq51WH652q3/oqokp5wS1drGoATSv4DgPQniS0uCLPJ9E0PXWf9Q8k67f7eYoQo0EeoX0bHT7r0Cc/iL3/S6f0DquyRLGaYAOhrrbnux5Le/DL+9Pvb+jkMd4FMn+Jb/28Vc9SP+7XEKZ5fdxMXYWC6Cptkvp4+wXEpGA877Ka7M/Jl3y1Mr9feW0C8fsG+m8YK466Lu9gQjGrTQ4BFgFGQA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(396003)(39860400002)(346002)(376002)(52116002)(38100700002)(956004)(478600001)(83380400001)(86362001)(5660300002)(38350700002)(6666004)(6486002)(316002)(1076003)(2906002)(4326008)(44832011)(6512007)(6506007)(2616005)(36756003)(8936002)(66946007)(66556008)(186003)(66476007)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vqHvdynldmcCGHXZxL/gPM2bbzNwTVzhAMMzNUDBKF46jPavWB8kM+MonhdP7yHgb3zbMOFSikE59xSmpddPV4WmDqtovM904qQgHPnFqOq53Bp+8Xw0DX+T1fS6ZRe+QxY6JDWykBocKEzZtNkF0xnmujpIosjNyTYmIsrmVA/JgqkKdLN1Jqml0KAPeJZNfBV8zpYKuUEYf0lB6tEtDyeLGeZXCBqh3/MQ4aKtP5ldW0W+h64XuRzBaFd8ovprqQMaHpKDgAQohGPyrgae8U7vDoC2iBrcf7ouY+jIiEPAxjNxHk7TOnlQhstcuUC6wnybAWiDVj5EvIc0DJ+cp0aPgAgYVHr76ibyYaZaEAtYbc/DxDii+vWKyBpPHi7ElsQ1GONZlPEUTmfBDVksH7mpSYkV/cpqy45EP1a9GYKvFihViRrzhZPY0/oT0QIQkKO9Epa6sVGE9gaY0rX7T4LcBaLGiI8knj0j3qXbihPTxg70ums/+l9Ejco87GSUz1qOtVc0y82lBH15fnzt2CF3cvTbP4iABoog/QYqs+QN4dSH+vCtOewivenanvxWeioYnHWrUDca6GE9Pe8dLpO9uTvDrIzIU8ful746Qu32gLpf/eRcFq8+MSVZyHsUkyk/JsBKizBkS7uZXFQEqUINwh71lxkDpWqoOJBmH6JVz9UJ/XNLGWroquS22k0m+6SKxyxRsoYnTDwsYE/mk7KOdz2N3t28hF4PvJUyval0z93/eOd/yvVlRZDgqSOfYIZJJmwTWo1UgN97tOhJXNG4eEBJ6Im/PukIfrkINhQPxt0UE13k9zwxbtR3NKXD5I21EPBl418QXUI+9TKOM0alPwKMx7FOm7Aub8ot2U+nstBrnoCaUpWyLlPVDksWXSmNEULSpynafs+nyim5kEiGYdWzjehCC8J9vVmUH+mw5x2BgonI5APp+L5evHlE3cSlubOaiOx3Ct8qosBXukKuMqKeXuWT2J/F2/3Qevw+DFcqMAZa/spgS3loQROGA4WD6Z8LPxhpWMnAztHO9xrwhToOAlNNcgOTd5JlDm7chzSiATOWfAOkpoLa86lF5RN5ylQllHTyGoq6hFn3+sIQoo7EFNwOSqlHWTLjLf6cWTgIVGJ8W7F7ruNIbrJM8t/6sFy9RPkZcx+Uny9KEHacJdXPMqpYA7a+LouD8G1Rm2ryq7pqm4CcOTUKr51rF4MdmJ/hM7uFA9nKZlEsGhVQglJi6nU8ZxLHIQb26tDjUgMDHMTN6tzByEx0ONI0JhE+qvCZG66zVOGu64PiEQWJq2onbvIsdMNuKzIAPtz8eFS6NSus60d9njXwjpfk X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33da4313-71c7-4f15-0b12-08d97296d7c3 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 07:04:04.2798 (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: GkwuCLWfN/mxHMS9osCzqCzHcn0OiPa3wSSsvpncPXpd5biiipDEKgp9yjFsg+EXgIe0ohYrctHvtG3jON6JAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 Subject: [dpdk-dev] [PATCH v4 03/10] crypto/dpaa_sec: support AES-XCBC-MAC X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Gagandeep Singh This patch adds support for AES-XCBC-MAC algo. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 1 + doc/guides/rel_notes/release_21_11.rst | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 21 ++++++++++++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/doc/guides/cryptodevs/features/dpaa_sec.ini b/doc/guides/cryptodevs/features/dpaa_sec.ini index eab14da96c..d7bc319373 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -47,6 +47,7 @@ SHA512 = Y SHA512 HMAC = Y SNOW3G UIA2 = Y ZUC EIA3 = Y +AES XCBC MAC = Y ; ; Supported AEAD algorithms of the 'dpaa_sec' crypto driver. diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 88c2a31d49..b0da7e3135 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -75,7 +75,7 @@ New Features * **Updated NXP dpaa_sec crypto PMD.** - * Added DES-CBC and non-HMAC algo support + * Added DES-CBC, AES-XCBC-MAC and non-HMAC algo support Removed Items ------------- diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 95b9d7414f..fc9c3a4c2c 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -527,6 +527,14 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) !ses->dir, ses->digest_length); break; + case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + shared_desc_len = cnstr_shdsc_aes_mac( + cdb->sh_desc, + true, swap, SHR_NEVER, + &alginfo_a, + !ses->dir, + ses->digest_length); + break; default: DPAA_SEC_ERR("unsupported auth alg %u", ses->auth_alg); } @@ -2168,6 +2176,10 @@ dpaa_sec_auth_init(struct rte_cryptodev *dev __rte_unused, session->auth_key.alg = OP_ALG_ALGSEL_ZUCA; session->auth_key.algmode = OP_ALG_AAI_F9; break; + case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + session->auth_key.alg = OP_ALG_ALGSEL_AES; + session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; + break; default: DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u", xform->auth.algo); @@ -2249,6 +2261,10 @@ dpaa_sec_chain_init(struct rte_cryptodev *dev __rte_unused, session->auth_key.alg = OP_ALG_ALGSEL_SHA512; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + session->auth_key.alg = OP_ALG_ALGSEL_AES; + session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; + break; default: DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u", auth_xform->algo); @@ -2688,8 +2704,11 @@ dpaa_sec_ipsec_proto_init(struct rte_crypto_cipher_xform *cipher_xform, case RTE_CRYPTO_AUTH_NULL: session->auth_key.alg = OP_PCL_IPSEC_HMAC_NULL; break; - case RTE_CRYPTO_AUTH_SHA224_HMAC: case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + session->auth_key.alg = OP_PCL_IPSEC_AES_XCBC_MAC_96; + session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; + break; + case RTE_CRYPTO_AUTH_SHA224_HMAC: case RTE_CRYPTO_AUTH_SNOW3G_UIA2: case RTE_CRYPTO_AUTH_SHA1: case RTE_CRYPTO_AUTH_SHA256: From patchwork Wed Sep 8 06:59:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507903 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp335044jai; Wed, 8 Sep 2021 00:04:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUB1mr1hLZ1+B1VoF/2gXn9QkeaaRua2uoF3KlzIEeyhCottNioa/rKX0nqVDOwk0OcY8B X-Received: by 2002:a17:907:7703:: with SMTP id kw3mr2559706ejc.34.1631084661112; Wed, 08 Sep 2021 00:04:21 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id dm14si1451641ejc.226.2021.09.08.00.04.20; Wed, 08 Sep 2021 00:04:21 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=FLc8eH+o; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 38FCB4112E; Wed, 8 Sep 2021 09:04:08 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60051.outbound.protection.outlook.com [40.107.6.51]) by mails.dpdk.org (Postfix) with ESMTP id 2BC034112E for ; Wed, 8 Sep 2021 09:04:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jOwOuNc7uFnhVUUyjRePU7FMIpcX2gHpwtMNExSa0A6W4d5CjPKG6711JI+LKjUbEUl0WhiSXVRRvmUp91yJU/yZ7Y1A/nF9rZGzPQ4fdSgh6Tz0AbHr6FhHbqS7cAKhOLYN/eC6oIkpnFAKQ3pGP0NCBPY8A1GmRN1yEiPO5bY+TxWGbFQwVuRJK9tQnsuAG/ANrlcZYdKjZjT2T7ohZNI+Eo764iJwTmcbzuCCaHGwxMKaRYgtFj34sAOg61dhIslU2EbIjUPVv+c3ZS9iylN/Lq64Jk/3fsrlD7oQJ7ATi0GH3/nhb4kBYCKt+1eAkNlqBVVVAzP5T4JX46pisQ== 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; bh=tf95+5hllGDtu1dcnGmZs7QJghQfh4G1qsqEqSKg/BA=; b=agucdvYbf5Yfx0ng74hRcHzAg8ZL4McfIKNl98tT/bWU+ysNe4nOj0wtyltYkX38JZRRadih+hPrGwhmQ42L8jyz1S5yFlFtZBgyYXKSsNs5PYtUgu14csZHELwQ6nOqtD3iwDdSwiutXLwkucC60K7g4i1DMem9htHm2zRMx9ie0/H1sA3yqpwy/bjWmur9z2VgmXQW9hg+Ui53pTTqZ7KZffbqRs/8ZdZ55cha3KN7w+bfc89GYwr5KykmJt7Dwhi60wIbgDX9IKm4ENh+ZW0jws0ogCiMGZWXuSitEfCx/iVKTcJhS4CbgUwh160vl4Tp1c9xTbj5Xcnf89YeOQ== 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=tf95+5hllGDtu1dcnGmZs7QJghQfh4G1qsqEqSKg/BA=; b=FLc8eH+oUqQlp+jUuEZV9l0KJWtEhszXsfNPbzLwMhSDxZe1v3VhwyLPaFrpVneRhPabeN9JarkSQxgziEkxWZoSu57vLKyrjjzao7n+K5s/hiJL75l2fTOGBp8IhQ3TBgDod0BXEWObKbTgc45JnJxOwVTpXcvwZiSi9CYNi3Q= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Wed, 8 Sep 2021 07:04:06 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Wed, 8 Sep 2021 07:04:06 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Wed, 8 Sep 2021 12:29:47 +0530 Message-Id: <20210908065953.28349-4-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210908065953.28349-1-hemant.agrawal@nxp.com> References: <20210907083953.8948-1-hemant.agrawal@nxp.com> <20210908065953.28349-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 07:04:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ac6b54b6-a759-4063-6238-08d97296d926 X-MS-TrafficTypeDiagnostic: DU2PR04MB8903: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:359; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T60CChLvasO3PoQw7vkjhdUndSsm/ay+LZV8N3geUrL/5WMa7M+1H+O6LAsGkaj6tN8hY9TBiTbGVprsQNa9f4bJDcR1VmOWr/7DoYyCqQ6aa2ySxL6HoukJyajAYHrGnGGvVlOWWXe4hRgsonMM343iC4NJ+oMjk1MuIlx/el9bupbZOk4Mtji9EB333zx8ezJVnPwzP89hRrTvSqRczwy0csDv0tY/x3bEb/1yNZFoze09BKLcUdqb9Msc+w2bQ+sTQTQu5xn9BizTP/Da/1qZz/ZI8U9SpJJRbG6ZzwcjuMiMXgt2D9nU9h+0Dd+mVWJPO9D8nYCGau+SqADQ6lRdbN5g42G8DtHmKBbFSbvEyta5BR+/yOWU7Vh+6ArDCG3KlCC2Rj+wYzM0kQ2AcB85FGlYv8+SY5vDOJHzx5KywJza508ujmXKsDnPux6zt9Muc8tstl6VSeTeQhdR0EM/CxiGQBh2IAHvG5D+UceNRGLvjcqpKwwXt4x3Epm3/ZC2gTqLgElbvHnK4t/cuGeHVXTjyLWDxuN7AeHp6HtH18ySJJBnuWo7D9t3cAwNmGjBpskKDKJflw6PanHrSQkchOW/jlBcvLTCWyA4/vykfrsi3g8GKiJbhu3qxxkQd3cND+4Re93TcV1ET+SNUwCjlIyCrI+WufsYw7Q4L/Asr8h9NY3aljnCz65d8Qd36J6QQObS03Crtkq7mPAuMQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(396003)(39860400002)(346002)(376002)(52116002)(38100700002)(956004)(478600001)(83380400001)(86362001)(5660300002)(38350700002)(6666004)(6486002)(316002)(1076003)(2906002)(4326008)(44832011)(6512007)(6506007)(2616005)(36756003)(8936002)(66946007)(66556008)(186003)(66476007)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jPoPdy+OorYJZSbTz3EiZPxVJ4rv6N5J+cRDANKL4e1HCwaiPjB26nHPazyS2CZJMAThNL+NJm1sKC7Jfo/fmthVx39NFNWDirhfqxMGqibzIr15WF6ty3tvecQbv+5yjHf+dReVK5sp56IM2Esgf//j1sb74U8l4b3ZCoQGOdXTbXRljYFHFL5Vm9fp0Ru7CwPJGPyXEAvwuhd/Ipeo1EeAC1UtphrIkM7rlTwiA9Ff7wbJ1WronMzEdUKUIwN+Qrtd6w/IZXpYBm0OMi/c9YDmJzvtW4nBMj4kTzJNrRbaBcHSLbS/1ewe2GK1ZEABDQ+Uwcrv730nmD7jfQfMJqP5nd7vMqhVwTJ1w0dInxMufmPbmEHxYDJYBBXHWgrzQUJHol7/HskjsxCSOAJO8UrPSqFWA5F7okGaVJXVSqgWJDboJOsBAQIGDBt91oxb3zU8ooFVcVA22avo+SB8A+1KV7W4gNbLDTpvdPuSfnJnfFn25IAZbMAh3zR+SDdGtsRJ6G2BXv4QcvxHlwxyoPr2ZS1aB4qk6g3zHE5zpY22xmxRSZycT6B9UDNJhlz+MgSSMmmR7ge8ZB0EP7ZrV96uCwNlqh/SU8+Uk5yOERDGKbghGMaLv22kk9rTQ+bafiCv/mRRKm13S+NaUerpd9ZrbryX/OOUxDiVThKM1V2Z9ImJwOoP35Ddw6EJ8B/qQidzxmitTekIOsjK4Mrd4xtcOyY8uMKdD1SNafotEVu6n7mmSCtYo61ifiCSZQiUUpglGWL7fA+2HYPxLxNQp74ikTikJSHXris6a+6xuxPpnWB0I9qJLeN1GwLF0WgGJcYUak5dIvPAPi16g/PL1h5h+p9cofKoTYSg6h9CeYwB4V6tq9ZDSWNJW2dJQzF3ZODJhja5F4McnLLF11eaGaMcEhi2DZr+g44d0Zn6C+RC0L206chlice7ZYWxS2u5FQ0mvztp9dnbaZpUKMo5+XTGpIkekqJTnNsyiAainE8m9KbY6QOm9KxHCcU2HyWriPCQb+QgEgXHjYVbL6GbBZcwvQxiNMUjhb08CXN7ihPQmLe4O9IARP/MIoTTel1rEr8+dKFgih/rfqGD+s+BMgYc3Lxw3Pqi44SfXtCeX4fFs8hsJ5fQ4RcCmnAZ0IbLk2opVJdvVhZDgYptIAk27U3HoIm3KRiT5ljAociOo/uFAuB8nJmZ7b3CQjTWAf313/lbyVQje4O81U1YbiWlyC7dqdoYxia0NTJJ8f4nv+U1UZSG+/tCRZhI7NRig2IB8vDgblRXKezaVpCDmSNxbsFopXEukM04JUuzsaNAsOtw8TD9ZSNKGRFdDsQY5tlw X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac6b54b6-a759-4063-6238-08d97296d926 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 07:04:06.5309 (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: csdX7gvXLz+RcryUyAEC+ETI92bWm+qunyJfdgRwJ6eVm7g0cypqlsyBYKGzgZ9ioEuNvHUPuqTmyQskDFUq3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 Subject: [dpdk-dev] [PATCH v4 04/10] crypto/dpaa_sec: add support for AES CMAC integrity check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Gagandeep Singh This patch adds support for AES_CMAC integrity in non-security mode. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 1 + doc/guides/rel_notes/release_21_11.rst | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 10 +++++ drivers/crypto/dpaa_sec/dpaa_sec.h | 43 +++++++++++++++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/doc/guides/cryptodevs/features/dpaa_sec.ini b/doc/guides/cryptodevs/features/dpaa_sec.ini index d7bc319373..6a8f77fb1d 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -48,6 +48,7 @@ SHA512 HMAC = Y SNOW3G UIA2 = Y ZUC EIA3 = Y AES XCBC MAC = Y +AES CMAC (128) = Y ; ; Supported AEAD algorithms of the 'dpaa_sec' crypto driver. diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index b0da7e3135..bf4f1c389b 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -75,7 +75,7 @@ New Features * **Updated NXP dpaa_sec crypto PMD.** - * Added DES-CBC, AES-XCBC-MAC and non-HMAC algo support + * Added DES-CBC, AES-XCBC-MAC, AES-CMAC and non-HMAC algo support Removed Items ------------- diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index fc9c3a4c2c..c5416df726 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -528,6 +528,7 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) ses->digest_length); break; case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + case RTE_CRYPTO_AUTH_AES_CMAC: shared_desc_len = cnstr_shdsc_aes_mac( cdb->sh_desc, true, swap, SHR_NEVER, @@ -2180,6 +2181,10 @@ dpaa_sec_auth_init(struct rte_cryptodev *dev __rte_unused, session->auth_key.alg = OP_ALG_ALGSEL_AES; session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; break; + case RTE_CRYPTO_AUTH_AES_CMAC: + session->auth_key.alg = OP_ALG_ALGSEL_AES; + session->auth_key.algmode = OP_ALG_AAI_CMAC; + break; default: DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u", xform->auth.algo); @@ -2265,6 +2270,10 @@ dpaa_sec_chain_init(struct rte_cryptodev *dev __rte_unused, session->auth_key.alg = OP_ALG_ALGSEL_AES; session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; break; + case RTE_CRYPTO_AUTH_AES_CMAC: + session->auth_key.alg = OP_ALG_ALGSEL_AES; + session->auth_key.algmode = OP_ALG_AAI_CMAC; + break; default: DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u", auth_xform->algo); @@ -2700,6 +2709,7 @@ dpaa_sec_ipsec_proto_init(struct rte_crypto_cipher_xform *cipher_xform, break; case RTE_CRYPTO_AUTH_AES_CMAC: session->auth_key.alg = OP_PCL_IPSEC_AES_CMAC_96; + session->auth_key.algmode = OP_ALG_AAI_CMAC; break; case RTE_CRYPTO_AUTH_NULL: session->auth_key.alg = OP_PCL_IPSEC_HMAC_NULL; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h index d500a4c246..c94d78e046 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -712,6 +712,49 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* AES CMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_AES_CMAC, + .block_size = 16, + .key_size = { + .min = 1, + .max = 16, + .increment = 1 + }, + .digest_size = { + .min = 12, + .max = 16, + .increment = 4 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* AES XCBC HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_AES_XCBC_MAC, + .block_size = 16, + .key_size = { + .min = 1, + .max = 16, + .increment = 1 + }, + .digest_size = { + .min = 12, + .max = 16, + .increment = 4 + }, + .aad_size = { 0 }, + .iv_size = { 0 } + }, } + }, } + }, RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() }; From patchwork Wed Sep 8 06:59:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507904 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp335111jai; Wed, 8 Sep 2021 00:04:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBwAu+h/ZAHopZl1fpb78dCHMfEV+Uo9T55owN5T5qNDtfMrvieWLKLm74QmS+8TWxZQN5 X-Received: by 2002:aa7:cf82:: with SMTP id z2mr2295408edx.254.1631084666970; Wed, 08 Sep 2021 00:04:26 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id d15si1452783edt.431.2021.09.08.00.04.26; Wed, 08 Sep 2021 00:04:26 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=bcCJq19J; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6422E4114C; Wed, 8 Sep 2021 09:04:10 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60052.outbound.protection.outlook.com [40.107.6.52]) by mails.dpdk.org (Postfix) with ESMTP id 099C341147 for ; Wed, 8 Sep 2021 09:04:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I75pvpaZ0jUeL4Rl3Umo/nynXMfFbMjAVCYZc2esHOBfZxNVAQeBZCFN46MrsIYpvWwtRcEAujAU5uDR7h8x4BhbGlrg0KV2rtkITstxLJFqx6iQFb2X0V1exjZDK5Hn9UCSAkqm64NfGm31f3X/i9LgU2TdHXf3QMHhE/em6kIRRcpjPVYqMpBrAlNvjv6piY/ndaQuznpsNLokxVnjhoT6dRHwk7Eb0fW2l5NwuwcUgnYo5PDaRthzK4Nj5W/LMQLnGtKM+23nHGblBSOmshZHMkxoayizP5Gx+fRRu9QEdUlaRYOLckIJgiblDcK8T+zkxKiFP3NS90NmJFASzw== 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; bh=6EJIORFNXa7FdvJg1o7Ys9xXalITj78ptB6rE1u5eyQ=; b=ksIoaVxDJvGp6oZ8wiXV7UdLeHo5WJq0TMeS3iIPXRpfv/s7UKVS/X3s27/3QZBLim8pyVLf1gWRr9jO4LN+dlmAPPDKAyDmcYMvEWhXQmbxY2tW0bg892ZW40HiABQ4CxTAOBbZsIqlAU/hIRaBaABu5yEiDdDnTmjXWJLTU13/Y50CdwW5fHxB/0vd0scBAcHBnCIpNK5bJP6ok4PxuPuhKzxjq2Yxj4zdFLJrtdTkFTpnSBt0b7LG+3pOSuHrDB7+jJ25SNzxqWLvJHARL7m1cFbsCbXXwgaNWvLiuWXt5G1kckOHLyrF7RjEDKbeZW+feqJpCqYZh4OGUDbnQA== 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=6EJIORFNXa7FdvJg1o7Ys9xXalITj78ptB6rE1u5eyQ=; b=bcCJq19JKwLpB0kpIjArz/XOL7OKlxEUGA/SBtp7W1wi0/irhl/s8fs3ulawM9rPUv56IDNszNX1XDBwGCzF3bC944EK+WhgfCNWumCDmOlrDf8APvrZd8NJ8qYyYW3mJ7oXuMxyaerZW+/rZ3y7qpeTOWV0qwGUjzIF35OVF0k= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Wed, 8 Sep 2021 07:04:08 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Wed, 8 Sep 2021 07:04:08 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Franck LENORMAND Date: Wed, 8 Sep 2021 12:29:48 +0530 Message-Id: <20210908065953.28349-5-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210908065953.28349-1-hemant.agrawal@nxp.com> References: <20210907083953.8948-1-hemant.agrawal@nxp.com> <20210908065953.28349-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 07:04:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 49eb26fa-b185-4e47-5b5b-08d97296da2d X-MS-TrafficTypeDiagnostic: DU2PR04MB8903: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:165; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s8R+U6FMbVAnocfryD3eNCW0X4Y7U2LpE4BcVYgSLJW1pbvXwzN3XtCGcw+Ht5Ap/WtyPGRvWB4onYoYNj62wIbvvvNkMaMO5XuHxsdIfaOB9DJsOFQjbzqGHz1E65Y2dSgi6HPmB5prVifkWVATAO3z6OqDD1ns6hhWC9wM+V1ssp4RR1quo+0gPaotg0rEkM0qobCmkm2xB2d81cn8qA6I/5I/SrLFl2tHbIbNx3VxhkV9vy9SM/zq3DQ3plshcO4B44qbU3jzjZGQGIqc0g/80xH6jAYw9NC0OYvuWxv1UFuXmBs6VziVdFGG0/YVsN9+6hYWiJXDysFr+rXJzqJKD6ASXG6YKA7EdtWZDw9YDvbfYnDnqKs2phDK0JSib6mgwptYaf2yW15D8R/u0785C3vimreR4QpUgeZpOPa2kxQ1VM+7Q4+cxr8/639A+z5vKrE+buvpY2EyQW3IZBz9SKdDqmewSEF/UE61HfjtJHmGF/QSlafus1rFI8cVT54KZm5Ru3ciM74TBDzEDKM7I0YMEyvIC5pjtZFNiLeoUlhfFZ2kgMTW6FZ04VOcovKd7oUY3etkR4JucTgKWNKmJWMp3ktr43zw3EbiZE2C7vmFORgEfI70ug7GsbkfG236tTz5pdCTxjolCIDpoMuT2ZUxaGweUirJtdhFsODgs/DJEJppj+lSmigjJ/TivHSKb76O2OPTih38nrZC1Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(396003)(39860400002)(346002)(376002)(52116002)(38100700002)(956004)(478600001)(83380400001)(86362001)(5660300002)(38350700002)(6666004)(6486002)(316002)(1076003)(2906002)(4326008)(44832011)(6512007)(6506007)(2616005)(36756003)(8936002)(66946007)(66556008)(186003)(66476007)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 53jp00s8/sotkwIRtk+Gvxp2ompciqlh1Jn11rQHdPqmNoOiLoP8445Q2EXjJv3kmufGRWP/nJ5l22CkFe5IwtMQXc7i4X5PqkoH6ob9JeO9Ko22lk1Mz66dE8v3KM+Os5WnHiDueLbRdrMNGE97/2o2U4BLYaDJdnBvyRaHrDZYTDxQhnakBO30QLQK1CM8eEdXjeaKqcOIfEOkSdZP9ZCvfVwis0rPK9/dwFw+ZRGahH9RcGyRf2TEeyBWNYTntYdhr/M0CBGG3eBkJYrBjEAJW47J5OFmchAEY2ozG+6KW3fSo8D0xEJoMHEXQ+0GEJaGXl2xLQmgNH3+/D1qj+bC8+LJi612KWBOa4p8TO4zMJAdjqD2p91AkIR+OUxnFxqUjP72cFjiSrmX7XIKB4wzp1fgp/XcTqLjnRTOxE5W0kVyAkiZaCVadtYDEM//7ckikTyf47q35CBiGstkc9JtmvjytadHL8rw/j0lImqDZalzVVIL+q6LK2dB2aEs4dAyYtsKVqi89SSm6zT/81yjGZJXMmUMuM1h4344pe1v0ddy+jzr/s35MEKQTzIdXx+oyBKsuunEe4781CMq42+j/20c1oND87kuBPwoCL0HlCafOaEev0JohVzx7zDHE0fQpTHu9QFU389fcpctUPG2lj19mkn3hVjH/zzwOV44AlrR8zL7Oqygq8vMK7tieGX5vCx2CHjtQUdiEQ2U2tNW5UBgnmpAazPpq76bRIi1+9OiiUyrye3DWVFSwDN3WXz392flw3zLgyqwxFsKKwcQVZn3x6+LIfrCG97PcnEN3s2m9iWiVjw9PNaN7cSDkgiljm1b7hrZ/PtrfB+F2pYQ5oZ4BFOgRRxUKr6ypbClQ9DLo1jwgpVe8vDNX26DfOhpS1O2e45gDjkcgtdHAgEXwhRLVH0eZtIIvt8BjDWIAS+eJ91zdbwYEFEVRnyic+DlgLvpj1jBxgMyXMwg+sC2YdZJgpCZoq0mTfWoFZ7QuZs6aAMFgpVDUknxy8+lXuCxButC7g+NDf4UddUgmsF93jYzX+x/USwc+RVPlVrlXL0cMIwPCWqsmCVfO49WWftqUD+fZjHIiMTjakFO7VrlTJ2ueRButgNJNPuVeTr9byWoOcKbV2AvKJpmCSJhTV4IXbwn6WLB3WHrhGmD8KI39i86mvQ2w5rmDnvKva6gUWXDrtG1dB9Bq8xawUX8OdlKUVcs53BUjDWF9mo4X5iBqFSr9AaFo0vljETk57bNAEoQAs1VobIvFxOKXTitEhBBDMngYjFVeLXHRpG2VcJ2mtgc1IzCiNUvJuZOcuGFO2oPPSInfpCECDib1Jxq X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49eb26fa-b185-4e47-5b5b-08d97296da2d X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 07:04:08.2603 (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: FlPvI1pC+rcsJv89TczadMJzkFGRrcoBlHOGGsKYTjnGUzKJtn9216+8amKceJCXzbKC82sHkJ0/la+qkUp2+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 Subject: [dpdk-dev] [PATCH v4 05/10] common/dpaax: caamflib load correct HFN from DESCBUF X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Franck LENORMAND The offset of the HFn word and Bearer/Dir word is different depending on type of PDB. The wrong value was used. This patch address this issue Signed-off-by: Franck LENORMAND --- drivers/common/dpaax/caamflib/desc/pdcp.h | 7 +- drivers/common/dpaax/caamflib/desc/sdap.h | 96 ++++++++++++++++++----- 2 files changed, 80 insertions(+), 23 deletions(-) -- 2.17.1 diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h index 659e289a45..e97d58cbc1 100644 --- a/drivers/common/dpaax/caamflib/desc/pdcp.h +++ b/drivers/common/dpaax/caamflib/desc/pdcp.h @@ -270,6 +270,9 @@ enum pdb_type_e { PDCP_PDB_TYPE_INVALID }; +#define REDUCED_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET 4 +#define FULL_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET 8 + /** * rta_inline_pdcp_query() - Provide indications if a key can be passed as * immediate data or shall be referenced in a @@ -2564,11 +2567,11 @@ insert_hfn_ov_op(struct program *p, return 0; case PDCP_PDB_TYPE_REDUCED_PDB: - hfn_pdb_offset = 4; + hfn_pdb_offset = REDUCED_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET; break; case PDCP_PDB_TYPE_FULL_PDB: - hfn_pdb_offset = 8; + hfn_pdb_offset = FULL_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET; break; default: diff --git a/drivers/common/dpaax/caamflib/desc/sdap.h b/drivers/common/dpaax/caamflib/desc/sdap.h index 6523db1733..f1c49ea3e6 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 NXP + * Copyright 2020-2021 NXP */ #ifndef __DESC_SDAP_H__ @@ -109,12 +109,17 @@ static inline int pdcp_sdap_insert_no_int_op(struct program *p, bool swap __maybe_unused, struct alginfo *cipherdata, unsigned int dir, - enum pdcp_sn_size sn_size) + enum pdcp_sn_size sn_size, + enum pdb_type_e pdb_type) { int op; uint32_t sn_mask = 0; uint32_t length = 0; uint32_t offset = 0; + int hfn_bearer_dir_offset_in_descbuf = + (pdb_type == PDCP_PDB_TYPE_FULL_PDB) ? + FULL_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET : + REDUCED_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET; if (pdcp_sdap_get_sn_parameters(sn_size, swap, &offset, &length, &sn_mask)) @@ -137,7 +142,8 @@ static inline int pdcp_sdap_insert_no_int_op(struct program *p, SEQSTORE(p, MATH0, offset, length, 0); MATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0); - MOVEB(p, DESCBUF, 8, MATH2, 0, 8, WAITCOMP | IMMED); + MOVEB(p, DESCBUF, hfn_bearer_dir_offset_in_descbuf, + MATH2, 0, 8, WAITCOMP | IMMED); MATHB(p, MATH1, OR, MATH2, MATH2, 8, 0); MATHB(p, SEQINSZ, SUB, MATH3, VSEQINSZ, 4, 0); @@ -190,9 +196,14 @@ pdcp_sdap_insert_enc_only_op(struct program *p, bool swap __maybe_unused, struct alginfo *cipherdata, struct alginfo *authdata __maybe_unused, unsigned int dir, enum pdcp_sn_size sn_size, - unsigned char era_2_sw_hfn_ovrd __maybe_unused) + unsigned char era_2_sw_hfn_ovrd __maybe_unused, + enum pdb_type_e pdb_type) { uint32_t offset = 0, length = 0, sn_mask = 0; + int hfn_bearer_dir_offset_in_descbuf = + (pdb_type == PDCP_PDB_TYPE_FULL_PDB) ? + FULL_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET : + REDUCED_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET; if (pdcp_sdap_get_sn_parameters(sn_size, swap, &offset, &length, &sn_mask)) @@ -217,7 +228,8 @@ pdcp_sdap_insert_enc_only_op(struct program *p, bool swap __maybe_unused, /* Word (32 bit) swap */ MATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0); /* Load words from PDB: word 02 (HFN) + word 03 (bearer_dir)*/ - MOVEB(p, DESCBUF, 8, MATH2, 0, 8, WAITCOMP | IMMED); + MOVEB(p, DESCBUF, hfn_bearer_dir_offset_in_descbuf, + MATH2, 0, 8, WAITCOMP | IMMED); /* Create basic IV */ MATHB(p, MATH1, OR, MATH2, MATH2, 8, 0); @@ -309,13 +321,18 @@ static inline int pdcp_sdap_insert_snoop_op(struct program *p, bool swap __maybe_unused, struct alginfo *cipherdata, struct alginfo *authdata, unsigned int dir, enum pdcp_sn_size sn_size, - unsigned char era_2_sw_hfn_ovrd __maybe_unused) + unsigned char era_2_sw_hfn_ovrd __maybe_unused, + enum pdb_type_e pdb_type) { uint32_t offset = 0, length = 0, sn_mask = 0; uint32_t int_op_alg = 0; uint32_t int_op_aai = 0; uint32_t cipher_op_alg = 0; uint32_t cipher_op_aai = 0; + int hfn_bearer_dir_offset_in_descbuf = + (pdb_type == PDCP_PDB_TYPE_FULL_PDB) ? + FULL_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET : + REDUCED_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET; if (authdata->algtype == PDCP_CIPHER_TYPE_ZUC) { if (rta_sec_era < RTA_SEC_ERA_5) { @@ -362,11 +379,13 @@ pdcp_sdap_insert_snoop_op(struct program *p, bool swap __maybe_unused, /* Load the HFN / Beare / Dir from the PDB * CAAM word are 32bit hence loading 8 byte loads 2 words: - * - The HFN at offset 8 - * - The Bearer / Dir at offset 12 + * - The HFN at offset hfn_bearer_dir_offset_in_descbuf + * - The Bearer / Dir at next word */ - MOVEB(p, DESCBUF, 8, MATH2, 0, 8, WAITCOMP | IMMED); - /* Create the 4 first byte of the ICV by oring the math registers */ + MOVEB(p, DESCBUF, hfn_bearer_dir_offset_in_descbuf, + MATH2, 0, 8, WAITCOMP | IMMED); + + /* Create the 4 first byte of the ICV by or-ing the math registers */ MATHB(p, MATH1, OR, MATH2, MATH1, 8, 0); /* Set the IV of class 1 CHA */ @@ -562,11 +581,16 @@ pdcp_sdap_insert_snoop_op(struct program *p, bool swap __maybe_unused, static inline int pdcp_sdap_insert_no_snoop_op( struct program *p, bool swap __maybe_unused, struct alginfo *cipherdata, struct alginfo *authdata, unsigned int dir, enum pdcp_sn_size sn_size, - unsigned char era_2_sw_hfn_ovrd __maybe_unused) + unsigned char era_2_sw_hfn_ovrd __maybe_unused, + enum pdb_type_e pdb_type) { uint32_t offset = 0, length = 0, sn_mask = 0; uint32_t cipher_alg_op = 0; uint32_t cipher_alg_aai = 0; + int hfn_bearer_dir_offset_in_descbuf = + (pdb_type == PDCP_PDB_TYPE_FULL_PDB) ? + FULL_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET : + REDUCED_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET; if (authdata->algtype == PDCP_CIPHER_TYPE_ZUC) { if (rta_sec_era < RTA_SEC_ERA_5) { @@ -592,7 +616,8 @@ static inline int pdcp_sdap_insert_no_snoop_op( #endif MATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0); - MOVEB(p, DESCBUF, 8, MATH2, 0, 0x08, WAITCOMP | IMMED); + MOVEB(p, DESCBUF, hfn_bearer_dir_offset_in_descbuf, + MATH2, 0, 0x08, WAITCOMP | IMMED); MATHB(p, MATH1, OR, MATH2, MATH2, 8, 0); SEQSTORE(p, MATH0, offset, length, 0); @@ -753,22 +778,51 @@ static inline int pdcp_sdap_insert_no_snoop_op( return 0; } +static inline int +pdcp_sdap_insert_cplane_null_op(struct program *p, + bool swap __maybe_unused, + struct alginfo *cipherdata, + struct alginfo *authdata, + unsigned int dir, + enum pdcp_sn_size sn_size, + unsigned char era_2_sw_hfn_ovrd, + enum pdb_type_e pdb_type __maybe_unused) +{ + return pdcp_insert_cplane_int_only_op(p, swap, cipherdata, authdata, + dir, sn_size, era_2_sw_hfn_ovrd); +} + +static inline int +pdcp_sdap_insert_cplane_int_only_op(struct program *p, + bool swap __maybe_unused, + struct alginfo *cipherdata, + struct alginfo *authdata, + unsigned int dir, + enum pdcp_sn_size sn_size, + unsigned char era_2_sw_hfn_ovrd, + enum pdb_type_e pdb_type __maybe_unused) +{ + return pdcp_insert_cplane_int_only_op(p, swap, cipherdata, authdata, + dir, sn_size, era_2_sw_hfn_ovrd); +} + static int pdcp_sdap_insert_with_int_op( struct program *p, bool swap __maybe_unused, struct alginfo *cipherdata, struct alginfo *authdata, enum pdcp_sn_size sn_size, - unsigned char era_2_sw_hfn_ovrd, unsigned int dir) + unsigned char era_2_sw_hfn_ovrd, unsigned int dir, + enum pdb_type_e pdb_type) { static int ( *pdcp_cp_fp[PDCP_CIPHER_TYPE_INVALID][PDCP_AUTH_TYPE_INVALID])( struct program *, bool swap, struct alginfo *, struct alginfo *, unsigned int, enum pdcp_sn_size, - unsigned char __maybe_unused) = { + unsigned char __maybe_unused, enum pdb_type_e pdb_type) = { { /* NULL */ - pdcp_insert_cplane_null_op, /* NULL */ - pdcp_insert_cplane_int_only_op, /* SNOW f9 */ - pdcp_insert_cplane_int_only_op, /* AES CMAC */ - pdcp_insert_cplane_int_only_op /* ZUC-I */ + pdcp_sdap_insert_cplane_null_op, /* NULL */ + pdcp_sdap_insert_cplane_int_only_op, /* SNOW f9 */ + pdcp_sdap_insert_cplane_int_only_op, /* AES CMAC */ + pdcp_sdap_insert_cplane_int_only_op /* ZUC-I */ }, { /* SNOW f8 */ @@ -796,7 +850,7 @@ static int pdcp_sdap_insert_with_int_op( err = pdcp_cp_fp[cipherdata->algtype] [authdata->algtype](p, swap, cipherdata, authdata, dir, - sn_size, era_2_sw_hfn_ovrd); + sn_size, era_2_sw_hfn_ovrd, pdb_type); if (err) return err; @@ -948,7 +1002,7 @@ cnstr_shdsc_pdcp_sdap_u_plane(uint32_t *descbuf, } else { err = pdcp_sdap_insert_no_int_op(p, swap, cipherdata, caps_mode, - sn_size); + sn_size, pdb_type); if (err) { pr_err("Fail pdcp_sdap_insert_no_int_op\n"); return err; @@ -958,7 +1012,7 @@ cnstr_shdsc_pdcp_sdap_u_plane(uint32_t *descbuf, err = pdcp_sdap_insert_with_int_op(p, swap, cipherdata, authdata, sn_size, era_2_sw_hfn_ovrd, - caps_mode); + caps_mode, pdb_type); if (err) { pr_err("Fail pdcp_sdap_insert_with_int_op\n"); return err; From patchwork Wed Sep 8 06:59:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507905 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp335160jai; Wed, 8 Sep 2021 00:04:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzplmWWB2AxhgcBcmcKsX9VYg4wg8p9qmhXOweveLPBylmy/ymqffohlaEQSQAlIKl0RSd X-Received: by 2002:a17:906:260b:: with SMTP id h11mr2481707ejc.215.1631084673292; Wed, 08 Sep 2021 00:04:33 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id f7si1336270edw.309.2021.09.08.00.04.33; Wed, 08 Sep 2021 00:04:33 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=JbI1ue0w; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 990BC41153; Wed, 8 Sep 2021 09:04:11 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60055.outbound.protection.outlook.com [40.107.6.55]) by mails.dpdk.org (Postfix) with ESMTP id 892D841150 for ; Wed, 8 Sep 2021 09:04:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fRWWuSP6PR+ThOZGbSY1JGPA5ETv7/1uzydtqPo1QTPyCXsPeZCOs3fdk6yWzIoNut2ttV7I9g+lC1citUGNKrmtBOV8Y1cFeY4polfMNzAwTTwK5zKobSIlPaUOFVyWGZWluJZG8wV0/KuUlj88CPu9MifEq0q5pvu4RIyb/mlF3cCIUJkoqR8XLpRxgecYVH3+DfWXuMO1ghsjsFdlmXp/osCM+cbeeX+XcNlHbTbcXxhorA0OJMrDLPXag7UvxLHWBrd4JEc95imQ5UuCuTbeU+1+HWwDpPS2sTLlG+jLq9AjkZf/no9LHxPevX53xpJ+02bRIzbp7AWTXTLx/g== 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; bh=iH5cuKgZBTdYaSnoGB2/fO/69P0Gm9xN1QfkkCR4kfM=; b=azrl7sG9xf3IVx/n+tgGInyTKsv5phOVfGTZ43lyIIDOmyQUtTcq45wMInAZEFyzG7qldD+P6Pr/Kp/ca6s9Xw/sERn9MUDjSr+Nszr/SOIvOSewk9sF9SG8MlYUUsup9LllUyBl7UNlwVZp38C2BIZHiVC+6WWi8s9EvKWNtUtRAgLkAaO2PrQU4ZWu2PYB3cNvVR0cO4reGPgJ4GM9qcLAB3M1wydPnKotKwOrl1XhgT4w16hWjs9/n5Zzm/9gU8ZjpUWu1cx+9NDaP1/SSd3WcIrr+tw9WA9oW284UIR6kd8KJ8VtHhhdXxtZV5+hVO612OVjilbo9VyYPJvp8w== 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=iH5cuKgZBTdYaSnoGB2/fO/69P0Gm9xN1QfkkCR4kfM=; b=JbI1ue0wdkvuWzcBM0znO/7iR/o1x81tXuQ8KCSRQKzZKiN5tv3bXx0n6PQHzwiajcv937Q5S7VUXv/l7oAfsN0hUGTgB9NivLa/BSO0A5/mGNhEuwjGnZuasrJdGE5SOpOIjcG9K7LkZymcTBP17UtVA8j24d0zpiIMYAhJVhU= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Wed, 8 Sep 2021 07:04:10 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Wed, 8 Sep 2021 07:04:10 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Franck LENORMAND Date: Wed, 8 Sep 2021 12:29:49 +0530 Message-Id: <20210908065953.28349-6-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210908065953.28349-1-hemant.agrawal@nxp.com> References: <20210907083953.8948-1-hemant.agrawal@nxp.com> <20210908065953.28349-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 07:04:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5725903f-a1c4-43a7-7b62-08d97296db34 X-MS-TrafficTypeDiagnostic: DU2PR04MB8903: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DYiO7lB09aHRTV2DfBmgAjA21Ld0UBtg066KV+s1morPu0Gr0JKlfiIqN93pEcxAHOtoVLS+UUZHpwq/DykMEQOLQgT5gvjSPwzEmmR0wZHfb5pjKfNHVnXbJwcfX7bOmRdoQDltbZ1eNDHNpo3aUy/WaRxEszWsCK2liA86Oyd3wSSmAV/OGjoUQ1rUYfrOrYyNmScbNfVY+58j0038/KXFu6BccLAfU4yOuzF8JrXx/SdCgwnAgSEWGFpOX1T3L2KbiHSYbu8wjfdhQMUKqTv4354z4caOn+IqWWkLM/W1ZgZw2nvrheAXskNZbYWlPLJyb4lHLVzrdEgx3kIefU5tLLilD/wMZ1iaLE05I0aNKPZisKoT8MVX6YHg9hGNIIkd2VNRmlVLEm1jRZxCuivuqEs06VdfEJKDUdFojaHvx/kKIkYl18+HUpY45m7HmVZO1O/+wMhoDFi5YbTtGfDA86RsoDfNYcX9i01uJahakWdqZK82uyCr1Q5YcYsA8TP61a1DMCB7w20EueFNQV9bHkt7bBNzA+nTUFbZpTtvFVbphDp6rSBJ4nJABA+U7Cs+B311N1u8SYMgLpCtnvZoKFiPJSZND9Maxgp5ifWMba4wKpxegllt2eaSNIBaObgcoqbzyymLEWDPGan+b7FbOCwZHOVh7inv77dCbHuZ2ek4bSDB2iZ/Q4ODZQ/b5FI8rndnM7RJ9QhFPh1LtQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(396003)(39860400002)(346002)(376002)(52116002)(38100700002)(956004)(478600001)(83380400001)(86362001)(5660300002)(38350700002)(6666004)(6486002)(316002)(1076003)(2906002)(4326008)(44832011)(6512007)(6506007)(2616005)(36756003)(8936002)(66946007)(66556008)(186003)(66476007)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bXc0kLrJ+iBetgC6I3UD2YXkxnv14PMmv6WP4bBFQaLMqed9RscmRWuJzESDAW7irt7EhxbL88PZxQ6cbMHFwYXlzVki1TZHMP4kwDmNwXtSirV2RcGod1usBGoJa978h95vaPbNQKzYhuIydLK1vECDeNLmgpj5lQiOBAqJYhoihSozHrGYDi4f/hK+dTEQkxyRFtEj2eA37GTibn3H7x7xEgDeTu2qhXmupsAd+rOUKuBiCkhOezfLpFmS+xwAKOQnaV8gehiQDVYRoDOHvIedNSte6pVV8NJNVRdYLfi5weTLQnHl31t2URuSZm8kwB5zaE2bZm9hleg2mIvYIG4h5b+p4XTMbNBrlbd7KPIyR6PyIq2k/pvuKFYouJeeXeM84rLPqr+mBjXfgpsDwQpJKIyak+csGzqVKyAtG0qbpmSaVjRhplSpVJHg9faJjeyHNf6vnDSBwNM5qNUnHOxO0vTM2M9ng1HJFWmo22KYHrcc+akeciwFgRqwVc1Wd3Gj8r34QU8wHE+qucspvlqQEowv9WiG32nxtXsDWhUIj4y5z2Pouwmo/MUO2GQG/WH9vqwYMwTFT/rjGuiipXbg6UNKhnDTC7YfNxIF5E01+ZS4Sz57/xqEXM5v2FYxuh1kcxrDLFjUVF6OCFgt5ruKNA7tJ7V0u4TLNnlm6EtPSy1u86SzHz14rTQHHi009Vi1XfikKLMZwm0ZNjwVMCtSpRQQ58b5+UJWQhzJ8xjaymv7k9M1Jp/gSiFkHIsFaU87tUzPLaGwStyItCiPXkiZ3C0oSiZ6RgZY/kzZR1TKhyc/ufA9AzQoTBMSn1gCFaEFAwXU6tEUbA15PW1xNiYYalKIPWILh1jDSeUKksw4DM8d89iqNo6I9+XmH6ViOUvtXvMpsVTlHLc3Og4dDL9mV/52EAG7dNQZhmtps6O6HWbwo34M08oDtjI7v52SOr4OdCEwBfvcjn4XUwazVeDbOX3/25PYc7sJRg/muuu1IL0XcB616CXcBowGP5VHcHKUve4032/nkpPfcnLaOF5mud2GE7jBGE+aEzylnuCrg0RQqS555zeE/ybUgFtUS4FGJQIc6JtAIeHnx8XHufK2J+NuGnkQKgZpCHVITT3mExK27P91NPJS8b2k8Wv6sqw2jzYdvLMdxqJ2wP/HTFEd5RiMrMsPrj6vUruXaR24rVouVNRSSqbtpkQIGtxI0IaumCBQQlgAeRgTXbfCjfp4dgLQFH68iNVmKiHVvA8aiEWg0HU5Ttpx1VAdV7+4hNmf5wUu4NlxCdv0ba3TPS+gVm+gECRFP/CDhU7oR0D8yxVgHXk/XZQGn4VpFKRi X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5725903f-a1c4-43a7-7b62-08d97296db34 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 07:04:09.9828 (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: X3a3TW3FFG8Zu4Gtegvu4ckMkKC5uvFAZGok6JAxB7QvBfLIY75Y1j8le8lJVjMDHT9mUNMz5A+Llaw0fAKNmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 Subject: [dpdk-dev] [PATCH v4 06/10] common/dpaax: caamflib do not clear DPOVRD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Franck LENORMAND For SDAP, we are not using the protocol operation to perform 4G/LTE operation so the DPOVRD option is not used. Removing it save some space in the descriptor buffer and execution time. Signed-off-by: Franck LENORMAND --- drivers/common/dpaax/caamflib/desc/pdcp.h | 14 ++++++++------ drivers/common/dpaax/caamflib/desc/sdap.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h index e97d58cbc1..5b3d846099 100644 --- a/drivers/common/dpaax/caamflib/desc/pdcp.h +++ b/drivers/common/dpaax/caamflib/desc/pdcp.h @@ -2546,7 +2546,8 @@ static inline int insert_hfn_ov_op(struct program *p, uint32_t shift, enum pdb_type_e pdb_type, - unsigned char era_2_sw_hfn_ovrd) + unsigned char era_2_sw_hfn_ovrd, + bool clear_dpovrd_at_end) { uint32_t imm = PDCP_DPOVRD_HFN_OV_EN; uint16_t hfn_pdb_offset; @@ -2597,13 +2598,14 @@ insert_hfn_ov_op(struct program *p, MATHB(p, MATH0, SHLD, MATH0, MATH0, 8, 0); MOVE(p, MATH0, 0, DESCBUF, hfn_pdb_offset, 4, IMMED); - if (rta_sec_era >= RTA_SEC_ERA_8) + if (clear_dpovrd_at_end && (rta_sec_era >= RTA_SEC_ERA_8)) { /* * For ERA8, DPOVRD could be handled by the PROTOCOL command * itself. For now, this is not done. Thus, clear DPOVRD here * to alleviate any side-effects. */ MATHB(p, DPOVRD, AND, ZERO, DPOVRD, 4, STL); + } SET_LABEL(p, keyjump); PATCH_JUMP(p, pkeyjump, keyjump); @@ -2989,7 +2991,7 @@ cnstr_shdsc_pdcp_c_plane_encap(uint32_t *descbuf, SET_LABEL(p, pdb_end); err = insert_hfn_ov_op(p, sn_size, pdb_type, - era_2_sw_hfn_ovrd); + era_2_sw_hfn_ovrd, true); if (err) return err; @@ -3143,7 +3145,7 @@ cnstr_shdsc_pdcp_c_plane_decap(uint32_t *descbuf, SET_LABEL(p, pdb_end); err = insert_hfn_ov_op(p, sn_size, pdb_type, - era_2_sw_hfn_ovrd); + era_2_sw_hfn_ovrd, true); if (err) return err; @@ -3319,7 +3321,7 @@ cnstr_shdsc_pdcp_u_plane_encap(uint32_t *descbuf, } SET_LABEL(p, pdb_end); - err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd); + err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd, true); if (err) return err; @@ -3523,7 +3525,7 @@ cnstr_shdsc_pdcp_u_plane_decap(uint32_t *descbuf, } SET_LABEL(p, pdb_end); - err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd); + err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd, true); if (err) return err; diff --git a/drivers/common/dpaax/caamflib/desc/sdap.h b/drivers/common/dpaax/caamflib/desc/sdap.h index f1c49ea3e6..d5d5850b4f 100644 --- a/drivers/common/dpaax/caamflib/desc/sdap.h +++ b/drivers/common/dpaax/caamflib/desc/sdap.h @@ -990,7 +990,7 @@ cnstr_shdsc_pdcp_sdap_u_plane(uint32_t *descbuf, SET_LABEL(p, pdb_end); /* Inser the HFN override operation */ - err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd); + err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd, false); if (err) return err; From patchwork Wed Sep 8 06:59:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507906 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp335245jai; Wed, 8 Sep 2021 00:04:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFwBTrjrB1/rKyLvm05nJTKxyR4CigJ7jXEex/k9+PNWgxETp+eVm4+ihQjmY8haicjrf5 X-Received: by 2002:a50:ee94:: with SMTP id f20mr2306310edr.117.1631084680733; Wed, 08 Sep 2021 00:04:40 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id p2si1246914ejj.156.2021.09.08.00.04.40; Wed, 08 Sep 2021 00:04:40 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=Nxs0RBvi; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F2D041162; Wed, 8 Sep 2021 09:04:14 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60042.outbound.protection.outlook.com [40.107.6.42]) by mails.dpdk.org (Postfix) with ESMTP id 6D7EF41158 for ; Wed, 8 Sep 2021 09:04:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fmiXy+VipZlDoEnCa/IxdJEK4nb6ZFYGavYMoH5FaPwsCrsYBSwLh6t441sL6qAEbazH8s8GoNTYSUA9bVVENYbe3jhc/OxDGzx/vZgVH2fVQGqdethtJfrUHAO6xo8NCdw2Ssk3dX4u9dEDuHbBNeHQpRZqvSePpI3aiixlOsKvl4ZPrECyxDetmbc+BMkFQM9mHm+mV+7961lTyrUYTGD9J9imvRvQ0RZ1MPLWIbw/eIg/9wJIGduibeNCfYpiI47FdtUqAQXO5KHWueReu6qRRntcx43ACFOUYEkPlLD+muX1p20M29eoWr1MQWdrSBInBdyE7tMxqVSU02wxAw== 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; bh=ZwTvsrBUYr+Pi9UTxweWsOzOAZm886yL1mrN+koT+JA=; b=Xe6Nc0h1i38ex1Ck4jmwmJbUAu9uqb5GFgvNgrPpbojt7XcAprBBBKNdEiRqnjuZKMum8EI4NJ49P4ZLFf44FqAsgfv//M1JpBrYj7hSx7+4teGRZVEYvSHxmvdsIsEgCsLxniR/3RoP9n6EU1sIAvigetrnuAPcak6lfMXM3LtPLwRzLe5PuwjzIat2Geftm2Rr44K66Ca7UpRIc4dr+4DY36AQ+MGwkXAOVmNwO0A/5xoi0UeqQj6e7hQk2lzvmTNil/w533x2P0rwP1z1PvmZtZTiJailojQ3zWpDVyWpoc8WTvM8fBEA1Be3O8ymmhZX9+/387ZgWeU8ZGksOg== 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=ZwTvsrBUYr+Pi9UTxweWsOzOAZm886yL1mrN+koT+JA=; b=Nxs0RBvid7vLtgAblCxWtdVvJ58jiVBDYWTWisKB52YxpsI9UVjeEICC+PKV4PpgPgMURGJhhnYhQl/3625VsxX6yPHkQoGb1pmE0SSmV6MOfPVZkpyreMYdvwmIwYFNUvFVas58tQmZGpKy8Y/Ktl20dIqQWfHV0rwH4mj0cWk= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Wed, 8 Sep 2021 07:04:11 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Wed, 8 Sep 2021 07:04:11 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Franck LENORMAND Date: Wed, 8 Sep 2021 12:29:50 +0530 Message-Id: <20210908065953.28349-7-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210908065953.28349-1-hemant.agrawal@nxp.com> References: <20210907083953.8948-1-hemant.agrawal@nxp.com> <20210908065953.28349-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 07:04:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52f6fab5-ef6d-4601-0343-08d97296dc40 X-MS-TrafficTypeDiagnostic: DU2PR04MB8903: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 669AXLCn0p0/gatPdw+TO/LvmHDjVCd9w7pgL8Qti1EmvbSaXt49sESCsLmewGKlODmoNDT3tTlzGoHit6aPnL8T2Z+lhu2Wig5J10Q4VXxZpHoGGkbT1Wchsax7O3aJsdS1XLZsQ9uGNML6UXdU+bYHUm6ZoOw/3zmQ8JmOvPLI9DiAERBLxZEezY/MQJRuBGcZ0aWkK/tHoIhqc0w+IPbsh9WetEhThKvPgklJVq3oXJsszC6opglVjgX/cOn6Cpc8Xp51eKVCyQYnl6CbED7W9FudxYfXLZpwpW6MMkUTkzuawG6zJvPwuI9RN8aCxf9jZfSN2zHECzsI0CziIXPQB+Fhwm5Lm6PlTZZBxJYmkvRt9MJR9rBC0rBFB8oYakzZ8vSiw3s1/3uP8jI/cLs36jh/2rSh4PoqS74AWjTBZJTjzN/gdFjmR5z/5v8AKrXCUEJEdDvkgfGb6doEew5MFglKlTrL8wVpZd3IoBNioOkKXE5KhIvcZZWVacZikaZFRW1aR+SJGsbtY1O10QT33tqxk7n0UAvNDhm+f7IDV2TANjg1MRjtUIDSrTa3h+I7CP708RtTJ/YYQefklLGrGPccmLGQAARzDXa1oO1zPeOUoakNswYoXgLuKVHqpM8ZJ/e5wRZgZO3xRNgIGkDRWlLJPIQTPflsm68vTNvkVME7Uaf9mfDV1cN8k3CRa30mkP5zRZXlZ4sJr4EK+g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(396003)(39860400002)(346002)(376002)(52116002)(38100700002)(956004)(478600001)(83380400001)(86362001)(5660300002)(38350700002)(6666004)(6486002)(316002)(1076003)(2906002)(4326008)(44832011)(6512007)(6506007)(2616005)(36756003)(8936002)(66946007)(66556008)(186003)(66476007)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Dq+cQpSJzweHY6jQFCkb2DhXS5SZudlA1X9Eb3sx2ZKY6mUSQS/kQwzI4FC9OnSXmrizn6agKCoasA4tWG28Bb/nCFaeEzxwMlZHLTcdV7uhtJDQyDISlGV/PyYoC0PeHCacxtY4CSSGFQPTwQPNzP5cmGwAW6uLWenf/wIsKK5HtuE5H10yU6ROVGuL8L0I36ksXb7R/ULFLXxXnE4uKbPgeDcra+ee1H4aLEdr70E5DD32mHc117OpdZcaM3QgaTMvqOrJ26/pTQ6rZxkm2v1fhxjlCDxNkLReBuxaa1NZ3HJwdCKhd92xCr8s2rwwyZerOsv87xgT4USx1wVNlprBEfO9LY/YkM2cjwm7G+B8ZH6VivfiJy0xNuAU/S6RhLBjmuYj1tKKTry39V7/joxidNI2UMAWeQ95HywchNVDwkzejUDJDxjs75jQAFLJwJRIH8Wr58QWmVeSCU7KbtWFnXd311u1JPHLZah2uQTquMJSNj5cBOelBQ71WqInRIi24sZUS9Zkoys6WDbSk0CBKnO2uALCwrATx5jBk6DG8umG6Kk15AmoJHg0hF5HF5zE6djbc9cEbt7GjLteVh0bkEDiaH6nHywKdUPoSxmCeZqKclSOrzOe6V9pAVEnoX/LrsFLkj8GKzWHtp4owSYFU5m9npPgbWieWSF2SyZZZkSBZP0hJWVi1BJ/pegiXWMlx9os4ty1wLf0hGkAG3AUk8JQt1+BIp0P7BPmfd4g45O024JyNl4pXUrkCVwp3rECWpaw07SOcUMbV9P0otEaKus8GZ3wLOAxcP+tzLHkfe9aHXCDrLrYWCxzz0cGdqFGPtEnCWaeb2qG/EYwwufyzRfTTEMAHdHPF7qAe93PjaTQGTDl59ekPPJxWOjFI0qCEukwhXFVIgHO7JHxNbDv6ZNv95tMqutrzgOcPDLx2WUP0m269hRe1AmU18i3rwKeHByDOLxrX2MTProMcXVJWM6rQeVM+7kGzbEmHDXLT1oll90ofmMsoRVBBN374e8FKvwIG5aWv3WI68pb/0ukUSJDr49LoAnNBoy901w3hdnL0upmXaRBPjW6RI4GsvJn9Ve8Xs4AWQq0hDm3S8GkwnIb7tlUNx0Bu3IX5qsoDXSQmCcWTU5YvgR7uDGKSSP8DkiYH95AnJ+Y75O/cwiZWo98UWpdBTtfxz8DysJ4rWf1FQLXLk2Vp7c7ibS2TE3GdWmtTBJDu9gg+uZE5AKeE6Hmi1cjLKOZSsuJhgAdIUQ4iolWqWhcrvajSCqYYk9vWPVcCxHDHHrpruOg1B8RTU9izH2J1euCd86WD1YjK52l6zUzWmeGosvVmAZF X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52f6fab5-ef6d-4601-0343-08d97296dc40 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 07:04:11.7550 (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: 8wujj+ESmEnQK0vy5+UWNBivLoUppIesB46kzEOllsecnmhOtPnfuJ9XGDUSRfiiS5pt8WHQOHXQQj/EjUQLlQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 Subject: [dpdk-dev] [PATCH v4 07/10] common/dpaax: enhance caamflib with inline keys X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Franck LENORMAND The space in descriptor buffer is scarce as it is limited to 64 words for platforms except ERA10 (which has 128). As the descriptors are processed with QI, it adds some words to the descriptor which is passed. Some descriptors used for SDAP were using too much words reaching the limit. This patch reduces the number of words used by removing the inlining of some keys (done for performance) in order to have working descriptors. Signed-off-by: Franck LENORMAND --- drivers/common/dpaax/caamflib/desc/sdap.h | 61 ++++++++++++++++++++- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 28 ++++++++-- 2 files changed, 81 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/drivers/common/dpaax/caamflib/desc/sdap.h b/drivers/common/dpaax/caamflib/desc/sdap.h index d5d5850b4f..b2497a5424 100644 --- a/drivers/common/dpaax/caamflib/desc/sdap.h +++ b/drivers/common/dpaax/caamflib/desc/sdap.h @@ -20,6 +20,63 @@ #define SDAP_BITS_SIZE (SDAP_BYTE_SIZE * 8) #endif +/** + * rta_inline_pdcp_query() - Provide indications if a key can be passed as + * immediate data or shall be referenced in a + * shared descriptor. + * Return: 0 if data can be inlined or 1 if referenced. + */ +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) +{ + 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, struct alginfo *cipherdata, struct alginfo *authdata) @@ -788,8 +845,8 @@ pdcp_sdap_insert_cplane_null_op(struct program *p, unsigned char era_2_sw_hfn_ovrd, enum pdb_type_e pdb_type __maybe_unused) { - return pdcp_insert_cplane_int_only_op(p, swap, cipherdata, authdata, - dir, sn_size, era_2_sw_hfn_ovrd); + return pdcp_insert_cplane_null_op(p, swap, cipherdata, authdata, dir, + sn_size, era_2_sw_hfn_ovrd); } static inline int diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 1ccead3641..6b6fee828b 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3261,12 +3261,28 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, goto out; } - if (rta_inline_pdcp_query(authdata.algtype, - cipherdata.algtype, - session->pdcp.sn_size, - session->pdcp.hfn_ovd)) { - cipherdata.key = DPAA2_VADDR_TO_IOVA(cipherdata.key); - cipherdata.key_type = RTA_DATA_PTR; + if (pdcp_xform->sdap_enabled) { + int nb_keys_to_inline = + rta_inline_pdcp_sdap_query(authdata.algtype, + cipherdata.algtype, + session->pdcp.sn_size, + session->pdcp.hfn_ovd); + if (nb_keys_to_inline >= 1) { + cipherdata.key = DPAA2_VADDR_TO_IOVA(cipherdata.key); + cipherdata.key_type = RTA_DATA_PTR; + } + if (nb_keys_to_inline >= 2) { + authdata.key = DPAA2_VADDR_TO_IOVA(authdata.key); + authdata.key_type = RTA_DATA_PTR; + } + } else { + if (rta_inline_pdcp_query(authdata.algtype, + cipherdata.algtype, + session->pdcp.sn_size, + session->pdcp.hfn_ovd)) { + cipherdata.key = DPAA2_VADDR_TO_IOVA(cipherdata.key); + cipherdata.key_type = RTA_DATA_PTR; + } } if (pdcp_xform->domain == RTE_SECURITY_PDCP_MODE_CONTROL) { From patchwork Wed Sep 8 06:59:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507907 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp335305jai; Wed, 8 Sep 2021 00:04:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZivQ7Uxd0PvEOJGvwZCEo01gXWiAv6h1e5kZ3WVN+VnAF2RsI+TzSz5tN7sgNvozcECXD X-Received: by 2002:a05:6402:c05:: with SMTP id co5mr2329399edb.41.1631084686275; Wed, 08 Sep 2021 00:04:46 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id jz19si1393545ejb.599.2021.09.08.00.04.46; Wed, 08 Sep 2021 00:04:46 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=DevqDw8b; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67C4A4116A; Wed, 8 Sep 2021 09:04:16 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60056.outbound.protection.outlook.com [40.107.6.56]) by mails.dpdk.org (Postfix) with ESMTP id 71BA841167; Wed, 8 Sep 2021 09:04:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fPOmP+KxwDUfBM7Ol3cpI4F2xyExKXwXcWMIMV4KNDeghSRK3zMktxa2d+BQnWdF6tCA3TatiuO7Jhnp4i09ErMcyUx4cJwCZtwjl5AP0EKxsy3E6TktOHw8tpuWI82sTHAUJcq8rHh7ZCYxzO0WPK6bljL7OpRf8Ww0GDEC+X5P0T20XBtlHGX6A25GljB1HAgEdSkJPSHMoHM0oYFT4HHTQPEEetRjMCocU+PWmIJqzSwvyIMUZ5zYcJknq6rwViqASzPQh0C5GBa6wkiUWSYANiKHyNm1foWvgGKrQp92t4iUzSGJ4DYZhX1IVML96ojU3nOxuFQnaL5/iDX/VA== 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; bh=Dfwi0F0b/znP6RYWmOopmfjKTDxG/F0VJQzp5T3RuWo=; b=YezNU9GX/kO5qCJ29Xk2L5tDkPMzs0qyuraBfFpvRRFF3Mma+9muiNDryypHBYKW347383JoiVcoS0tXr8KzZm2X2K4imzbFPwUem81PwkcgmA1ouy/XDRN5xff2GvLRYDvKn7JhduQZOj11ufVyPMLFGW9waglmx9feuv17jL/fwiqj92K8ufr/mInhcMmZS/HhIJbf659y0V482vmspWij4/K6UMsethqrKZBcnT8pQ1yW6yptCrv6r+rXb5N/mswYrvUq/up8yovl/93sYd3+HGLBuZ8xzl3987OnDs5YrSZ84pK7CyzL1lx7fAZA//UV4ac68Ma6NbmaLZ5TAA== 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=Dfwi0F0b/znP6RYWmOopmfjKTDxG/F0VJQzp5T3RuWo=; b=DevqDw8b1YYQAUERc6bDv/aqNRHzBBB7EiC7VXgXi4ZBGJfYtfSSTU7Dx7vUZfRoATDw7Q/nJVAM0fPO6zTOzDeDfH+ON56upRMdtsAS7aKIDk3WTKE6wDuce8V09Sb4sBlFirhYpKUMi1+7X+q7kjD4kl7bBwhV+d8GCxEqBYM= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8709.eurprd04.prod.outlook.com (2603:10a6:10:2dc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Wed, 8 Sep 2021 07:04:13 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Wed, 8 Sep 2021 07:04:13 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh , stable@dpdk.org Date: Wed, 8 Sep 2021 12:29:51 +0530 Message-Id: <20210908065953.28349-8-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210908065953.28349-1-hemant.agrawal@nxp.com> References: <20210907083953.8948-1-hemant.agrawal@nxp.com> <20210908065953.28349-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 07:04:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 75385f96-f0af-423f-6bef-08d97296dd6d X-MS-TrafficTypeDiagnostic: DU2PR04MB8709: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:747; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X0jXW7Q4FSMsZlsxLeeB3gY7wHLW1yVy7/2s7UYcX0V75k/vd83+3DQUfkM0wdMAudMk0yO+9XVioJFD0s0mlZpKtyfpUpkdjxR7LTcJPToHgqWmij16Yb1KS6uQ076Acg+aJwdrpSlni33EUSFd8UmSBAqrj9s9HjFEYL3n1tFxWiumfqTfkvtoKhQ0D+8wEoFEJSy4mgrgev4BOKdgUXOjpnVsV+HVreN8u7UBGOkMWvUf2a6DTlXMeqmPXi0CVYWGsEGPrmOKOzTRkvsh29SET7I4TezDhoMfSkl6Qc5E33f49fVt2jNJLeVPV5bJH623jP9pqqyhHJqerpunsjSdtDMRLOe/ss0bjDhVC+gkJjMGBPmja/P2SUAOG8m5OP1UF/djaANVZup8euLxgqvEDFbKqrKAQkB0fi3VyryUQS5TjtA/YnV5VOfaNAN13z5uLoL39PNcBTxfs4SJh6ELp8rpjMJEb8PTeCa+2THGJgSMCpu5TEsxWNTubH8aWQY5yOvoSCxKTBcdBKihsMcNI08kE9A2icT613dJOOdC4yy8y8guG9cjNL9Wsp089k6Q3xbPS3Mc/vWhGyKNFuepiATLnIvXNkP+18Qyht9yzmnYu2NMqaFUxx5T6ePu8w4FHitQlu3I2+3s40GxYZuXjddBeQU4ABZirDtNXNqliBUzITmDDaJN9dRPnDSdqkXdirRYdwwACvrHrswohw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(346002)(376002)(396003)(366004)(86362001)(2616005)(956004)(52116002)(66476007)(2906002)(316002)(83380400001)(478600001)(6512007)(4326008)(38350700002)(36756003)(186003)(1076003)(26005)(44832011)(66946007)(66556008)(38100700002)(6506007)(5660300002)(6486002)(8676002)(8936002)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 521BF0Kw/QwfTdT3PxryS8iHnV95ktD+MWyDQCI9muBHvUP0c73AHHzHxgo12MVzUzC3bh/o1bz4gm8kTizoEuh8ZSM/c6VcOQxTYuZhtGlsa8yTO9ZaU3mgFz1iFBFfZuFVdI7fOmvWPfVaLvX8R66fTgyEMUWtVdyQQSZGG3fC3n9RuXqqCYGmB5NjdSu3RKX0zPBsKeAleoATgObm6K/qNBpCzS7GgqcQHK4j2Bs4DAb8M1aw4KMlej0JS+FHZjlzmvcnqVif8VyZmhQLpEpiRHP/0YGIcfyoFNpCDLjw31I1QP8Q7JutxaipZHXfSsVaEbFn/Oi7QgIkw3WvhcQr8FJ7tbXBAMeOV1sHLXYK9JJ2Gc6gqmp3sUCz7ZHmDgAVYeg4002qzXThf1KvG72bWtgzqoFnvutj9CqpCTy1TPP4PIUalJcDkh9e4vjDvcxvZDbK4xgLqwHv/oVs6WHpOq7ddLt81UXrJiRD8E6qlj3npU3SIU2f0FbN6TMsi3HOrWW+mve8FHa+tZSVL1vjo3D3dnaU0pNDS/wCKjFA1U9LqQhf81BNENQkwBPWsGHadZg3wyUGLMsparzVSbxKIduKttDNz4IOA7LSxWV7uNHHBT2JOgFGm7STFuM2Eo7ljjU3eTLT+pTOEtc0Gc28LcdC3SAgwyPrTXMP2yWs11gKD/+GertduGo6Aj0eLnE0i1HuLdpuXe+hCiRcNgUQli7IqbWalmLOM+Ou+9ze2kv6Bsgye2x4JaTdgXwvEL5+abaEO9+AyB1by50jS8UzVYGyUNFQI8t5lLuV0PEYL+ks8jHJtfmd9OtFJUFmVxwemH9iKpAyyZcmU2bPA0oDqvw/LZ9xHbigR+8S6jutR0YuTLBU8aN+A+5ptYr1vHh2n0znLCf7KcZ2j6z/LUxOUsbpx0Q3vrLEytV6Bo8GXVZtG63x/3BxheXMdabtCsl4GaF+yaF1+wVNC6RDKRXpWAfLTiCx2ATfzSBgFLeSY7Xbwxwrv06xeQPF1UVB0quNR10IGcS6TRK/83CITZK31oVMKV31MjYodnuSEFy6sf7JSIFZYnOE7nyWFAOHe/FwF19pZC7hrEg+vZCLk3tDYi3nYxFcww5+tkIaG0kEB/JfLnhj034urrhhMoAoccszUMSD+ZD0o7PDuabN3OQw0YE0ABPTu/PgHmCFZ7BQ1eO4CEDhp48ths8kb59hqqlbX6ReuyIAJEuI8MO6PtXbck2x102CZ+vOwltRR75+yaNwumF96cWKPcwBE7IMQ5+rGWRlCzyZRr1gu2MddN1NNFkqP0+h0i8MLFNO0eukA+yowMEWQohqBW/clFFO X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75385f96-f0af-423f-6bef-08d97296dd6d X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 07:04:13.8498 (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: RqhkNHARYCX/DgobSH0TkvKDfgI50WXAw9mNDR9lJ3NzNcVGRMdmtlP3eT5owd7kK4XZZ9FQUyT2tDznmOEHKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8709 Subject: [dpdk-dev] [PATCH v4 08/10] common/dpaax: fix IV value for shortMAC-I for SNOW algo X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Gagandeep Singh The logic was incorecly doing conditional swap. It need to be bit swap always. Fixes: 73a24060cd70 ("crypto/dpaa2_sec: add sample PDCP descriptor APIs") Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh --- drivers/common/dpaax/caamflib/desc/pdcp.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h index 5b3d846099..8e8daf5ba8 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-2020 NXP + * Copyright 2019-2021 NXP */ #ifndef __DESC_PDCP_H__ @@ -3715,9 +3715,10 @@ cnstr_shdsc_pdcp_short_mac(uint32_t *descbuf, break; case PDCP_AUTH_TYPE_SNOW: + /* IV calculation based on 3GPP specs. 36331, section:5.3.7.4 */ iv[0] = 0xFFFFFFFF; - iv[1] = swap ? swab32(0x04000000) : 0x04000000; - iv[2] = swap ? swab32(0xF8000000) : 0xF8000000; + iv[1] = swab32(0x04000000); + iv[2] = swab32(0xF8000000); KEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen, INLINE_KEY(authdata)); From patchwork Wed Sep 8 06:59:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507908 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp335373jai; Wed, 8 Sep 2021 00:04:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXX9sMUohnFbEBnzis6CmWtM9SmVtp9SAGS/4Gs6QJu6rqWJkBdfNuxKB2nejIFputCBM+ X-Received: by 2002:aa7:c945:: with SMTP id h5mr2371305edt.350.1631084692936; Wed, 08 Sep 2021 00:04:52 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id z29si783435edl.459.2021.09.08.00.04.52; Wed, 08 Sep 2021 00:04:52 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=VEDRYMPb; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A42D64116F; Wed, 8 Sep 2021 09:04:18 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60072.outbound.protection.outlook.com [40.107.6.72]) by mails.dpdk.org (Postfix) with ESMTP id 5D24841167 for ; Wed, 8 Sep 2021 09:04:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K+UjOA38NutqNeDRJbxNq8n+DWmb2o9XbS1KZOpqtz5ulQ+l8zipRPZwe31laiUJA3vfRQRSs9L40s4bEZ2n5ax2QE9GBd0qjgzHxLI5i6c9d9dctKmFhNdWrWTeLIwlwrsUlMZrkfFijXJuvWAbj+P4UqiVO/WhNmhJzQUE9+hEN6T7scCeGns1zWs1SBVy8ncw9otjr2TsCI9ce+xEK9f+oaBorTT4+vD+ohjguSLnao+51RY0N9wun2Cd0nDRxtMM5Y3Yvvjxt0R4gccz7W8TT77nX01nZ7dNYJ+buFfo/mD4WLKf89oUCJyOgADTkryI3lnMOZs16kTGeTbpPg== 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; bh=Yx0pGPIfjigzk+7796zPqlOTl29QqOTO2nOISkmoB7E=; b=LysdRCs5e27T3p6/LLz9ewrDRH4SH0Vq69Q9MyfR/9cbpeVu1+ITiCsdLArIx0oLSzalAAcNjGDoh8SBNrx04E5ZeTM2F3jAJ43o1mh1qNO19D49nEv2qs3JVC9/uoKnBqtruw3nxnO17QRFqx50F2dMiqf58Kqw43pV5N1XfcPF+IanQyeou9I0fxac8yeXyv65Q0qF82FJefy/ya3GuUdhefURbBkN8nCtHCg7rDKgynxNt0RIsGdLrmn+FDnjarx45jXKwOKe7aVH8KzhWTQ8CHdrmKutULVlpoOCWkNdRVV5DqLm8NuCFR9Y+7sBUuCEDv3We11lkL9d7Pl4Qg== 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=Yx0pGPIfjigzk+7796zPqlOTl29QqOTO2nOISkmoB7E=; b=VEDRYMPbbVNh+p2oRKUYimKEeuV/CAqRCfpMnDeUX8VfuLb3J9wAiK6wtLkOfz+K5cbHOLI58+1wPqW3iBdBMdxvGCQV+7QDf/Qk8NCmUbZMNnUjQKc6P8JxF8u48yM/F0K8Fqwni03piLyJ7Ou7S7WbFuxY0Nxa/EldG3bKG2c= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8709.eurprd04.prod.outlook.com (2603:10a6:10:2dc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Wed, 8 Sep 2021 07:04:15 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Wed, 8 Sep 2021 07:04:15 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh , Franck LENORMAND Date: Wed, 8 Sep 2021 12:29:52 +0530 Message-Id: <20210908065953.28349-9-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210908065953.28349-1-hemant.agrawal@nxp.com> References: <20210907083953.8948-1-hemant.agrawal@nxp.com> <20210908065953.28349-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 07:04:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a4855a0-db75-4cfc-7dda-08d97296deaf X-MS-TrafficTypeDiagnostic: DU2PR04MB8709: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1360; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: njIUPv60+WIGcjdNeEshX3A5p8HD1+h1RoUkwdDxAVJzGab9xBT9S9623BxVgNrC/BcYDZhk3tD8YDv+BPXwAZHCmPNbt+NgBhvb/gArLyuwA/EFdNCY7BFsIWhJlPbN6ywvFsT9RSwirXi82kx8BdXaTWxSyMjizzjWUIi+n8YK3Z3ApzcnhbEdATr5+Ph12B+8sXLFCbdFpU6tXbhnug9vdtAYjJ+Du96aIDBhf//c/FrMs3bFsCuFyLQvPIanhvqeREaYAtVaQ+Qj99iExGpRXx7KWWw+GsItiFe1Jm6TtD0Ss1tO1ZmrNcDYlWQJHNSrmFEGEdGXy8ys1w5B0NH52ZuQGNXPt1IYqutVIKkr4xj0Q/C1YyLKLBhhjhvru9Q4WhsYpr0agVp9MOnoviHsL4UTwALzeBFvxRR6Eh5YBhBrrxVbWuvDFCZnHvPw9c94BKm8K5R0OS4Fj9uHgOzgys2wCxmtf4PEyDMfhIcX3hA3YTpShXM7XtOy1OVmJVY0tNMFPgovnQKKzr27BaKr/RhNTu75LOh543p5Fe2YSF2XcToBlL8IaaSKJr0In9JmMusspYEe9SqbXaMf2Iv+Uyi/8+2iY/gu0QI8WVgOYg/OT22yMOj6ld4uZ+NFFCStIYlwf8zbdeK1oLeEshvK7iG/2rQR+cCFXOUmxNkR/ZRE/mrACWzhUi868qHYkZSgzuDR50TRnodPUmQXgQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(346002)(376002)(396003)(366004)(86362001)(2616005)(956004)(52116002)(66476007)(2906002)(316002)(83380400001)(478600001)(6512007)(4326008)(38350700002)(36756003)(54906003)(186003)(1076003)(26005)(44832011)(66946007)(66556008)(38100700002)(6506007)(5660300002)(6486002)(8676002)(8936002)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: h0Cqm/TZFVXR4NwWdQVOGZC7oW9zd5aU1REJQY/5kSUHUPvL17rtFirSbR1mA7hywVqDZHUgs0NOu9vCQWJHN/QBBRjGnrPhJUJgrULv38Q6XUWaWA2J5S40DTmNVFHgtPOIVqWloo3nnnofLYp3lgGgAxrCH9AhIMqT7/XwyZnMRDFv4nMDahwe3yAuMRefKyum4HW9kH19USXUGAsgRPHr0aY8tG/T7vaBQ4Co/FZip4K8ernOLYkSCcoTHfC9B6W4zqqY3GcROwKEiBuebVeSc3FGS5BQUnpDVpmeKb0du82cTlKqTRE+oyffTBcZle5eTSOynsz31ENgjjXeqKmgLA62nwivS1G6Mkt1IXvUkeOKQqAlYTB8UDuIaX/3QEG76oAvOVDfaDfS1VRfLaIShFWC7D3TovDVyP/v/kkDTDGfUmGPX/1CcnYryPuXg1PZEkxVpiCDXIjRbUrznAcwFKxGVsLZCWkz6X+eqxZhHrRAjW+sFVnlHry4stT7/HOdHAADNoS+L7nwxm28Vm/rd3jt8GPLWsnCGH4hrCww1Ffv6Tr2RSC0RqMCAT/xi10HJFiyedsQv1h+TMe9UNkTOMQsLesQNWnvG0p8HTPZFLIvvc+gTunm+C2+TsPi2WebueE7l3SmuF7lkEe7B97iOdJPhKPKFsg3rWcTGWBBF8Vd4Jylfd9cRUtUPh7Keedt+ndFp2evL5cyPYsjuotiBwKWGgz2ZJ4kf+7DgWF9YT+XT7EBL0GJdcD8ZeQXxQ8JCDXzqnlyE6Q5ZvOAC7nJFE8lfbB+By/73GvbcE/5yoInhJSiJbiPDS5o0VWD/88WIy2pEaIMuiq33gGiMPm27QfrsFDyr0O17OY+F65VUXlCaN/PxpA3criPx1V6KTiLTUP53Ac5usxDn0Ghq6NhYYedhMCre/7UnhOp/lWQYUBVodyDRX44/BRT8FT9jekRYb3hsts0D8LiHu+NAdDaew6d2epdFU3m+rANO5KHKcOdJN7nye9dKuUNfXez+P6PYcmuN9yjWL2Q+CV8F4mOoD91yoIBvoEg0Je12lN4EWQToXhzT7ENdomOdXY7cic1hb2W88/up6ik1CnusOgssSrLMUCoL7RJb/F6rpkO/PHX2U7Mw7XP4Se7D6nWY+sG84HOaasfSLw+lQr8XqtoosCaOdxF+5fnJvOomzSgedqyIs27kv4HcMPwbBST6sP0kVkUpCbeVhe6b8lRvJWVkzf/LRQUs+7a8M04boxbgwKvMuksiIyum2bMHUesbdMfrPPjrnG31LhaJ/7V3gVj5Yf1T4+pK3hq9AwWzsAdgJbb6qyQnbxJwTYjDAmX X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a4855a0-db75-4cfc-7dda-08d97296deaf X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 07:04:15.8440 (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: K9Ds6CQF7myi7g8Y9bQu3YlyIJxHv0p66CpSI/EJZNH7RRMauMDL13LL4Pxi44c4ZHXPk3Is1j34cig5Ehq8Lw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8709 Subject: [dpdk-dev] [PATCH v4 09/10] crypto/dpaa_sec: force inline of the keys to save space X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Gagandeep Singh This patch improve storage and performance by force inline of the keys. Signed-off-by: Franck LENORMAND Signed-off-by: Gagandeep Singh --- drivers/crypto/dpaa_sec/dpaa_sec.c | 35 ++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index c5416df726..10ef990886 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2017-2019 NXP + * Copyright 2017-2021 NXP * */ @@ -263,14 +263,31 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses) p_authdata = &authdata; } - if (rta_inline_pdcp_query(authdata.algtype, - cipherdata.algtype, - ses->pdcp.sn_size, - ses->pdcp.hfn_ovd)) { - cipherdata.key = - (size_t)rte_dpaa_mem_vtop((void *) - (size_t)cipherdata.key); - cipherdata.key_type = RTA_DATA_PTR; + if (ses->pdcp.sdap_enabled) { + int nb_keys_to_inline = + rta_inline_pdcp_sdap_query(authdata.algtype, + cipherdata.algtype, + ses->pdcp.sn_size, + ses->pdcp.hfn_ovd); + if (nb_keys_to_inline >= 1) { + cipherdata.key = (size_t)rte_dpaa_mem_vtop((void *) + (size_t)cipherdata.key); + cipherdata.key_type = RTA_DATA_PTR; + } + if (nb_keys_to_inline >= 2) { + authdata.key = (size_t)rte_dpaa_mem_vtop((void *) + (size_t)authdata.key); + authdata.key_type = RTA_DATA_PTR; + } + } else { + if (rta_inline_pdcp_query(authdata.algtype, + cipherdata.algtype, + ses->pdcp.sn_size, + ses->pdcp.hfn_ovd)) { + cipherdata.key = (size_t)rte_dpaa_mem_vtop((void *) + (size_t)cipherdata.key); + cipherdata.key_type = RTA_DATA_PTR; + } } if (ses->pdcp.domain == RTE_SECURITY_PDCP_MODE_CONTROL) { From patchwork Wed Sep 8 06:59:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507909 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp335446jai; Wed, 8 Sep 2021 00:05:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWcZjg69jiVTUk8OtkJWxrmkni+se5IE6e5wgy4R3Jq+bnqeIvOhubQaCk7Wrje/Ep63rL X-Received: by 2002:a17:906:2a0d:: with SMTP id j13mr2360371eje.545.1631084700242; Wed, 08 Sep 2021 00:05:00 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id ji7si1374671ejc.451.2021.09.08.00.05.00; Wed, 08 Sep 2021 00:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=LAYGoEc4; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 37EC84118C; Wed, 8 Sep 2021 09:04:20 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60051.outbound.protection.outlook.com [40.107.6.51]) by mails.dpdk.org (Postfix) with ESMTP id 0D3E84115C for ; Wed, 8 Sep 2021 09:04:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TZpzjpRmZylOjVKGK/LxE4auZ1aIrT561zEWF85mBLLVcLESPbW6aWixi+n9vkol76RlD2E7Rhy28C2LcS8P2zubWkBoePw0AGGuJzi8zzcEu7dUPDYnNfkOFeaZbxLag4n8uPCcJPzWhYB5ClNffI7ZW5d9LxeNjkDWGGD8oNMYNyNWXOwt3aEyZEFIrwFDHSa/XUxbE0E+adFmfOAFD9Gl8wP41bMUerlSJghbO9V2gs1SoON/fFmn4KENLW9jmQV46/Ke9r04dBkPlLS3M3VqZqq0xoQOTJfkiPjJ+0TMB6yuWCfYlaAWxm49raDSs4eu+0h4fbfN90vWcbw2eQ== 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; bh=J3PSRwKaSHA4fnPcRplayHQxYmDFx7v1w2ANooC8uuE=; b=C2kSvDT2SYNrHOM//7/j3qeCWrmei4MUWwcsQPDXLlWOCuaifcNVyXR/GURc05VYRogfowBClVSuusF3HVnoGSwKLMLcm17lZupW62f01FUJoigRa5HuPH5UBK0zACwGqn0gNr6CLzwC+eThBIR8MfjWu7eX4A2ZF2bOSKXuuGguwiis+PoeImjEdw/XPUhi0o+q6KSfaT7tJJ/s7PffUTsTsvg15JSec2kksSGTHEZcKrmA2FVkn1L4QNR8ubGBLkZLmXD2qXR/YY/UzX5mVtL+XWwkI83UfBG8MWQT4dz7Yx5snKHHm2oxnL3bMa+p8EcMC/FDsNALKB0q4YDFHg== 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=J3PSRwKaSHA4fnPcRplayHQxYmDFx7v1w2ANooC8uuE=; b=LAYGoEc4oMTyFLpiDYVnsEech5BAecmggB+ovW0I3xks6Iu8FaCYhpir+JWo/xmHGbYdBkc/di6kzmIQ1BjNkQS+scEbUG7qnkz0cpxobEFfd5hw8EABjX7ZuknWZeCS+bmXBOE4gweB4Ssw93Y7SbXEQbyMMCGgIwmgNi9TNss= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8709.eurprd04.prod.outlook.com (2603:10a6:10:2dc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Wed, 8 Sep 2021 07:04:17 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Wed, 8 Sep 2021 07:04:17 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Date: Wed, 8 Sep 2021 12:29:53 +0530 Message-Id: <20210908065953.28349-10-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210908065953.28349-1-hemant.agrawal@nxp.com> References: <20210907083953.8948-1-hemant.agrawal@nxp.com> <20210908065953.28349-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 07:04:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5a5c8083-d1a0-4421-0adc-08d97296df95 X-MS-TrafficTypeDiagnostic: DU2PR04MB8709: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1360; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: var5Q+4rFFUHkIU6oKlY7mhb7NUJCgWSMprak8Djzs0jze41B6E6DsZ5QJWLYwy5H3Kv4r/1u4XE2ZXNzrAU53p8s7EqEU47uin5L4gZ7bjDNTFr/mMh8oGvkgim+1kPBy9PgsuL/Aqd0hVmh1T33lxibG9UEQRvpPwQ33kvah2kNQe2ugfXfu2OiRg9VU2xW3LwQBrPW5YkUIJdsaXJyWFrg3kxu+qsEvXxQJz7PA2jCKC8ve0Zt2W6rOUQ72rsH/y6a30GUyMKn/Oqnd3Et2NlaImhrsok+QUf941vXhP3vcjOEvYv9M8oLzqIX1zSPOD4v8uLkNgIntfTUAY/Sb9YwYwCNk5gq3wVtcp0TsP2pgx+LMDUtdr4LdTe6cFt8OiYiE/6yK9i+uKXaAnHnCmY6xOAfzF5LqCq7njBshc3jYJMjqum6Ms+aqE4uHT8nGcSJlKVfnDyOuGU+bbNUZOKlET7NRw3dg5uUNYTRK/nbI8L0sabupsOCnV5pSjkehUkTBk0xEMF5IVTaxY0oswguO2lSdQnZqxHQ4JjX4DZJFIA0Br7hkgYVE8zi6uVhwmjK1EQZ785Iz0t9eXZ77U4ocpWI1MlagIf6ZgIIZ9lw3bGGtAdXuiEmGM1zWvK2P3+KO36DIXL+c7mderNCxU1acBL8w3qtNh2k9Yd5trxSKpBEs3QiH0T+RzF70ZRcot2TFug8qjbybOtU6BiYA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(346002)(376002)(396003)(366004)(86362001)(2616005)(956004)(52116002)(66476007)(2906002)(316002)(83380400001)(478600001)(6512007)(38350700002)(36756003)(186003)(1076003)(26005)(44832011)(66946007)(66556008)(38100700002)(6506007)(5660300002)(6486002)(8676002)(8936002)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6c36QYaajhXCXgLWGrWOkYHn9uEQlLlU7agyK2WaHq12juwbJ9SRspkIMLS5JLnY6WZ8ZDE3VsLggptjAOfkKEew4kWBc9HOvCTpKE5ikLRbXKZecMK7ekvDjUWTuekuT1WKXHpUWOYvJVcq4PU1hRamD58aYdD4ZZ6rIBXoLKShHw1KBc7r57+E68PLZuo1peYeIB218H/E2knky+OP4bhenPlsoE1qKbDvEkyjyh+4qebf6BVS2TCoUCrd1LKyxbq3gisqxkW65kj2Tmp0JmGcRJN9AeruWhqDF1HwJSysmql/UZ26tw2+v8l9CU5IKnS3v1wByCEz+x2zUnE8xDCfjpBx6WR7zuAQB9jsP7W3OUhoVQjaUSJGRI3dChys8zrmJnI+OWv6EZWgWNqRqkFTH/J88zE9fxhkFxpJHcmz5vnkMWjAqE5xLvrO+/HN9T/5/VA3mt3AvM/UOU600cq7WTX/eTK5E+jeF0h5b9KbO4AicuAUrnr/IfB4Fc1TaIo18JzUtM3MWqjyRjDYDiilFODu2+vKwiCGSKrxCxVLictT6AomEeAtiR4qxZ00KINvpgJFMwDUn0NOruHrGIP9AxkYDqqiqDHB/oOBBDrnNXoj2coIFmsGQ04OaSIOPg9jG97XCB+r38aU4tiP38RCXanN0fl67z43Vnrdbwj9P8jNSmxdCNum+ePbgZdb5NZSMdUkFBq22izr8Uhgf0pAFmtXnEbMqCYt9v9zOJ9NoaceIBQ9Fe+Yp6IQXhOeaMwoaw5JlvE9PRCqTbimQHnbegV4uQ89sVOncDyrJ5uvf/t752nt+WqAI+x2y4mWHNuwFbMHsU4KzBoUjONNSAU4aNsMp3TTpVnInqlWijwqI8/4T01ynTYPePtYVzRHlUazU0InK1S4T5TV8QQQyxnhs6w9y/+J10qdBGwGmh3M7PIpMGI3vQjhnz0mWqM6y/16Gv6lQIu/dhHmPUbbToC6OO5oRVPagoTjKswvA148sYxRrrZOWXoicdK7tC1GrLmXFDESM3QPOgi8PfWCyefvgwaClRGjMGaRty+eXXWolcR90KaSK746KMwOyzyJ72bIozKn0ZzI0ZaxYF3xMahdEORldZKCMzQaHJ76izYALydxG9Wj6k+cLrUJR+20zawH1VYga7b1bd76SE7SIEcNungPG1eIdSgNSq4dlgcNESs3IAQpllcSk2ELgNVMfKmceqRU3ibHD6zRz4Jv+4yCC7Sjwlxaiutw2DiVMeVzI0rcSLscNIPn5IE1w74FPoo7eFzYMjK0PlG4O/ijmtQblEGhxJXPPQhQyOZO6MzbB7HEgFgMl9iq/wKZz4KR X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a5c8083-d1a0-4421-0adc-08d97296df95 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 07:04:17.4549 (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: SpAIFeGCkHHVH/w1QO+J9mj36MzkcyU4EIrhWc7w4tQk3D0pG8Efyyzwr36Cljmf2D7d3+7ZsmRPNfp12fyvwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8709 Subject: [dpdk-dev] [PATCH v4 10/10] crypto/dpaa2_sec: add error packet counters X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" This patch add support to also counter err pkt counter per queue. This also enhances few related debug prints. Signed-off-by: Hemant Agrawal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 6b6fee828b..aac4e9806a 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1709,8 +1709,9 @@ dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops, if (unlikely(fd->simple.frc)) { /* TODO Parse SEC errors */ - DPAA2_SEC_ERR("SEC returned Error - %x", + DPAA2_SEC_DP_ERR("SEC returned Error - %x\n", fd->simple.frc); + dpaa2_qp->rx_vq.err_pkts += 1; ops[num_rx]->status = RTE_CRYPTO_OP_STATUS_ERROR; } else { ops[num_rx]->status = RTE_CRYPTO_OP_STATUS_SUCCESS; @@ -1722,7 +1723,8 @@ dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops, dpaa2_qp->rx_vq.rx_pkts += num_rx; - DPAA2_SEC_DP_DEBUG("SEC Received %d Packets\n", num_rx); + DPAA2_SEC_DP_DEBUG("SEC RX pkts %d err pkts %" PRIu64 "\n", num_rx, + dpaa2_qp->rx_vq.err_pkts); /*Return the total number of packets received to DPAA2 app*/ return num_rx; }