From patchwork Wed Aug 25 08:18:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502249 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp382100jab; Wed, 25 Aug 2021 01:22:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVTwo2SSyVA6+5LBbcuM0tROaJOyFQxukd3ZANoTottOGXzXM/MnPXsdkGoNsnD5aZpn2Y X-Received: by 2002:a05:6402:332:: with SMTP id q18mr5622352edw.127.1629879736506; Wed, 25 Aug 2021 01:22:16 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id w16si11827646edq.201.2021.08.25.01.22.16; Wed, 25 Aug 2021 01:22:16 -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=ci0BHsSJ; 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 5F25D411C4; Wed, 25 Aug 2021 10:22:15 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20084.outbound.protection.outlook.com [40.107.2.84]) by mails.dpdk.org (Postfix) with ESMTP id C8B164003D; Wed, 25 Aug 2021 10:22:13 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JWv+4+lf4nL5nV8R6Az6oFyEh75yZ2Q4YuzvY/W88TVuCbUK9sd6WCQWCBNIGVDgpw1GKYvmgUnXTbxA8bWEs53Uslm7OPvUFEryoaoOgMRMCzzbGbU8lgd2Bze7//MkV2l0ObI102asVcCt+0Dt/RlCRJAZZSDDsLUJMCve4vgYoJVPGz+rKu2J9wXt+OuvrfEOS0ccPm3iF5bjovbmiW/7j25nuyNA84LnxWAqCXrsIXqYJJMYGxc90nUHbfjqMv22CODB6mgzS324DuYWL8bDQB4XsOKwQqS+ng75od234DvZT8gisy9NnbHmgK707zXhp0rxMV3LFtzuwHKZrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o3hBEISs0+3w9Maw89TQUNpHZmDX3mLdgXDV9wGHqh0=; b=Xlx1ygjNxy6Jq3atPQaUGBqMhrQhHdnoD1fCrhYpz8hbaBItuLWM60vOPYBtDbly2jaZ5TR87Ka7JZfp5zwD8cvSqzLzCNf5rmwj/vIARERy8LjZtThk2kBf3p+KRl2Ckg+4/oHw34pTI/wmuHsHKrj2vKngLhj2OqqEEodSm/lbGzsv4N8dhMdp1RBWfqm31G7XOA0SjaUb5dD/hBsLbProLtlYG7vhEQD37ZNUJpf1AiKfyKzYIqGUIwwGDEHX4NkCNNn8NQhC9pLu7lrHCwOktn4VSvER431ZNLhyoCAqGe8Luz/S2AGIStafNPZ2CyxbwnGH5MFdzHzmdlFtkA== 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=o3hBEISs0+3w9Maw89TQUNpHZmDX3mLdgXDV9wGHqh0=; b=ci0BHsSJK5QKqamKWNR1z5Zi+b7skFk9cI8X6XeUMplumvO8S4dmc0FzkQJBsRjsmmWtrgSNwKJo4sATUtcTzqWAm19xX2KndytHj6Y/Qsd6ZTY0XcYvlz4M/otCQgVSGtdxkf47g/K8x1DN2pdYzkAn+Uq5CqQZmbbrJ0G6ogQ= 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 DU2PR04MB8584.eurprd04.prod.outlook.com (2603:10a6:10:2db::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 25 Aug 2021 08:22:12 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 08:22:10 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: stable@dpdk.org Date: Wed, 25 Aug 2021 13:48:27 +0530 Message-Id: <20210825081837.23830-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210721073920.21893-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) 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 SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Wed, 25 Aug 2021 08:22:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ba6452ef-92c7-42d5-1d46-08d967a16f3c X-MS-TrafficTypeDiagnostic: DU2PR04MB8584: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PiVI2pKNWcV13cJSmLeHX84m5pyysW8yMcW6/kuQ9THJZTAG2LpFGWf51Tk69vFX3bqEq67i5miKuSnKmjtQjoGFryWjgaGiZxnFcjHoZqZvAjwfzeSBsl4TrCgwpdO7+yFVCWskpAyMm1UH5n0ZYIvuSjfApWuumiag2DsdsUmvIM4M6fFvPBkCNNYT1wgF2CRMnUdJNBpnz0VSSXbNtEiJ0/Uq2HkJolXuLht4o7uyOB1On8fJDdMyBe8j+62E3hTS8sKmbDWfLlcxLTVyNaIM2YfdbS2TD4tGO+SKEa+7UnlD0uvsXrOVsw3E/09yPeQS05XpJCLzOnmr74gD1O323JtsQR4bOXHVOPsWibJH79lZLa+VAVYGCvqAas8n71fV771G8O54Tqe28SvvCa7BayUpS2fU9+xrUIXIEfOiHGG6F7qjEjbK3jt177EfO7hODHTxSU+Si3XvwL8UkPjWJsg6YASFSKLrd0psk1IxsQL6BDtvqFzib4ncWM6sP2tR2BV9oGizdvuEd0s7Xgic/2zbonNgihO6IGBSAJnbEt632OyJSxnPIs6xApwF1dfzQo8VWZo82F3tsjr11KO8pkO367PAumqnmuUwrhsnGzUNahpz+vRgRL9U5E0oU0+mMVBNGVruWd5D5EVOJU27l1ka1I/6K36irHidhTgS768XGMhvQBuC97pqsbDstlGEO6oNVrUvE2mB2HkJNg== 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)(366004)(376002)(39860400002)(346002)(396003)(6666004)(66556008)(66476007)(1076003)(26005)(8936002)(186003)(52116002)(6486002)(66946007)(6506007)(316002)(5660300002)(2906002)(44832011)(4326008)(36756003)(956004)(8676002)(478600001)(38100700002)(83380400001)(6512007)(38350700002)(2616005)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4wJych0yYn9QQ28b194GHodI4juxSAS+c8wBrTclhJcsCmbMSrSqrrd62k2cMdlO2Qha4D7wG6GjK4SLiCcTNpYMie9g0kZ2jhwnblCadnFf7j+a+ZLIxO522jCZHT0g29kktvfNx4qIY5HELK7yvQ42Jcz8rL7oaCrkyAj1mGRriU+0NBkXx5l577kXYy70XD8HV1pIJHF99TKE4CFV/Z+njM3S1lSE83snxrAfuIUrro73ZADHEPM/L/ZpzTkC91NUjmjIXNcQixNwtTHfQvnR60QNVRheBW4hGRw87fhJ553trfxZprP+2Lrn6Gf07FbyFZNCEan3nRANXRXOkYny+u8FiKw1cBsyRFnZdeDnRiDgR5Bo6s2fuXHz6GI4LmiMaQmR86hhC/tv+lcFIbLoR/ujw/E7el2A41O2AY3WoR8wUIDp2rOIlpHbpMe4OrlyMbMgSDgYWnocT+Dz1H2tlByVgnDoq3EkJYLkHJAQ6XSEHBoj2c7SXsdBOia/nywoW1ojs7Nu8q/F2pyCCaqhG8Iw2/SRslDjRINzetVQcdw+vOV5dQ2lFxuUi0mjFmfSx151wgMqbUAIy7TjQCkuotSYP6Vz68e1BbhVuYv2J6oGAd8RDbKUP04cVJt6x9BVLxn5YCj/Nd30XJO3XBiPhwtPI/V5HluhE1ibSDu8k8FeDO4eofANuD2cqvnl47uYsN4HEgZZ1muvVJh8hC2xPrN4doPoW27Kxwa/95q9hXUDWAdlsS4pt/qPLfO9mJx6BSPKFjwLvvfLIMtTNXi9/EcLG/3eEm+aIfqmyLr3oi0jP+1WUvQnrrmZamahzaPdG0oLZxBivEPqY3srXrDv/XtDnO0EwGr9OuAtgqUYeJLzED+387c0W9ixz14pTwdjTEkPpffbXPwal6nKuWrwypT8cVen0WLCPLsH3ZADvn00ezRUlRsUxvUc28cilfOdLdhOTHXEawOWPf/a1me1zUmNOEKgEEAFekzE7W7gf+4TKzs3GB6kQRnlosM0Nmg/a7fDQVdQ3ni8Vg56AGR09GzIg3+6hqe7+yiOSYpWGS0finZJZVmXlEKP5bJJHV8D+QCmUZVO38PPsXUYpxekow1Tb/Kk8JnkTBPHiPKSpUVMioPDezKadGqVRjUBceU+HeuvEZxpGeNi1VFxnk0zTcdanhwXXM9AHXGqdGL9VUjS8ylFW8DL8NL+DW9y59kcmo2JilvL0u+w+vSQR+YkbauDdd3bZH18WNLX0Xbu6/FdtyMaz6KU+kb3oCvZ9bUwl8NlXUksBjHCZsFBgq0DrNhrGkFf2o6894AMBLO/OZce3FfzRL0wp3zIZJri X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba6452ef-92c7-42d5-1d46-08d967a16f3c X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 08:22:10.7577 (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: CPTt9yPgaejNTu/WXW5go9KMAh/RzFE8Gb6lOt3lVqTqLFX0eD2eMfo8axqvbO0YFZuHslLiWHluDAJcXWokkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8584 Subject: [dpdk-dev] [PATCH v2 01/11] crypto/dpaa2_sec: fix to check next null for auth only case 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 fixes the issue to check for next pointer as null in the integrity only case in pdcp-security context. Fixes: bef594ec5cc8 ("crypto/dpaa2_sec: support PDCP offload") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 25 +++++++++++---------- 1 file changed, 13 insertions(+), 12 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 fe90d9d2d8..87a94b2c04 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3095,7 +3095,7 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, struct rte_security_pdcp_xform *pdcp_xform = &conf->pdcp; struct rte_crypto_sym_xform *xform = conf->crypto_xform; struct rte_crypto_auth_xform *auth_xform = NULL; - struct rte_crypto_cipher_xform *cipher_xform; + struct rte_crypto_cipher_xform *cipher_xform = NULL; dpaa2_sec_session *session = (dpaa2_sec_session *)sess; struct ctxt_priv *priv; struct dpaa2_sec_dev_private *dev_priv = dev->data->dev_private; @@ -3127,18 +3127,18 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, flc = &priv->flc_desc[0].flc; /* find xfrm types */ - if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER && xform->next == NULL) { - cipher_xform = &xform->cipher; - } else if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER && - xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH) { - session->ext_params.aead_ctxt.auth_cipher_text = true; + if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { cipher_xform = &xform->cipher; - auth_xform = &xform->next->auth; - } else if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH && - xform->next->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { - session->ext_params.aead_ctxt.auth_cipher_text = false; - cipher_xform = &xform->next->cipher; + if (xform->next != NULL) { + session->ext_params.aead_ctxt.auth_cipher_text = true; + auth_xform = &xform->next->auth; + } + } else if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) { auth_xform = &xform->auth; + if (xform->next != NULL) { + session->ext_params.aead_ctxt.auth_cipher_text = false; + cipher_xform = &xform->next->cipher; + } } else { DPAA2_SEC_ERR("Invalid crypto type"); return -EINVAL; @@ -3177,7 +3177,8 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, session->pdcp.hfn_threshold = pdcp_xform->hfn_threshold; session->pdcp.hfn_ovd = pdcp_xform->hfn_ovrd; /* hfv ovd offset location is stored in iv.offset value*/ - session->pdcp.hfn_ovd_offset = cipher_xform->iv.offset; + if (cipher_xform) + session->pdcp.hfn_ovd_offset = cipher_xform->iv.offset; cipherdata.key = (size_t)session->cipher_key.data; cipherdata.keylen = session->cipher_key.length; From patchwork Wed Aug 25 08:18:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502250 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp382181jab; Wed, 25 Aug 2021 01:22:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxi5iQyjqNrwt9/a2vBTEo9K9FLNTwZ0cyxwiWU8l+FWBKbXfncQPr+Z9QkatcUJ9rY42Zy X-Received: by 2002:a17:906:2642:: with SMTP id i2mr46307694ejc.323.1629879741826; Wed, 25 Aug 2021 01:22:21 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id jr21si19028033ejb.14.2021.08.25.01.22.21; Wed, 25 Aug 2021 01:22: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=R1S9NScn; 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 8B918411CF; Wed, 25 Aug 2021 10:22:16 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20084.outbound.protection.outlook.com [40.107.2.84]) by mails.dpdk.org (Postfix) with ESMTP id EFB3740041 for ; Wed, 25 Aug 2021 10:22:13 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f8Os8SOIfzX82gynAc6bnztiqddIhmFP8QpTWEgG0/kdzIIUYgW6XUwoAs/cmz6GSUQXPvJQ6JYcQAWtV55I+46h9IAhRJA4U1PKMmxsZDMVFHOxnSLuPgl9WdgTbY+vUQyLLyAiaHEAMh+kByxa6FMbG1pjfae2+FxVSje6UziZV0LGWWG+zPdQ4OSowZgiKN+b+E7+VFLmIOTtK5Mzgt1SzcpMmTng+uLK2erjmD1KSRQ7vgkFjTIUGZFL0lG5Gk7YnuMXFqr+MoR37YQGsDihjAJqlAdOpNRTZYXBVRdHtt3vBLCkw+qsS2b6KRz+kNZan3F7+ZnYsPM4kYYmIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b/UZnT8J2HmsjETj4Dq6CkcWTMQaOvjpqObUQkMb2mw=; b=FVYP1O4EjMLV5oamL3KacJ7zJ5zY0QrC6LdJXYcbcOLhIyOOIDYiauNnZEFVG7Ak9umRdsE8SG2bNBSlDHoewThQiBu+a3wu/I6Uf29j+75TpjvAyO2B0KMAnR1d6ucC/SSfvgHG59oARyK5A1Iz5xW0BneERJ88dQPTxScukGlKHXbYo7Sl3cvDBvQdigiI+7wMTzoN03Mo3dmGucjIcHXe0zgh8CeIlvgfVNT1VFzI43ZNyB0dz8lrCr10lj9Ye/2aw0mFNUesYXcr7FQnufDVB8iGLCzp4DehskIF2yrzAsNvggrfYMR1Ymvqw0gztztmY5cFRkdb/ERHdDndoQ== 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=b/UZnT8J2HmsjETj4Dq6CkcWTMQaOvjpqObUQkMb2mw=; b=R1S9NScnT7gXeoe7xsmiexK6ku9sMb23igQJbw1sRwZdLLEq9C7IQHM+TufABqj0Yurzm8AS2Kov6SR+LtiV4bywpA7d5rr/irgaJRR9wspBdslOtlFqKuujbHJofDywU3jZqLPjyacDjW02EmbyYqsh7eO4K9r45sIotQffWJY= 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 DU2PR04MB8584.eurprd04.prod.outlook.com (2603:10a6:10:2db::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 25 Aug 2021 08:22:13 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 08:22:13 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Wed, 25 Aug 2021 13:48:28 +0530 Message-Id: <20210825081837.23830-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> <20210825081837.23830-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) 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 SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Wed, 25 Aug 2021 08:22:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 947f1df0-c351-4232-73f3-08d967a17093 X-MS-TrafficTypeDiagnostic: DU2PR04MB8584: 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: YffYroKvPzZcncHC/oy17+xOnPuI8LlqR6KaDUBqGMzsuMqahR8Lk4bguOsw4IUfEQQoRDxjzeqTfY9M1FINpJ0wWe6iwhSty2KYByh3Y9cfZeiws8/exgN8xJH6/gWE8Hou1paucxSQ+acSji5RI5J6MdiWGnjQ1b+OguVwDggFJ0nXaxThQNMZheodY1R4gpQUIQVxs5R8/9HjErSp6SzgM1Qds4c+YjRlPG+DyytC0tD5Hiwh1cTC6nHTsxkc5xlUkxfjwSw/8/Z71u5yV3BCerAXrus9PqLYjAWIsZlwngQ+OxqRo5W/WMwH+ua1+bowqJj991pFw+H83DTj6FPkt8kslFGl1dVq/p21134ps2NwN6xdo2dzy5D/1SYz3/mNbpln9uU0ezFlgILD1XEcZ7JZkWDHrhAoCE/WLb3xl01+WGH19K4ffqM7ctYbZDh6j93IJ3wKgvV6pK/ZvWCYOuXDIJEMM3Q87+/i8NWZKmF3CpGV1TZaWgMxPKolp9LvlJB8WAATJ+xMk/oc75TGnuyMRuHn0eFmKFYvDwijBACSNAYkD+dfKx1mVVkuj71FGjAGqXKd4e2iSSoyshEu/8jFxZuHa8601NupFaYyLkxRiTHnk0eEkIqbU21zvOgpkWXPLWmzQPQRRdc0upf5vKAn4tGftB+C8FTudoJJmLnNVrdLPXMXWwNmYsKuzH9g9gzRtkeRe0qZcAJJ2A== 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)(366004)(376002)(39860400002)(346002)(396003)(6666004)(66556008)(66476007)(1076003)(26005)(8936002)(186003)(52116002)(6486002)(66946007)(6506007)(316002)(5660300002)(2906002)(44832011)(4326008)(36756003)(956004)(8676002)(478600001)(38100700002)(83380400001)(6512007)(38350700002)(2616005)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SyjkDLOHbR232b60mAW3eT10r8hEs0s4E6x1KNUnoGmBzV4Jw2skA9zy5KW2ovldfx864zMD+s04n9aAC8rgmkGYpKNp2yY+LPcALeHCX/VW/FLA1ATMLwNGow6mwVHNFj0ashRcE13+QrpTg85hvdGSH7oQXtmr6gg/yGserR1MbxYcdiyEH/m0DVXIyu3Bvwo7jZbuBW0vkBcvjIHTRMghbNX+Kv3aN8pAfO3MfKCV2rlaC93onNcnIT4KQOS72h6zfYh5TA1kWv+LNpiAdOP/rTedlmvpnV9uiBwRQs8PVO+fc7OoOI2FJKVqjOei2kkClmMO+jOqQfs6ri4JfcSjqpv2eqz8InMsj9K64J0+2K4RYSTOewmqgGncosnGNl77ZZrKea+uSHg+jsR/qO9NZIr+zjFBO3HUaxJrCBWMxxT78nyqOVc3RKKv1mTemi6Q007f4J3+1P8uzKz5pE/ZJi6Flj+FjyVF4u5uYnmMtgCSoPY8R9AjczY9s/frsOd2baz7g3dZhgxScxZZ19q2ytQpy7TjwntUStxk5W6myYpduwHGJ0okRRCX+8+pIdYPsNZw4RdSh8mB7kZyZ+tI6Wj761SGGwYcHWU62ZAwBxPgzvy1Xv25p76sQytGmz1tDuJbnmD91qpQcPVmXa0nc36BBH6KGtcNiGM6wLruCIvkQInNGoN2riq2cayB/UAtSU31gx/OA86QemKhJ5shCPJ9MaLbf/wwh6uB6bjH6Rh6V7E+zZwcsKFsDlDCe/0Qw8XqMln2Uw4Uk8GNsX357VmeyqiwbdfYO0jPgHa4D0ozDWGya9jAXG/V9HoaYwptlCoOi7sLBVrJj6KQBZ10nNPk36jLVu0IOC3wsALJ4KuSwM9k7eeSOs3LFmsfssgxkTaAn+7JRxwsC+jTooutrwCNSaahi/VsjRChA8P978nKvd4gB436Pn8klASBpE4jcoAWvvSpPSfniLYGDLT2ckLJW518nNkcPGVC3zgzV5btz/keh9RERO7sRueRazvw5oea7Hm69mHdOaw3tozPWoXhRDL24MqxeutFc6udDy6F39MZvOqXDnWiwA1Td/+tv/reTREyQNXDnBpEOzqTZYyAF4k4Lp/y66rC4M+QURZgedR20LjcZ/ak/LSFzM0QtE5xgAUPlrJBNrJsxEKUG8znhoU/RxVdqrrvam/+wCISiQhGQJEEX42IdXKNNE+WvOr12HgPNXsw6FFvbc4P1Kq01QtPRBT9AIZj2qucQm88lawuaJYGno49dttfOy0kJtSI79COY6byaIBMIkQDKLP2wY9pA+sed+lh8VMqNoWpppQJVWL7zPPkJbxa X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 947f1df0-c351-4232-73f3-08d967a17093 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 08:22:12.9177 (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: FmA5Btx7DGCjwJPGYGoxgJf2a0deZ9obVLkEVC2ZcnV7c+yyB/MLlwUzbBS85/zRMtjgCzX++H3Kv9uNuh2xdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8584 Subject: [dpdk-dev] [PATCH v2 02/11] 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 + drivers/crypto/dpaa_sec/dpaa_sec.c | 13 +++++++++++++ drivers/crypto/dpaa_sec/dpaa_sec.h | 20 ++++++++++++++++++++ 3 files changed, 34 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/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 7534f80195..0a58f4e917 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -451,6 +451,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( @@ -2040,6 +2041,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; @@ -2215,6 +2220,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; @@ -2664,6 +2673,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 2e0ab93ff0..9685010f3f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -482,6 +482,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 Aug 25 08:18:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502251 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp382267jab; Wed, 25 Aug 2021 01:22:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVSzan108l4kHaYm2A5id/0wFLosUZ9FmGfdfxPr5HEMOg6jes1w9TF0JMGDqxQ/u+TYq/ X-Received: by 2002:a17:906:150c:: with SMTP id b12mr45135596ejd.275.1629879749841; Wed, 25 Aug 2021 01:22:29 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id g17si10954703edb.536.2021.08.25.01.22.29; Wed, 25 Aug 2021 01:22:29 -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=TWj2A5Sj; 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 0B8E0411E0; Wed, 25 Aug 2021 10:22:18 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20041.outbound.protection.outlook.com [40.107.2.41]) by mails.dpdk.org (Postfix) with ESMTP id 08CAD40140 for ; Wed, 25 Aug 2021 10:22:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iZppBtIZtrYuIPQUgYVoAqW4qT5gHkrwa437UbqwcoFUMJ4gREbxqda9ox7ZeXY9N+rdY74kmmNPR1vKkueRalvnMXg/Wv/nAPJisxw58bwHLcIaEFZtALX4irtURIRYnJTAe/z495B2OUD0YAn0fYOb2m0viVqLPgi9xtqXdrEw1e6fPXp1m655SBUCHhTn8k5f2yeOGlPVnsnRZmn7C1PoJkUxFEXy5ezJ0+pYhFHTdlL+AL0CAVclzCvr8ed/3yJRDtiClP6m6Kyez7AZWu/PsJ8EYho7JqoL8NiOPAtBNzNu996o+HB2Mu8kDW8UZgYdPw3Bj7iAXdd1S4HBPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=szKEFX7wKRy9JNlscyzSYNe8o6r5Ua52+9HEk7MCQUI=; b=Je8+iFs6loJhgt4HLQ5FRBHUgKHgkFWzhNpbqzsFXXmvOhmO8bQt9WgziQ9FHeUwQuDGrgGPvGZsSoQoWdKDAbe5TR60S2ObpuLYG6wT4SLooUPVlS9xRyLiUDRCIi37lIPreNq8sebp+0N4maWpQFNVFfppMI/dCz7F09BpwlR1Ytubg46Lds4aRkVNW8TWKGXg4hOZrtJiKKM5JiiVMr1TBjcyBDBWQKIrl6cKN+JBAez/AivX0sOMA20GvjG7FD+eSFP7JJ+iw1nN/2HiJrSGLZ1FIoTUqtKipZur7ZXfQARALMVJpGYItI3FplDvYOHS7wsTqIMcGs3m76MXUg== 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=szKEFX7wKRy9JNlscyzSYNe8o6r5Ua52+9HEk7MCQUI=; b=TWj2A5SjIB4Wk3CtmoLNQgDTDyJr7vEZgQuAGgaRbHvmd/qa1SFzhk37bmiIfZgIwrYXEeQFAfk2zTk3yZoERVU2oUzjb6pqm22/64+UtyHm0l3cz8ZcjIbwGOMtX6g9epFSs3KyFJ2d+STL3A+tk9d0TYaeykoA6KYRjr6ffFU= 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 DU2PR04MB8584.eurprd04.prod.outlook.com (2603:10a6:10:2db::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 25 Aug 2021 08:22:15 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 08:22:15 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Wed, 25 Aug 2021 13:48:29 +0530 Message-Id: <20210825081837.23830-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> <20210825081837.23830-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) 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 SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Wed, 25 Aug 2021 08:22:13 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3d668bcd-ed96-4f55-0fd3-08d967a1720c X-MS-TrafficTypeDiagnostic: DU2PR04MB8584: 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: Lul+PvGuqS2hf1758xc+OJOBvjYZ/Ad8EEZaVVNyTh0mnPJMwHf1YRymAROnJHUu6pmHyQl16HoTi+xC2gyTQhR3YWcXvM8RAVEf9xaeSQ/qk08/4lLeAzwFQhO3mDu4jxZIhg/ZfGpnBgT9sucOtqaVronvR9fOrYjwL6yKmOmBUczYodTzpPuJ6bq/U2uWlCo6altSonMtPA67qUcXCYSgNnvy69ihFE1rtbuBm8pLiqOJciKzrOPk46ZvMIVHbxiz8uH2k4bi95QGjP2nts0yp5P4pCPM9bn42bEb3DRGjMl6E4rwJTueFqI8meu6tWm4AoW2SiJ4D1w4mbMM+RUsxZ3feAooIWIMPGDB4cfhImceP0nbrZQojQ2Ntewfvpl1ERMesCuXft7neiz2CindZR0Niq6Luzfa34q1eqxix/mOYQZ4f6Oy8Xig93ZD8WN4J1CwP4TAHCoyhzMDfzO8YcO9ToswCFdvSkXaVhdlRswvfR0ecsio98eKGa0F3Md6eyhpPPVs1KXwLafemAbEeUnmSMMc2fGjriurWGNVf/RGsVx287Iud5EOSF7wKvTGgkmUKlwRqspPy+857//qhZCszMYHPIrHkOuXays+eoh+RWFkap6bKHI07mcdaMs1RSrwmgBXtS0KDK5yun0zFOLtj/5BJwd5RgKJ/lvQtaMDzquyVqOYZyWRT1pSfMoVo/PzEH6mfJmkZ8WEqQ== 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)(366004)(376002)(39860400002)(346002)(396003)(6666004)(66556008)(66476007)(1076003)(26005)(8936002)(186003)(52116002)(6486002)(66946007)(6506007)(316002)(5660300002)(2906002)(44832011)(4326008)(36756003)(956004)(8676002)(478600001)(38100700002)(83380400001)(6512007)(38350700002)(2616005)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MvZPSp8T9plvlGGvmKSLfsYp77k8X72CqoWE6Tf/ekmJFX7UsiZw9kzA8BK+jc0blnWPY5/9V6CI7D08BpdNQB/HLGrQbJ8RRKscTE/2b5EJWeAsMSoXZSM3ahPF8hQNns+mlAt1bHoKIrehBhUf2QZYxs4Uh7djCt6KXKhXAuvkgJ6S/VUnvt71x0GJQdmNeBSsLVWPUG0Y/3ZySs21NylLxVv32IUwEw7l3m+mpRqVzSl+l4QwDNNbwyoDuzoIzEqWfJzErX0InMLubWeOGQaIuvY1xHc3vPOAL3aaj9Oo5MHFZg8ZPsAkcCM0ldWWiOSprFodCmb4YWFZG17HG+tL/5JVIT1BLapeaJfJ2bj+6pN/U9ockfFTm9nA0KztXVn1vuJuT4OojWwegD6UDU8ZUp5Li4UoVHTb3mgJEFTz+Efh74Zc+dEawRfg+K2hdnp2XetXSvZuD3JlfVEDNSTuV6bZLluz6ZIZTGPQ0evWajW/sTlWqTPK7Ja0qE/cCq1F1ZNhgLyGuIt9QSWDord4KCFI+q73BSaaRsEC4N4IJXV8bQf5fqFPNloTJOun0863mk9abTW7qkejjeEe6KzD68teoipBk30pK6Dy4txcbF+ODwboDhRoRWI7O0+sdQw0p6d5lE8fYaAUryA0HdpEK2934PDYsl3GP5hsdIrC9JYaY/rQThZwdROcbbOCZ4EYJURR/XD3H1yR8TkgDXMpfXkmXNTBDVhaoVFyuiqgYPq53pdVRuoG/++HMWp4E8eC/lyCV4A4/wZsBk55ihDERW8btZjYSG6kBg7P/ObWzy1ovqIhXqtt6/ZxfUbkBhP6lFADJ7WZyQyo2KMb+vpHJRqJGooI/YBmqUm2DLKNiogedRGsCDBsga9yUbIc4ZpFAyPG21Fd2Yayxooz1iTdABak+xYkT3J0XVPau6IWtixZ/FJuIxDd5fH4FiDO0S0MSa2zwSd9DcIm6eGb0INJe8IQsjX4UrW6xNtQITPeqFT9t7OW8XDvEWhiqCUJHuMyJlQYQokcutVNvfkb/qCLWbmmAkEq+MZodfahGQz8SKShV5r6VQbCQ1whHwtDbtBeIMYFt1rfjA8/xz7xBlCiYevCBPs7djCScwRFUgLKOSbNB0/m6Vk6uJWBbiWWFhFMVPoPCzkqt0qZzY7VvFsm+/Y80Lnk49r4121JruQ5J+QgyN+tnffZszdwDPjWifH2S7jZA0xT3ABpqVvIl5t4fXkW+coMbj5AUPOWk697HbhJ2X7WJnlaLbmc9wk05XCIAcEaXg42HhkfLn/vXPQTiYb2WatpEkpCqZACgQY9FrXaEGSNLuSxUjiYTfMR X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d668bcd-ed96-4f55-0fd3-08d967a1720c X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 08:22:15.3446 (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: TMAzu9TBjYHD5F/LOeIOtoGswIjt58qw6zIQi6OTLioXpAUvsJJRHXEuWfBi03/EPCSTVo0C+9518fCrxJATVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8584 Subject: [dpdk-dev] [PATCH v2 03/11] 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 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 55 +++++++-- drivers/crypto/dpaa_sec/dpaa_sec.h | 126 ++++++++++++++++++++ 3 files changed, 180 insertions(+), 9 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/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 0a58f4e917..4f5d9d7f49 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -486,6 +486,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: @@ -2077,43 +2089,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 9685010f3f..153747c87c 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -266,6 +266,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 = { @@ -287,6 +308,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 = { @@ -308,6 +350,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 = { @@ -329,6 +392,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 = { @@ -350,6 +434,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 = { @@ -371,6 +476,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 Aug 25 08:18:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502252 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp382353jab; Wed, 25 Aug 2021 01:22:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxC/bfVgtd/94QsJ57RpmZAQT2Bo6Q1SQLwxSc8KYxk2jcH09v5Iv0BQ0Mlq8P7cNfys5q X-Received: by 2002:a17:906:fc6:: with SMTP id c6mr43815025ejk.65.1629879756192; Wed, 25 Aug 2021 01:22:36 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id c7si9339810ede.185.2021.08.25.01.22.35; Wed, 25 Aug 2021 01:22:36 -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="TI/eiCOm"; 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 2201A411D8; Wed, 25 Aug 2021 10:22:20 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20057.outbound.protection.outlook.com [40.107.2.57]) by mails.dpdk.org (Postfix) with ESMTP id EACC4411D7 for ; Wed, 25 Aug 2021 10:22:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dSz2xE5fq/TST0mlqBIDTKsDX3945Gb+ysaaP7ZPjUXJbdVO4f1pgS7NiUPo3Lru7l0NAUx3hminFlYhtUGP+hSSELPpHzozC/3Y273HWAGVeigtaMoWlkQ1gTN3x5dquemcl52+TB/QfLaK+hGP7dWFX34Mdx4tDpbTzEKYZm6GfS8axiuOgNzRgnUUFM505qPxxgvncwGa+VCOUSXd15sPK8Re6Y9sYixdV19+FNwPsK5TWy9Sk+/nbyVQ8tArUSHOGiqFxc4DGqcpvSuY2AROsVmVOqDsb2h6W2ZrWaU/HqowAtR7Fg1QXJA8kxq9jfK+nf7Wc/sCSaFCfkdk7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ba3V+HXzr0aPZg3Dm7OHfrVylgGmGBk+KXpHZ7pF9O8=; b=i2auMQhhSu7r2qiqWLx29rDKI9526KjwiLRiTXhxOPmRTygkk0wEHr6z+bXIHKcKftZ6up7QryMB44wVcLordHUlGnY7l/+OPzV+3P/xyfl9KFMzPM5Rt0t6Nja4ZkgfKRC7aDa2YQ4nIpFboFeTgw4awKJzywndtF7pCGZctOC1ICzt/WT7TF5BRmO3UI2gAfHYkDNHEGfiMM8vLyN3uTSMKRnkw3KG7DROt/hhGpm7+kUKpkl5JNK2Cl+eJ+tQwqMNgcJDErxWMFJwBTms2+tFoAY+tKQLow0e5BSQPpMt/x676oxWjGUg7O+rfYqFsks1iDxiIoSah5JYGIzPkw== 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=Ba3V+HXzr0aPZg3Dm7OHfrVylgGmGBk+KXpHZ7pF9O8=; b=TI/eiCOmnSLHllI69VV+bjCzkod8JXEzQXvjoMmFsv5XvcXJyrmoze/Nswe9BoxuPjj+mnu/S/nVtj2Xy5JcKK+Vuij5YpkITHT7HKf251BypqpaROL/gY+HE74LVvt33TlFB/eTBIM/60BV3P7Lho3aS6p+ma+kL5kEnk/4JMI= 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 DU2PR04MB8584.eurprd04.prod.outlook.com (2603:10a6:10:2db::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 25 Aug 2021 08:22:17 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 08:22:17 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Wed, 25 Aug 2021 13:48:30 +0530 Message-Id: <20210825081837.23830-4-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> <20210825081837.23830-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) 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 SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Wed, 25 Aug 2021 08:22:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ad1edf8a-c84f-4777-708f-08d967a1736c X-MS-TrafficTypeDiagnostic: DU2PR04MB8584: 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: rlY0AO1YIFG6gvzm+7mJ+RcsnxyLM9fMoHCr1vp4JrEttneSE7tZYkjEBG3qlojKPrfotFYLBo0ulTWJfHwtKngXDQ55uhZXicpUaCTIguy8MtgeVdH09kKt2Nw7g28RiRzvcgzsdTMQVPOC+vDI3Lz4TN4aFQBrCXw1D9PeatlWtiR2H2b0synUqQg/0W8zemlV86jcme17SIXOpD4cCrdbBTrkqT4DnFd3jQM8dMW+YWL/IG57o0kAyDPKM44B5A/bKh8Z//enjZ+Z3sZMDndxvQi8qyGm3OuowrCaZ6z+Njn20L6EDQAeR0ZY+HxPxr0wUzXMsMppqMol44atPSSY9IPwbaVAiqAftP2FBWhF8Vonl2Nko1oHx+PMdsyeTF1Htt77ltfFglYE/FjrtkDYkr9AMuZGWaIFW7uwNvYtpOHoWIp4w95KDInsoOZ+gz4A10ERjkYjpjmRMk2qO+2i61agK6zbl5ZJZNVXYx+JevontDlTpoQADpIOC7h+X/tgjdxNlsiQcLjtIrYN4HWFBaf1nAdi1YavgN64Dn79hMYTtM821GPp+S181tuO1DJcrgCCTExPwtpVH09p+mpDp8KPxm4PtGJHZrre3Yz49NXkptjo/dfdpMuavhEgIJr97RllUgxwYydbtOOcQwz+8dD47HtsFl63wO3xaP6htlivNZaZ0h4YWR9xx77np8rQnZCqhnDGGfYe4Ga0xQ== 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)(366004)(376002)(39860400002)(346002)(396003)(6666004)(66556008)(66476007)(1076003)(26005)(8936002)(186003)(52116002)(6486002)(66946007)(6506007)(316002)(5660300002)(2906002)(44832011)(4326008)(36756003)(956004)(8676002)(478600001)(38100700002)(83380400001)(6512007)(38350700002)(2616005)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CarPc6bt3884H1wBGo42Y634owTgNimJL3pFiINoD+7614EW8YxUiSJWpBGFdHn2V9MI2utzgraNt/eTqzJZP1ZTtjD0Cm9tyuOdXKCWh51ZsL5cfb6pLcDz9vb6yHx04CiAL/k2HfcLLX0U/K0kqy148KdpIUERuMVgILzoUi32Kh4SQAbIJnKYZIVi630KxBsOIRopcdIrjxugbN7zaxKxMdj32WtLODZew173ADCOka/Seq0ZfQ3qGLggnUO2SaqRC+JKTx0lU7yGdAN1GRp48Gmqad04n75WFF5Co4/yZ1EcGltgbavU9bCk/cFeMMdqtqGZ9QWTpvVYAXGgADFVu3PaUFjb84LRNiyeqDqcdpNcvBG+DZI3scuy2nY8MtIu9uduRZAy2GRu0BeMj+BOVX256K1gqHaxAULzrdT/eeyOGAVN4mV03bNMxyWcJH13fME4t+LoRiOaIvN/PD6TngXbK1WcsiK/b/8VGIv7O041oO71Pn5meOuFrZrEEdAciN9P1vD5rFAsmnFL/2kroxUV0QNjPNSFTwjqkKc0uMU8yfSlCBn5mCREB/NikzlbfFr1gr1/FnvKx1M5+aPq9Pr3uUIDCTH6IsOuXjA84QAnyNm8F08r44jEHccI7teL3PJyRCl9EnpxsN6FCJsc3JANHAJb+0ujgGotGRcJiMzcwydEX2ruakNx3j8Rod2Msmb3DAgHWfp9AadtLna8WVVZOBqTpYgYbp2ca8Jlgc/mNXPloBu+EHDy/J3TxmsQbL9Pq1E4ygvt/gxmFLuF58GKX+bEiAEkHhhjllzvGBPtbeQ0/zxLiX4GdcC+EsD4m8o2fd2EtFtBvAY6TiRvBqpw/Brj5tme5D9Pe1jE/lZDxVBt0YCJwCXsuYh5eOIE0LH+Y9hRUC4DIV83ony5WPe9t7vhH0e8VdLza2wTBqUqIsYtL2NjCAvy4dgSr4lJwVgAXs2rvj7SxGVCXprXJcDB/yM/lArma2Rxo7SI7rsevwNubVM0vrFpAGWEVBrI885O0RUD3n7WPJSdkchxHnh2BM4rZuXgSvMiNMXVfWY6HVAiVCmoXmDzzpEu9L/5W1L+emCI8gB+boiqni24NaG1Wi49th+/SI8ywSDMLsNLLuikwXIB1Oh0XPrqA4Jr+JnxJ60MmeaZxVAF6OYSS0PUavYj0/9ovenpwNXFF5bOMDNv0qp2n1BJh8hirE5MWWV0fWOL7WZC15E2nD5bcMJl9J7Z1/NVbQzgdDa9D2Y3hQsKRuWa67RPqd4BNMoKpS7AiVIj+A80JrvPsP/6qkUj4VWmULH6Dwvfn8dmOWlkjfSwFVmzki4d/mci X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad1edf8a-c84f-4777-708f-08d967a1736c X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 08:22:17.5827 (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: ry/VOH82bXwli+S0mOW/DBP9xIP+tPiehl2qoz8FuzG+B44wZlcEKXchIxLs0YAYi3sBKm9TykvHwDJETsoU7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8584 Subject: [dpdk-dev] [PATCH v2 04/11] 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 + drivers/crypto/dpaa_sec/dpaa_sec.c | 21 ++++++++++++++++++++- 2 files changed, 21 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 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/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 4f5d9d7f49..dab0ad28c0 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -524,6 +524,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); } @@ -2165,6 +2173,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); @@ -2246,6 +2258,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); @@ -2685,8 +2701,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 Aug 25 08:18:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502253 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp382449jab; Wed, 25 Aug 2021 01:22:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRmGNcUe4XeU4n9eYjYFbG957i2Betzlo2N93nsLxM8cQ24vEoRKPZQ41UIXXw3iqgSVaB X-Received: by 2002:aa7:d95a:: with SMTP id l26mr11574962eds.305.1629879763186; Wed, 25 Aug 2021 01:22:43 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id x11si21000107edd.110.2021.08.25.01.22.42; Wed, 25 Aug 2021 01:22:43 -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=J7IcVbN9; 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 3BC5F411EC; Wed, 25 Aug 2021 10:22:21 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20078.outbound.protection.outlook.com [40.107.2.78]) by mails.dpdk.org (Postfix) with ESMTP id 25ABE411D9 for ; Wed, 25 Aug 2021 10:22:20 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aR0D3hdZxNYtz2a5igNF5pyxyjOjICJmxx6xYW6Jo2GrP5Za6fBLyX7OB2uMObBLUyFBzyakijj+aAhyNfPn2FjADDCZ6T5juvTeBkI0uVCt7WnxzvXxCNWRPFOWpp29UgNpFczv2dJT2Rokd9OTlqkXovr/aYLJDncLWwr9+I/Ie8QLlh85bKXYLkM8h3iLd+frPPtyziOfBUlU9ZXgyS3zxPT3/UoTZOFIeia23DV+ekvA2yHHhuLZaXZRqwNoLHuAszBqwn9lZB0f2T34IF/kcMBJ0VrQm3g23lCW/lEAEtanLKfKIcyaduGT8DKrrVuCB46pZxf7vyv0IgNEew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R3hhrmb8XAycYjYnTb/EmXNnWitJw/w/ehUspTmH68A=; b=QhZxs0dHY7VxH0dXOLPnCGz4/BVifJy4hs7nFbYU61gO1JfMTn6a71CxXj10XZvYHqnQuAmRyNEG0+tbWWDHQDuUcRCyGHF5ylUDIUaXJdKuRPSUDZR9BIRGpUHh0Vm1skRpnmyTiB7bX8sJE5czZMSII+8Y/JGIs+RW6JKV5KtzZvtjQySqJ/eYiLLu8O/SzWgp90IXJVH+8Ez8kwTtnYj2sLnKPcQBiRlvAbbm8mjazOfSL1mVtIossALpspKBjMU3RugznJJ8reNvty85cLydW0yevjWlId3I01OUQvUS4Za/sVTNJgeIPjULyCNud1auk0CYYqY3Yv1CxLXUhA== 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=R3hhrmb8XAycYjYnTb/EmXNnWitJw/w/ehUspTmH68A=; b=J7IcVbN9GkKgAhts11S89O4ovCQYsRHh/v41GVY7e4fRrQsY43r+zORHBrybHbBvhFygOvCRUgfx3Pmf5QGD8llq2NwPtbM3XQivIOcVmislyT0cB5FaO68oN0hItRE6iDZz3T4WBk5Ognd3BuneeG6nfd6VVJaNLO9eIbdgnw8= 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 DU2PR04MB8584.eurprd04.prod.outlook.com (2603:10a6:10:2db::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 25 Aug 2021 08:22:19 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 08:22:19 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Wed, 25 Aug 2021 13:48:31 +0530 Message-Id: <20210825081837.23830-5-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> <20210825081837.23830-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) 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 SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Wed, 25 Aug 2021 08:22:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 76372725-850a-4f4f-9467-08d967a17484 X-MS-TrafficTypeDiagnostic: DU2PR04MB8584: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:569; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LI+bTy19cZExBnRBPnKa49qoRPNmmYmO0va2AcD0rXMwO3xstCQhqJHOjW5uZqmKzdbOfTk79iKWZLCV85lTFNFh0CX0VCiQ0YgcQvSE0pzyvPZ0U06/N7HFNc1H2j+UCLnRheBRWn2PziUZaO7tbGOg0U3jhXMo4WsCf8SLCDWTsK9RDRhghYMK13wZUl1wVEpaBElugkdLelVCEthplX3Q5P3L+py1J65+h8A56lswZh8oWBJaHOvDs9uysLkU01qJCzMp2QIUrJ3DFA3ZmmhJ/b3fG42pEPhERzZwtXN3dvhkvjVV2sevnsRTo1ehOv4HqxXEW4PsIZZ6ByOA/roU7/YuAd8FNk2Z/uOGy4Hz05bIie3AhpemyS6QArWqimuGhG7C8fGgAE6kZ1I2ZSlh2z6L2AZxfjIUuahm6tqMx2QU+FDf+n84qzgEVrRVtJxFIwiHw0kXKSHfGhoIEh/BTYa3S7nMCk3eJaiO6famXg/N5AGOn/dtzMQojKl5K8hCo/VqukA1Gr8cOX7l0jIkXDLk4heDR0I/HC2/jVK+edPP96PXiN/YdDjPEYDiFObuPCITqv3pbc6FF6LL7i+I+P8uiw9jTGj8erppgBrmCIJ071gVMuwwQxkBHcU/K5rIcVl03GfjshmoK4jJqNcKBnlgR2Q6sGo2iAiMvPi9zSu61ggvVU393i7x3yKzquKuF1kSTEmgOyCCmEe9Pg== 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)(376002)(396003)(346002)(366004)(39860400002)(136003)(956004)(8676002)(44832011)(4326008)(36756003)(2616005)(38350700002)(86362001)(83380400001)(478600001)(38100700002)(6512007)(26005)(8936002)(6666004)(66556008)(66476007)(1076003)(316002)(5660300002)(2906002)(6486002)(186003)(52116002)(66946007)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8K6vldAkrvST/qkQSfQ6bNzQN9GzeguFeOed8i/BSCEmH+wgtzqhOrVE0TUwDHga4gfOeIUrxDK23hBkB/cl1Ovnw0GnMXeR+XkqLnOKwf2d0hS3AiKLCs93P8utRB6Anz9HdaCasg1LHCi/6GH2Jdc2DrKuF1n5rWJ3HAOJZyMtVEu+sgAYYKBpbt4D35hrKxcLW6Pbk3PAyLA4wAtkEKiBN+37eqZXIMsQTdHd20DeB4KK8+9dbh980a8PSI0FRo/xh6hcaGYV5doNU5csiuUoTS3N8yRYuJrSr1Uc+cMIZ683BP3gHHK62hd+UDNZukayortIePdjjD/Di/4o0ZdIxmQ5oqKWg2JKlGt8YngnILAfnL4gktjxWPc7VHgs9sE4KonyAj0OPfsVrWwQU1iCiBpOeH4huinEVK4LHUONRBpprxS+DnHnXjJE1d9E2k8L/DILLH2NZSZ++UHAjkkT4pAZ7U6dAbZRril+gEAa+OOuqrhkRD5ox4dpbSbFu5KiP7BnGSXrcEu6KEmrNcc/g+SaPTQ4o/D8pjvFwLG4fP4PidxroH8roUV/9k8D+jr/g5bSjxqmX6+F7vzQm91eaw1+c0hAu4YJspom3oQBKvPcuDaq9SK5JLwHdHFkbUUU0T+Xm0+Nk2ObkFZSqM8bIMUHuPvlV3bzjr5QaE4b9valkP6v8FXnBOx9HwGz/khHsn0qrpBnTsvKIFHpvsMZgJXcdrRZfZMMDo1pQMqzO6oOIPFZQ2Kr/JDXsTEhssg3IHPtg59gxumSFMqnhTtUHLR1OVfqR8lpZSWTbJRamTbonWhx3qdkbBJ+sBJnr+Te3f5VIgdt1nJmq577ECDqp0RNysHakuUx/E59x2dmlu7WxEHzwKfiiyQax3EaWNUkv2WKVTlf2Ps3rWe/l360SiuJVq2EvUsy/cP7Gi4IxTesN+vNKUIUqlZQT2eRuuEP5/T56bHXZ3rPpMbbnau6oK6dknOl9eZP+NPqHnsHwvLuENw5AbmL3aWXHfk5qTBDwn4DQcZg8aCciQXv1Ced4jKHFlelWO9BZM3cb55dWrvQ79X4SOQycPW0AcadGcPEXdzUDr1a1hpKpHxu74SwqlnWFZ/nGs4gPNrCg9PNsx++dJxQx4MzsQDBdXeWcy4AxF04Mt5vEmVWeb1B0DCCN34fWSEnB7Q5MpLVJkjLKKrbPaPc3FV6OOw7bZnLBZ6kRpo8rNMn/iILZEEWswoVhJ1JTqhmQvWzNo6Wly9HzyvI6Aaa6q7DdJ3i6M8ZodL4MnQwYqrbDESa3Wmnyu7QV6Rv4owOfTc+iFT3iM2Goh7U21efIePpsVmhEjPQ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76372725-850a-4f4f-9467-08d967a17484 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 08:22:19.4421 (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: O0oUb4y6dvtbIQegnPSIrJXS1bQfhbgogz7tIrw5NVTyUHJNX+b1+hMeFdUtIKIEPPobBYrJ2Mte+gz+ku0meA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8584 Subject: [dpdk-dev] [PATCH v2 05/11] 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. This patch modifies the camm flib to handles the AES CMAC without conflicting the proto ALG operations. i.e. by creating another ALG operation routine. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 1 + drivers/crypto/dpaa_sec/dpaa_sec.c | 10 +++++ drivers/crypto/dpaa_sec/dpaa_sec.h | 43 +++++++++++++++++++++ 3 files changed, 54 insertions(+) -- 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/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index dab0ad28c0..7d3f971f3c 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -525,6 +525,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, @@ -2177,6 +2178,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); @@ -2262,6 +2267,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); @@ -2697,6 +2706,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 153747c87c..faa740618f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -738,6 +738,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 Aug 25 08:18:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502254 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp382547jab; Wed, 25 Aug 2021 01:22:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTFtqYWtyVTR9vEP1ROoupjlA8HmwWN3VMfVxLRAxWLljPzUyK4ZwiKmPUWIQMu5yte9G+ X-Received: by 2002:aa7:c1c4:: with SMTP id d4mr46851535edp.301.1629879770520; Wed, 25 Aug 2021 01:22:50 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id dn10si5338701ejc.275.2021.08.25.01.22.50; Wed, 25 Aug 2021 01:22:50 -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=fXdz1otu; 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 A4619411CE; Wed, 25 Aug 2021 10:22:24 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20054.outbound.protection.outlook.com [40.107.2.54]) by mails.dpdk.org (Postfix) with ESMTP id EB833411C5 for ; Wed, 25 Aug 2021 10:22:22 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N+bpR0SpCsyOtfLfLoJf88rGaJbG4YiaSB7bKOqC5dDwjw/NlxY/hIfiA55/vBDdRVUcZfhUnLGkpOIBS/QpJv9si/RB+q2qPin5Xhn2zJ2OBO2iG9/PfzorPk5vNTH2hCjWdZBq9ojNTR09KQl3mArG3YAIVTAjNELM6DWcianlE/3d05+IycQL62/g1ssNw8jNniQ+5Yn4ozAu/o65InsKB84maSsRLp8zOi1Xn25FaS+CUs3ug0Lm9K70yRyTzI3EUwL3V7R6/s8jCJnJKeRVkFJ9TI8yKtnk4tSG54STddFaajE9fy7FoVRBNqjPX95VxhkpA459Pzy6CCR7xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6EJIORFNXa7FdvJg1o7Ys9xXalITj78ptB6rE1u5eyQ=; b=MtYDh5tLVgtr/KvJeum7PljO3F/Y970XD0ez/OEvn/O7w1ReJiZBfOT+X7M+1Z82D6UVaUpNw8uLMcYqKrwiYrgfRYUOnfTrVk3IGK/9i31VkmgiKb/Qv5MemhL/DSfjrxefzEkXQste8UuH19U0vvklj6vjQRl7JATacW6ZskTGBpHzRsPh/bPX6PF5daSKNdIwjtNgjZtLUSi9COIhsVjYtd0Nh3AQd+dqjysDK0N5e2Kud7vuBt+l18g46B85DG5XHHHtdPpyL2ANnvb+qF3PaGy2XR08Bz6oZK7A1Kh4ZXnooHZEp9HwVjiTbj7oW5qCgk8gW2n03MGTFybxZQ== 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=fXdz1otuM9gcXFarQyH0FI0VfKjQYQcIbFQo3aeRJ911Lf2kxicFFqMqCI4qcAXmxgLXqQqjEGE6SmIRSgITeBxzbamroxQTuGrnEJ0W2U/3qXKPR7Y/NIbczKaK2ZW7+24tDv5AcnReXwGDSiAT71yxOmi4eC0TOJ1bYTE7U/w= 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 DU2PR04MB8584.eurprd04.prod.outlook.com (2603:10a6:10:2db::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 25 Aug 2021 08:22:21 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 08:22:21 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Franck LENORMAND Date: Wed, 25 Aug 2021 13:48:32 +0530 Message-Id: <20210825081837.23830-6-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> <20210825081837.23830-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) 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 SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Wed, 25 Aug 2021 08:22:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ea97828a-1805-4f16-8b1b-08d967a175a4 X-MS-TrafficTypeDiagnostic: DU2PR04MB8584: 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: pv6DNglkslVimT+b/mpI73Awe9+mv/Dr2+2+lL+dxSGt+GLAbqWEdVrA+9l2r36sdtibvOGyMFfJGwk7yr208l8FhmLKICg2+MVXC52yGh+C2KrlMo5DT6yRaeldTD+MRh+idjoEy/9ZdFgl9O0Bf0A6bdAyeNh1YL1BQza4IVUIne4sp38OXLrTCg+mgLuzg13db8plx4FS3O8Xq7+oiZAt52bCBVdB7ce2ot2xmZsFZ5SkZq26HHBlwQFE1tS7yi30RHyc2J2qK/BmrU0tLKS6rjOPljsjIEOouplGjgnXYEJr0hFLqAmWZUzaD6ekALwgN4ZoCgKtExBIFfWRY/BEJAW4zVquncNv9bzY6Oj5kB3ZqzPO/rk/CwLGH8UVSLu/E4GdrQy7oSt+lIkFg20bd9oN4mbRM5XuP3cc95pK67gp0EuLj66EvWd2NWy2s64tfEWc7wVL7mQL3fjthI80pHoBzvAV0Sk7kXNsgH6hPknExIZDEgpHLM9XC2VdkbAdMvAMiV5wtcqmOvGhvuXRO3iuopvziVKjLYBIC2ljSNMRm3RaY6OVuSI8gp7WoW+ZfD0ig7q5WmkgCLkD2WzawUZXiWI6pbM+bHk+4PcM4rH8lyzxcv/6EN7bkYi1RmpHep/qbmY/EbNvq3ma+NaKtdjU2AP6YGcK+J8SvAxZzZK+/07ll4P1ZATMjTf3eWhpspbkjb4EQhh+LpTK/A== 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)(376002)(396003)(346002)(366004)(39860400002)(136003)(956004)(8676002)(44832011)(4326008)(36756003)(2616005)(38350700002)(86362001)(83380400001)(478600001)(38100700002)(6512007)(26005)(8936002)(6666004)(66556008)(66476007)(1076003)(316002)(5660300002)(2906002)(6486002)(186003)(52116002)(66946007)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xiXTOqGRs5u596SacypcYGm07uyzvJG9JVIu8tcswgi7CAdewGepQkNPe6MgFe905nn0YxLFx/3yPv2YUjLKgVtJuxTfsP3yt5phK41VjcKzZ77BuNYjKM0clJSPJ2EfjGKMjkOdsf9ooIp3FY5Efw0ie5VQvx0ukfVToDFtJLmqEp/vS9ohd1ygzYeG9QRTQM2Y9W5Ebg10Q+Hsj6vMTUI7ZRt6Pd55iOLNCNUEnH3M3heCYsRPupMHluelCkVYFW9rW7lqw0n4hjuF0RYeOZAlgTGnG+FxsD7gPys6Ee1c0m1QNh+3j4pPPNWOtWjhloMS2QnK3wx9pSrF4mKHrDIUs2QnO7Jp+7CAgFn1KgcDAinQ8bg/Crfs6cDbdr3Ss7FqKnJNraq4O5R5LqeAivdMA32lBQJREQedY8uhLOj6mkt+nLk+8gViZgp+BlsLYoa9ErWEIZCZyp1h6cZ8qTOGX/t0PbTraOjKx5qu9I+yWS8W8m6BL2fOalQFnHJgM9NbP5I4hH3pRWMaplqVp/YBd85RhVNmxdrdToL9k2dm9rKZQTzNl5l82qQX/RYIWo9GMtN/XkWyFUnkybI9RO5JsSvUeEoLzYbpSMYdOJxI7eRrDGVVUcvcEBeS7mYobplligg2rTGRA9FEQ4O5JqylUukkvvGuTtv7Hm2+ROphZQcctafV0uZNJndpEm5PI9SOiWbX78Qcp14qKCtbCgxUQg4d0dg4DGOcMA/q9w3W6METI4EF7QGjYLIXuInANp+B15k/OgY0uqdgAQsB7F6pHkqYSfxY8zlK+mNuRYdH9oSJsuNqDQaYFZAmMYaRXjdjbG9UL/yWPBFgmeQ766QSQztPWW7r0FxbzuO/MNHgz588a8MgnvV65jYZdJFl5iP8QnMprhPnhJUBzi+m6Yc7O2keY/pSWEhGHFus9ljlBX+fB69XaGopggBoI1+edHILvawscbqgg52EXXL2wx7ayRuzmBeQ0+dAmacZLzbmk0JzqbhwUPy37yBJch/VFuS82FrdhrYscJQiU7223WUtMh0bEPUCaeInkVDx4yALNnihZ93OFn3/qSd+GbJEnwvukO4arUlt/vAujA2WpSy2x29H+DASQfAVkqA3On6/cI6gfn1mn2ildoRggMmoRf3bGFvNrn8DqCdNYi6oyp/UcNpF99k/ljgfgjZh4CZFZqCkY7dMJit0c6QvL7mcmo1QooQVFjxQOf8zTulKBnryJKH0Ds4obIRybWSRavcUAki09MLvoh5EMOPWn+njfrp6+Aoya+A9/lm6vzM1dFDYNS6M2nA6RlfiR8YQrE6gUwhvDUG3jgbpy8tCr75e X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea97828a-1805-4f16-8b1b-08d967a175a4 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 08:22:21.7843 (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: oiTL+bOtUeEN3WoTv+quXTku3hJgofUx1chb8/tXdedQ714KmExL7+jNpjN7ROV992fdByYVzx3usUPAblNn/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8584 Subject: [dpdk-dev] [PATCH v2 06/11] 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 Aug 25 08:18:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502255 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp382629jab; Wed, 25 Aug 2021 01:22:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyBaM3LYm0x+lTHhubLa/jfeA+hPr0ZDcVzQUahqFqyjIDaaVVVuAGYZ4zXYCd+Fql+A0F X-Received: by 2002:a17:906:c05a:: with SMTP id bm26mr8542115ejb.498.1629879776908; Wed, 25 Aug 2021 01:22:56 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id i12si356791edc.235.2021.08.25.01.22.56; Wed, 25 Aug 2021 01:22:56 -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=Voqp403t; 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 ACAD3411FD; Wed, 25 Aug 2021 10:22:26 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60078.outbound.protection.outlook.com [40.107.6.78]) by mails.dpdk.org (Postfix) with ESMTP id E00C5411FA for ; Wed, 25 Aug 2021 10:22:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IXE3qyUvHylzgNhQLgAW1MMEIvt8rikXG+MsHXHkUtSlrBkglEzmcOjFg9bavMPmN5mOM2R0GDvvq82Af+jYPQOdol6RN2ljVf8dlwRvpBRnqEsnk1oyGq/BS+ELvMEB2ZQqcj0stBFq+RjPRrd6FKj783qyFsm+ffRbVGw1JAzDvrW+1eJShVUQE1okqDnLKWpYlRu4xfYfhofbGbdVFj+NpA5DtRxLouY8sVqKJyBV0GvAnd/mkrbR9mC0dkvdvv92Yp9cb7Q9dMGREc56u5G17xnkLI5r7deavpT2+SILRotsa1BmBDzn7x3LXkwMZSl6dBfUalW1AQk63em3bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iH5cuKgZBTdYaSnoGB2/fO/69P0Gm9xN1QfkkCR4kfM=; b=K3ORUKfjYTDP8Clucy6sWOTWz3qTuHg2oLNkMT2fGM6uqIV7jnTN/UuHGtqvboie0Stge12d/JmSNmdNGcgFxO7Lbn6Pt1fA5nb7IAPj6OsyI3VYuQt/DPzSfbxvwjjWXiE2uLvD2kx9TCbqTzG0No8+FhS5MQ44/k3IGlNkvWUkx9kT+p1FF9kLlgfv1hUjjy/rdDsSWi+aDDeffpWLLobkNbgzx2REW3nFX/rQUOKeeqciBSdEOPY77R4q1xCY5aTvpS82PDNyzABYmbc9m00w3oGBWu0SCZ+lc9g9MnabjhXG/UXxmfd5gcmTC8nlk72DwzXqPfHa5AEe5bQIrg== 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=Voqp403tPrRNYCbNOqXk5HkQ4N+PVOWWGt1QY0VvZmXjpzHO/bEFcqO7W/l4Ymt5FAqu3AsdHPqYPaqBLgJ6umTuH9nSOAt4M6P/uCD8gXsebDX1e79cgr1OW15NufCDtSIE4q7zGeEPoXpodskalyHnm0DMYYNj69LdI3mgwQ0= 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 DU2PR04MB8934.eurprd04.prod.outlook.com (2603:10a6:10:2e1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 25 Aug 2021 08:22:24 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 08:22:24 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Franck LENORMAND Date: Wed, 25 Aug 2021 13:48:33 +0530 Message-Id: <20210825081837.23830-7-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> <20210825081837.23830-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) 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 SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Wed, 25 Aug 2021 08:22:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2fa2469f-1b6e-4b05-0618-08d967a1770f X-MS-TrafficTypeDiagnostic: DU2PR04MB8934: 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: R3ps/q3oz9iYdJcTSt5l2pWTqv0kvaGY29vY9vdYCaJ0jQ82CL4OFinX5uy5aIliaFfiR9k9sQqr5TX2sAKlue8F7IwEgQmRic6zZ0a6dQlUsbraGY2Hz+gtoxqCtty0erPcFKnl2H2ylCbD8izeNVOpk9VEJbXCDd4WTTn2mx5AVnh7L8z+Sh4adDgrSYUnkgh50WyJX/nyZrJYfS6iAox7hv3tIlaVFutoiLbnm6V40inJQiJKnBmhHoN5Kb288xtFf+Ry9feihAk8jdoJPjZ743hkX3hhq/Uwg4QLEskrmwy8N8DaPTacUTrSHRKbgTjxWim33R9MzTEdYxlDmjIwP93UzZZpuz06xu5PuEBbC8qwmRU+KKtJ0lW8cjczn/AntyPOkUZzy1CIDxEbXr9Z5N9NzWCIEAoll9qcnhhYukBXwEhw3P8jdjdF9ZIEYfhEC+DMlhwTQupbZCXAWM3SXxoWK9mART3PAL+29552sY5TlqMEloZ+wnF6Ra4RFPYbw9MLkzLCgJLPhUg6nS6VKxuPeZJU6NMmyVuJsf3+FHvLIy1CX2EqizV4J1FEPFYSzJHnb9RSNawRMMtZc3fpxep5qZengfWo4G6js2LYiePIm6YFvk05erS9rU4jD0LqYye5PZPODJOEAmnl2DKiDXiCDavO/AqJwYO7z52TkuZgjyaOJN7yzNAPyvSGQ+TO/oHkltTs+8WqMZXBvg== 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)(346002)(366004)(396003)(376002)(39860400002)(136003)(6486002)(44832011)(6666004)(316002)(26005)(4326008)(5660300002)(6512007)(2906002)(186003)(8936002)(36756003)(38350700002)(38100700002)(478600001)(52116002)(2616005)(956004)(66476007)(66556008)(86362001)(8676002)(1076003)(66946007)(6506007)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 38RVoGhOKusFi5nbqVv+t5SB/axp87NwDZB7cqn+PD0m1jgZ6Vov6Kc4Nan+Zk6M2qHgiGcb+8h99/p0x51OrNCZPyCTaRjREodyctBSERqTgzBT7Q9ZH27QDPtuY9AolRr/GEj8Nn2B3PTVVhJMT2ue3AxWzlVfexo3TLm55fIoHtCphmH6bggXSUixgzI9s32PozLlfzn4azKJmHIZ2p37oQpTYZhtm0ExbPHby9uPvDCGvXMM0/xqFDeBjuLgk0vQJgRUy2WVwMD6/gxLTXzqIx8rNdQGoNPk+jFGHaQvs/H6fr0FfZyW1ejx2H6DLKyoEYVqiVDKGhduVwu0ZUtUI9KXGeYRcaX2QnCFjrYmSxjROXSYtHXmEEH9K1G+YXT1TH6t1CI3Jq1zZ4w9TS7hicevJAVkIwdWFRWdqUYVWhG2bRa/YEr5jtYK7mtriveAjQlz2uiKLzzfwzexgyYDjOhiq8M+G3uIr592vSNLpMMp5yMA6r0TiY9xV3LLHAkj3KGIdVtKh5UPoVyXWgWLU7wlifOXJK69UVKWYweG7Rm0L+mK60hDi/AfQ6z2M1xR6m2Gqla4WzoBDg0vYfIeihjOtSwAIujf+cEkjL9g7ZQcksvunLXIE7iEF6qMmwWkkttNEPrxeXLejyco1f5dY1Sly1lCD92bz19j3RvniPMi20At+fMeyVvBuXovmYwuTE0NVlbI9nJfo39lnJxUF5BPheW56h/9kuq8B6QDJTC/C1qFWxgFp5kMdBsdLLrSMbE+e0RdvlqG2lHjcfTdkM+wkxtqiiQRjGD3w8kIYMk0loH3pjExvP5ZS5b5C5NfGC6qF/dH/i/OfZCp/VQq3ug16WbhTU8bSozNcaCeU/hgNZ5ZrDqkontcNdtlR+Z4muiNSUAZvO/I2wp9FwwwDe5dYxcYOybqG+TrReSEw8qykHtF1zMkuxg/eRxzns50VjcI9zcgDOYGDjXnRoI9Ofc1Z2hESQblQLA0iWcL2wzm661eSyJIjypPmXpjlVu265nbnHhMUwbtGvxqH6HULSBb8eG3Vzmime/P7u1lDrdLl3zRhTuSPIxvYsGWQhp42tIfK32k4X2lxX+DrNJDKWgZ4gu7LCWfPnFrX2Zcjx8DeJ7QCrwYuC1jnY4ykZkZrB58ck2hgxkDp9DlrvDBM0TPvQOGoHpupvWiSe8OdVHc08JFWnlosq9aWqDprgRJ769nzsKQVzFNpTm2uDps7VcMppvlNgwYacKYYWQXCrDwNK5mKEgR6F2iQV0+gqNYO+sB9NOBDX+hOpQ4c8gT35emZOGVayQdYn96Lm8zQe56QGKGteEHHEI1bl/v X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fa2469f-1b6e-4b05-0618-08d967a1770f X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 08:22:24.0100 (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: t7bPJyHyr4hWVk6ohopUu2r1rMk8ov6geWtia3vLjQbwdtZJQy9V9+l5PrNy2oQro7qP3CqtgLu3+z6nzPX3CQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8934 Subject: [dpdk-dev] [PATCH v2 07/11] 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 Aug 25 08:18:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502256 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp382710jab; Wed, 25 Aug 2021 01:23:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIQXqxut8vCz0hnYpxl2NXgVH3R1ebP1FTqXPhs/bQhXk5TkFjvq+m1Nn5gwjOxI3qyajr X-Received: by 2002:a17:906:e1a:: with SMTP id l26mr13836468eji.45.1629879782898; Wed, 25 Aug 2021 01:23:02 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id j7si24942637ejm.280.2021.08.25.01.23.02; Wed, 25 Aug 2021 01:23: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=jjqWmylR; 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 D5C80411DF; Wed, 25 Aug 2021 10:22:28 +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 C158B41201 for ; Wed, 25 Aug 2021 10:22:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MRw6VhICUMEMxWgMfYM2zTVPi8Ek7wnPCpQXWBUFj3NS6C/lchR0LA8CVR0MZr+QCF/8D73mXwUhVJBlf0C5D+612ibGYrH+VqR8guDfTk+q2KbDM6wFqjMl+ylxEUXWUBkk5R+MDXShqSvE+po9Qyhpn9/2mm15pATKTO8mHOKIv3kv0U+jfveLCfMWVQaRQ0sBejJdGpICJTeffqfIOHP6CkTwXByh0UlMrjHYtfSESGEEDVbUFzuhWr+cV3ZyJFrgA8zRF/n3uY4sfwzdnWlOYiW2k+IsfGFvK/gDwMV5eBSOnNKFVsgzwlmMGJXeWyUsMcKMB3URkgvYFkt1Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QSQVz2kTj6bO0BAx3VsDyMOTDLe7LgQzU4fvP9hAT7k=; b=gjnrxky94znj1Cag21Juds3qBNSZsaYMzMz2WjRTSMYL5PMGJDjbOWw9+h0gxZ3j4/3fM1FVXRX3vKaatpC+Cl5XjaIoUvGN8IsbMbXE7r6bXJp3U/10yV/TexnQclQZi0U0+36D0GjPKV33YQzQ9E97JOQ1g9ZXMJEO0y/T7hgn7GTd7mVSgSPEnFoDIWdw2ccnRtOnRCU4gQYyieQ9vpPFWAOR7gtZ1D/w0xQyADwl+jv3iL6gZBdgl4dnV2ow1vYsT1JULuoTa17433DsIva8up5W/ptqY97mEIdr8pL+PtdvFgEGMt1c4xu2llLhq4KUmp9Rjes9jXffb39WNg== 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=QSQVz2kTj6bO0BAx3VsDyMOTDLe7LgQzU4fvP9hAT7k=; b=jjqWmylRYspy6o05sG8ClO873iwTrIRjNbDeLaAK4aiFCzBhMe4lwgiEiClutoJABzNHBLzvvizqtjQQ9Me5FI0CRWyZUABzTSvKeRLDeZ50vUd9pYK1k2Dt3udX/6yABuXXc2Kz38xN/RKhDc14fAsmMm73yLUJqexliQIQMHA= 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 DU2PR04MB8934.eurprd04.prod.outlook.com (2603:10a6:10:2e1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 25 Aug 2021 08:22:26 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 08:22:26 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Franck LENORMAND Date: Wed, 25 Aug 2021 13:48:34 +0530 Message-Id: <20210825081837.23830-8-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> <20210825081837.23830-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) 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 SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Wed, 25 Aug 2021 08:22:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ece2dc1d-fc07-4cad-5ada-08d967a1788b X-MS-TrafficTypeDiagnostic: DU2PR04MB8934: 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: b2PZLnQWs0NXPfGcLVGQ/aFecMO3+TLHHQoRRSlG/Fnm7Ql9LuxfXQUoOkkFC840p1htJ3i/O3gB97RmPxDadpvUSOR3zasfb64Qe5VO5XeXfFaSISjyBmCTIlZk/YnfPnSAdq8y1S23OQVLM7PTy5BDyoM2yFoSSJvEgfaQUnfpwElex8GtYofHlErSwzwZELeXRuFmTNadWubRxkS+/sT2F8Z4v4slEiW4oWwn5AYRz9ckCeglRvzQ9xmtgs9FC1IIH5Npxrsbog3UBO9YTDXUI0qwP9CYwMClGK/pf/I5bMyflTWag0H6gmptAumFIz19KX7wQVWEt8wItNKnJvgL0yr/A3jQ4m2M02vuS7x5kXQEVWdTt0LhQwkjMa/xIY4ymTx5A1IMEfDogxwaL2EorJ4hbR/x62VTnl3cs/fe3SyIkUpiQo2PlFrEoUm6qEIpItLD5+ITuC1qhRkmwZeIyKcxxnauJI2S4WcUvzNtBN7kiwpY7qC3tfe0Dq5a5ZZlbFkPHFwNb4E1dPpQ6gFiuDzhTaUtu7N+suJ8kT4mI9CEekGHUCr07tmj3tmZ21mO9hxqK5ekLDj0KQVJobp9VCR7dZZ08r2mDgfCmDzVzPsJb/x/gNtLFiybD0i4RzlJVNw5zgVt/a2kosz67YAIF3DMfFerGR7KWY9dku0qabbO1LzKWYMVGnJ/xBm+/l4UOqiifNyip6nrSCKcQA== 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)(346002)(366004)(396003)(376002)(39860400002)(136003)(6486002)(44832011)(6666004)(316002)(26005)(4326008)(5660300002)(6512007)(2906002)(186003)(8936002)(36756003)(38350700002)(38100700002)(478600001)(52116002)(2616005)(956004)(66476007)(66556008)(86362001)(8676002)(1076003)(66946007)(6506007)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6/JeHHppnvEqIDcqTYjxyLshiiJXbfOWgiLDXAntgIKT6ftLQgQG4oLP0XkpafvBoIOAfYGIBpd1SKoA5VgyNzr9fBakosX8DFclHGJZdg5eZiT/RDJehzvn0VozIa+KK9WJgiisPhZ8JA6iJqCnlRhqWfr06obxQ2vR2Cc4uF6e5w9Ishc9sYvX5gscz/EOpxhoBTY9AbeIoSP69eWxm3iLDA/AK3wz+KezimP9NfF08Qa4l3AV9PVRPmAhsCQimqvYizVxPmD02zMtmlR8nQb8Jwus1WUt6iBAhiTeWbb8Dgx3ukEG+7eg8uHCbl5mFhCCMQsP6yTp3ge6DYhwWnBYzzXcZx/ixYeQbwI8P5150hjJkqSPgO2U865gxWPppN/TNsJdweIiFsCxxng9BTisWQQzLWv3+X2k7I/5u2BaD2VMp6hUg/VMDzAcEl2auDOp81Zf7eRBrsGFwqpy+Z3+72mRGR0We+olsZDDnFVUFXwotSLpGM8vWpmmoLyAOTXDE3PL2WFX6TCpihn9yYkf3xyKxW83umU4eCg8KlUh2Zyv430uhdhq/RVA1WjVAkHmwZePZK/RkD2LAl7ftHxP4ZL6fHe7E9d1cRR5H8pgm4HccBE8f2MKuZ/u1iWRAzPuXJLdWytUFQUM/bNMfSUPJTCcTu9w7xvRbK7HZrD4ZDHuV9P6Ex5nboAqz0XeaNC1tZB3LOqwfkAioMI1lTUwzme5lZexeXVwAia2/ycFMsSHvt2Jnn/5Y69h/77YVvMRDIxoAtiSXFNM/PbB6oiuqbKSvYiTX1qCuUR4oJTnvEjIl4mnOjFaqgpFtHvqCH2zByu59VeIm2+JvnNjez2hXGFGjZ3Q+oVLQznvV4Z6HiEGRNuQEcDF5UsdpFfhSPyZ35guwzq8Olq4OXBAE7x3m9h2iN7CIlAc5fyLRdhs8jy7SptYrdHbbwda2fwEBv4bfTD/qrl1QHopsH7csYfl1GsRUZ0QPooSR/JDptXPfWUr+IGaI90dILAMiWw+6TAge7W1NtfOI8JQn4HUMGU9G5YAbsTAj7DHrlshY/WrDERgrasWzD7gJ3TfwaGgyzn47Tf9eyHUuDdmUXd1Xh1fDNundjMkeKRplhNJj6OCp8sl1XubHyLxgwW0x9Qfd4gWIVRfvzDV8kZuTyMdzTqkB9h0NbMU6asHHCQ+1wiQhNKThdDLU2XhFnNnS8/1Qj82Y4J66nhyhCGPThVtwruB6toqkyTbuc4WDBMOZqSNRmzNzcOUaNjDZhbeegZfLxo4NOlw2SUsOZaQuB5pVPlJx4TPHGQChSqrNloF6pw+6owH3NeQqrrmVkqugeA7 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ece2dc1d-fc07-4cad-5ada-08d967a1788b X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 08:22:26.1431 (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: jf+46F+o2OCHWV5Yw4po/NiZ8QFEyws/+Ik7J/kUpk84AfLoXOcEwwYHYAp0NmUkXrEOiboXnguzdstoq6k7SA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8934 Subject: [dpdk-dev] [PATCH v2 08/11] 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 87a94b2c04..3362e176a9 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3255,12 +3255,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 Aug 25 08:18:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502257 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp382787jab; Wed, 25 Aug 2021 01:23:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZR4TdICki+8z6MKfc15OVEC42Y3Pl78IuXl8QbAgi5e63rRO9yOL6i9g1z+elKKtRXmDR X-Received: by 2002:a17:906:58c7:: with SMTP id e7mr44189274ejs.197.1629879790362; Wed, 25 Aug 2021 01:23:10 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id p4si4008607edj.118.2021.08.25.01.23.10; Wed, 25 Aug 2021 01:23:10 -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=WPyJZ9eA; 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 48FBA4120F; Wed, 25 Aug 2021 10:22:30 +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 254DE41204; Wed, 25 Aug 2021 10:22:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J+KtUy7cW92Wxmva/Nod90GMwwLCgPcWFO5DK1nikot7BXFXl2GcMiWnSsDWp0HBpV1Gkf01k9+C8tf/0hqDjx9tpjy4QTBNPoTNCMJMHqh6ojd/PUYY6cykGov3s9ZuJhnZfi3qb0P3PFKrXFrDqInuq4TZM0xFYYi+5AxKHjVTFoMdJwhx8qoGVQGZho3O+oMNtfDSh2Tkn+cL9BLfI9ACVtzTt77kYBzso1cSZlojL+6BrehnEkS+QxgFM2Ba+Q4uGaa4JU4WVQmw5c/JDbGkGDGEJiVSEfS//hrOPF0RO6ak3deS2fZMqrG0HNjD0ZH9nuB2V0McL0pniRNb6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dfwi0F0b/znP6RYWmOopmfjKTDxG/F0VJQzp5T3RuWo=; b=LnunVXzQyzER2x+bsWSo1WqFZ/4u1icFJAkFfCb8d0tLW78ku7IfTyJqFIrKGgnRyEp1N8jAY7Ez+lyPdSsiU9BUWGJ+FzkO6Y9df4GHwYIDHtWYt54JDnU6dz+mxsuIks/l4ktQvEeSblQP8CRHqEe+LBKxGTbnSCDrCtzCLzS/Yu13x9eaSAvAIdiWp36fMPIM089tuPygHKiZClX5XfP+AvVqewYNSzvenhMKhfvyMa4uK7SXhwFk/n65HGxKd8hhFZmHbCKEXSWm4MDm5PImBg1JE+3dFX6t0C62IGSkfzV2dlqhB9ynueEbTqxfgkpwiqaS7DZ/0quydXE8gg== 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=WPyJZ9eAQ7zOMhRlPyX4oYbKH5vPgBivDvuRVajpeLZzKi5tkMXWZdrV82kzLLAW0W6js9q+vjChwcCkvongpxhFZ9ogF5Q5/9CC0ikpKHz1rO/4Ivl4Dfy/Lw97qVYgVng8VIwDJ1/HX8FtA+ggHsUJ9p2ImGB2wKyKG2P0nfQ= 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 DU2PR04MB8934.eurprd04.prod.outlook.com (2603:10a6:10:2e1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 25 Aug 2021 08:22:28 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 08:22:28 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh , stable@dpdk.org Date: Wed, 25 Aug 2021 13:48:35 +0530 Message-Id: <20210825081837.23830-9-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> <20210825081837.23830-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) 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 SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Wed, 25 Aug 2021 08:22:26 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 31313e86-fbc6-4b74-62ac-08d967a179c4 X-MS-TrafficTypeDiagnostic: DU2PR04MB8934: 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: dtHZ2qfSASCxS+5XTcCOUQh5HHXSMbMb5Y5xX/RTB65rO3bGognXlXYTVlBKITYoSQxCA7MJPXJZvQ7ZyS79jdz1A0beN0eVty13sLP/ppq8ltMfczZsjXRX6znGHXwYUmyMyDa0H44rAqEMAHYHKahGeNtPIbfUU+GQ19//g8B6tALKeT7X1EPp5hrIc0KDkpV+pzjRWla5ScPUn0LfGpgjbdefeMh1FLH27tQeT32zNmJ8h6TRVuFcsD1y3vyKOPVfJWnAV+vowDsqZ+e77brNvdBtPg3/gbFnkw/QGGJqlZ4Am6+eCjmOEnpuJPQC+C85UOuC9NUlaZf0G+kY2+vHtc73hACyD5CDQO85cyarxSaex4tHRiB0wQwqVk2ktfx3W01vbTJ0DqLAIGJWgs/9szLBHmDDt0v4NdyIsGjWn+c4NowFKBHov5UMsmRLIkoDLeu6JtT8mNOynWrmgjhNuIxcqdguN/CGlGsc306RQCmrYP3ZO6LznnW6fUk9HFSkmkY01mULohUm65Nta9Df6Q8PEeBQoRp5eDlDLvwJBdVsP9KaB58uL2vIfcaa5MAVII1g+2QZ5XGwfyXZJbQW+NElhlhl41JJWPBQwHz1gtEBeE2irP+bjEaCZ4FIqr1XtMqbYWg0R2FsK5OVpXDzBpKOrvmHtn0Qqwinl42lNzSFws8Ltcn5A1lO+E3MDeKuMbCp7djGd94CCVIPHA== 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)(346002)(366004)(396003)(376002)(39860400002)(136003)(6486002)(44832011)(6666004)(316002)(26005)(4326008)(5660300002)(6512007)(2906002)(186003)(8936002)(36756003)(38350700002)(38100700002)(478600001)(52116002)(2616005)(956004)(66476007)(66556008)(86362001)(8676002)(1076003)(66946007)(6506007)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: r+Pgp7P4o/+FZIpEXNWu2sM6DG/n7Zr+41PjM3XZe3VwvshY2T38ZoDW50DbsQiUQoz81sfPCmRdPlerI3OhcvEsPme4lYYqnqchPl9Fs6XoFI6aONwZ2BdU8ph6bxZvG1dN4QQHb+sX9AjsFP4TyK7SjNwylg3SOA8m2cB/ifZ0Tdnz7Qftl5GfAqCoVee4L+nq7XSfrSmeXDY9MaydTY8RfSeLY8qre0wsZjSbemv7aG3gmmTsCranxBeq8Iab8ADBQUpPob0y9nGQ1NQaxqtMlEzZD7O2VC1IzH1oTZUS4hRyhqM0wJJIoQPmTxQtDvfzjoyFeyvajqM1Dob9q+45vejGCYpLU8PXyV9Pg4pbO0yNnFTA3J6VwaVuTsbnLvmPcopiKzj5wuV4/hQj7q8ivKMox86PkfiW8tkJpMmeso9Uzh8/FusTFxQ5/7ZKFwSrxVnunHYURf7AeApS/NJQ4NiIGgC8u1lV3uaOrRK02DeT0ZZwVP6C1+fqM28wHCDFBdAO4CSegu3c5vQSNbYJiTQWloCJk8LQr6JJWxcs0MVMAnialdB8astH480o9BZKO1FpOF5r67lLjxPoau1VMwoNJGIOSOijITJBVhcXx65Z/GvdK/6NVCUDu/u7uRDRLoONTU68ywKfcKvXgpugUd84dXZNVZw3t78DqZIJRkaDs3l/9PRMHZg/4KNjMn4O+lIy3DmU0w1tW202Q+dVmKNQ3YDowyQ/2EpmNXUdkvfYbNNln2Wp9AAuOPMEjMZLAT6Fpq+eTb5TcjKt3Qi5Nd3Uz28EfEKKBfe4Rnf5a98HpwCHKy4D1Pk85x52yGEs6LxhV8/q6sm+zMZlq9lubd9Ri/xC86zJ7S13C44fPQEwb9OHZRBtqSBlA6I2ARJOKLvHlxY2vTc59Y/7h8qtMTJ/Dwt3GMKgYh5TB0vM0bWdFmqJHGjYunZCQ8rVbp10n1bBBtjk7kbpV2ME9QdBmzzrJ7U5jGaSy9Kdf6/s2Ux13/yzkEdudJqKDn7NIhJv6M7aKuPkWygHI2I8a9BWoM0vFYK9EpGY+Ooskb1Rc8tdkmcWmMT2LbkAKIRX8A968REkWnHGxfcIIGGWxdqxNKlh2FfXomlnDoRoQvSmdv3dBiR7p9RiVDGl4i5HOUWHomGxxtOxMahwtac0SejbYcutACZFnTBTEu1qJQ+UZS5kbBwMbdpF/SIR6QeENop4BSsVEkRmuFz+2hWsqrVVNZFySHD8/KsW0iAIYUtID4stdG/HZvpzkRm4dthV/C75DDPlLQ/MlPbMBtGk1ViKK7krHB0Z9Sv5/qd8JqHmiWxuU4VEBRjRb41GvHO+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 31313e86-fbc6-4b74-62ac-08d967a179c4 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 08:22:28.4400 (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: zOUF2wuEjuNVXJcLRqqUdGvytTS9RQdil+k7K6uJtSrDituwnuxcArsPMdRTXk+Ukr9n46zeE+iZHAzB1v3LrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8934 Subject: [dpdk-dev] [PATCH v2 09/11] 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 Aug 25 08:18:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502258 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp382857jab; Wed, 25 Aug 2021 01:23:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAzkUKFtd+zWOUgRGQXWPq5aAqDAkECIZMMo0XLOP6oEcshtnWLiKZfJ156XMF9/mISSgt X-Received: by 2002:a17:906:6403:: with SMTP id d3mr45406041ejm.37.1629879795535; Wed, 25 Aug 2021 01:23:15 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id k24si19862187edv.610.2021.08.25.01.23.15; Wed, 25 Aug 2021 01:23:15 -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=YVnl6uo0; 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 624A4411D7; Wed, 25 Aug 2021 10:22:32 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60085.outbound.protection.outlook.com [40.107.6.85]) by mails.dpdk.org (Postfix) with ESMTP id 3D35741215 for ; Wed, 25 Aug 2021 10:22:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M/u4SBVbnhBhrl9P4Xfw+tjzfLQdNkv0+KAgeXBoAht/Yix/Nnn7NEEkS8S3nM2YcsDjCZBsEjQdEHcxXYHEu1YoQKktdJZrB2YAhQeyqn/Ek7nm6q59ovijwTZeVrL7HNtWg9/PpnNA2W7aHk9z1sf/zeQicoL+s1/5cPycX+yUQdIMaAlIpcjKsdyRbwYLZCCyX5N7zGuKU0KgotZa5MfJ7f/ZfdOG/HHAkKW85aIIZ/9E368GIAqUDtN5tfzTA/nkWonFudkQ6XJU+o7B+PoyaFhFglNcFS+hqXwwsQeEI7hOV+glHMJrqeQHJAzoybroysuTQ+IhqEgaAI5Xwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l1n4SkC6Enuk4hzJj677WJbXyl8DMU5LkldOtaRyyg8=; b=BrqTINuE1q+SxWBJQ/Zdf7r5wMC2/r9q/hQQeMFJhyJevnpbMgs4DOKYSPOQ9heMazuHNRk1+/dOpzSF//Z/aq3VSFvd3HJgQARnnQqaKopk31QUQq1W8Ay/4fHH6TAvSByfZw+PKiKYxnkVzDFbvulWjHu47+oP3IJNjD5ntPs9mjD8BO8noOBirP43I+qZZSSF5+dX4z2uIsdRY/xkxhTltFJa347vsSEjQxzsAyujES2YYXs+iXTjGjTKe/3wbeAReFhBB705hHQ66cOrFd9DnSDabuCoe5RY82I+FxoVv+aPL1WJgzoU5KxwSKrBk7plzKTRNWyKiwIM6gVWmw== 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=l1n4SkC6Enuk4hzJj677WJbXyl8DMU5LkldOtaRyyg8=; b=YVnl6uo0i+UI4yJjjakWVvuh+uVpYqHvFv/0nSYgQ17xzcXUXUuw/WM5x3X+B1pQY+jemlNiOBPrOPAd4vwduewS/rLwB2ghET0MUv9ASwlOD7nOQ4aZKlNoy0r3PdnBKfVLdJpi/W58ixjY/cffWDbO3tdr9IneYc6d7l5rwn8= 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 DU2PR04MB8934.eurprd04.prod.outlook.com (2603:10a6:10:2e1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 25 Aug 2021 08:22:30 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 08:22:30 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh , Franck LENORMAND Date: Wed, 25 Aug 2021 13:48:36 +0530 Message-Id: <20210825081837.23830-10-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> <20210825081837.23830-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) 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 SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Wed, 25 Aug 2021 08:22:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c9e04297-c38b-4445-b08d-08d967a17b36 X-MS-TrafficTypeDiagnostic: DU2PR04MB8934: 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: LGiWyVuDVY2mPhxJ1uqBeE14gYONl0S1aDIlmPhBmvdRb/oI+5xp0SmeH9YNOdczRc55F8JBQU6GbG0EqmmuwgVE8cjz/pKfsf/1/goQW4FgdPMTkWz5YOeC1kInDuSJnmNcLA/pwaS4iScj6x9qeZsrGC9G0Odxf/+7qFcn26PxSKYsPxXq3EbZdjCjqQp0ceP5ZRlPFORX9fTTZK70SGgpMHAPrKfLlHy8nsaUScSqgv4NS1eNZr6093xTIzRnWES2dBh/ZR76Qf/HCJAgsKfKd8mA75/SLCvK+/8VTZwTjY/+mGA6FP3QkXGuJDL0QgkRywJh127dNZypuZik2xT6v1oJMkwAbU7oadaxS5wgw1xIPUiLZ1VUWRlKfUVEOzKk9uOcMlG50KQRj8dnB7XaJLT85QzNn+HiZvfADU6cvxgbZ6h6HyzpbUEZCd6XAwrB1RqkIzEAodVFWliP3ZHYDaQ+lhbhW9HfBGhRlX8LwmnJQxbZSeiuxKmkUHHOe5xzK50oq0Fu7OhzeArFN0QjUqTbYWG8pXK49PW7m/rL4GtVk1PQFit/+HFpBlnDwhhqxaZzPEinf+JotkHH6HV7ci6X2iOodKPgjDrNprOGw+Q6gYYPc70VAakwcyLpsrSNb468m4mH3jLCl47SthIOxPcV4bOarXA9gXWHd3DZ18X/NVV22fvopP07YoSAgvu3vfD5CVlXO7Ur9ugbqA== 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)(346002)(366004)(396003)(376002)(39860400002)(136003)(6486002)(44832011)(6666004)(316002)(26005)(4326008)(5660300002)(6512007)(2906002)(186003)(8936002)(36756003)(38350700002)(38100700002)(478600001)(54906003)(52116002)(2616005)(956004)(66476007)(66556008)(86362001)(8676002)(1076003)(66946007)(6506007)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +z93Sml+E0lbllvaVILNo/fh+jmcX4j9IF/cz3LZ91kV/SJrgOmht908uy5+0Ts6wldiU8xJBBXs9jwGhdEy/+pQkLw5A+5ZFx+XqvGo339wX0auAghzhFBP4kUs04wq4EquvbL32wvKZRX97tCBPor266fXopEh7QLxpe38v5VMKH9IQ+lZ2OKFPLM+76Uz4RXlqMHt+Ph/h/OLn6HKRMGV1PnPtIPXXYA+XPpKtTw+sQ2shbneHZmg7ysGf50Gq2I2eS85toIE5DQBirLxj4YFFqFHO8lVYDWY1XshBdKHykfurVnIw8I+O5ludRy4pOtOvDAONYR2tU9i6zjhOs5X1UaRB81pXnrCmX9FozKlRTrw/ReEuuEi8NrkozkywGS7aRCDdfaDXkLpjgjshSCkjVFAJmvnG5S9n3PUkznZ3WKmruDC6mFg9bF2FJFfi9oUIArn9oqH/urI4IQeLuk7DW967ea2S5uEw5co0rYiKIDtzLmJPpLqko51K8sUT1G6n11ys9au+Q5X4JGEESFgyhS91ee3pditQtmM24j0VbqCtWq1piAO+3EH84VULsRIsqIP97cM97fRx7AnW2eAnrCK22zIMKW2fONGQrEfcNaCqC6sNByEIQhdnfgxvDygjfykkvJuYv0rh1NpvD9JVOusRRf+AEmJyeHL/aZbBv2bSKlZQpFqrLt1Uu8NmEw43iLO7768keWv0T/tF/mrTLuEcM7QRyX0JgynG0QVq20vopgD4IReizn/lwZjFtaFjMkUyJR9fRHzIlVmgSVtXMwYzs2Lar0O9BETrDM4I1BrD5Ean7DBuWBatGBDsoU8TjKNwMFSBdrPpozhy37ujtGvZGeW53u7WoSHdksFKnTdutZ5RZugpfHWCrFrDGbfDEEvuLjp0dDA2pgaqykGhvdIEJSrd7eSF+/x8G+nX08zfeSFIeihTVIgwycRaFDLsbxKo6xkogJf/0iBAw0pd14o0Ma0XoToSZVo3XmX0mqs96t2eIFXg46MZJlFNN1Rr4olpC2k29HJbDTyHZ4KQmAypceA1ZwIYbmmXNeaqqgeJlwP2SrevqsV72OypNsrWnMSPTF6GbQsMy/SymSpENpHCNUpJgbI9bGWbi9ir+414LNvcRCPrqMmHyqZhFl3NtdVxdxUsztM0+7DqVoi4wAAei5kR/rtbk0PiFINEblP1J699irBIgTmMBi/s2pTLFnkCqI2YxS/k75RSLF8PsCt74uEAYxhp9p1NZkENq3kLcA7MiBE8MOA3sUaRNx5CZtlH2YHqcBVLKt9EvVd31SlPBStkqGcP4ljD9FGstXlyaiTZ4ZYQUTOoL6L X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9e04297-c38b-4445-b08d-08d967a17b36 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 08:22:30.6831 (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: YnCT3UHMaLFQhX5qZiDp8Qb+q3JCCVTMMB2ttIhFgDmsOc4GotaijUXT3rajhxeTUoMFo/+Eesr6vVaBB60GSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8934 Subject: [dpdk-dev] [PATCH v2 10/11] 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 7d3f971f3c..74f30bc5a4 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 * */ @@ -260,14 +260,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 Aug 25 08:18:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502259 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp382924jab; Wed, 25 Aug 2021 01:23:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7z6gWq2sB9HkwqQkZEOgOrAZIXGnC0mVDyNceEi/3uElum1kl+pZtCJqATXxGGlCAAwKT X-Received: by 2002:a05:6402:3c8:: with SMTP id t8mr10664247edw.150.1629879801224; Wed, 25 Aug 2021 01:23:21 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id y6si3539744edd.586.2021.08.25.01.23.21; Wed, 25 Aug 2021 01:23: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="rOt/mnF2"; 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 87F4E41218; Wed, 25 Aug 2021 10:22:34 +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 2556C41208 for ; Wed, 25 Aug 2021 10:22:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XgzdNZAZ6kp2w6JXD2DddEB0w14X+1h79jl0x/qSY57QCz1JwwBrSdyX2sOMIUMfFSvyA4tO36QpBhxDijrV7QPhfILiMMvO713cA80Xi00ttBXhx6j7qryJUUPEaVwilOpo6VDrDontWKRMRgSWIU8xc60s8Git+OSg0/QxzSmx3otN18/2BhymccabqYBEQacX17hrvfp00fNSKlhw/qXq5CFS5ByB9BFuhOWJSuPMA81WIFgYAOmzpvOSKWGSPmNPkLEfwCkLBv+9xcWAhCAx3km3w5b7Qu32k/X/C9UUdmVbQ/piqryUA6xcCHUgYoMbV+QCMjgEdD7pk81wnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Jt4sMv4uG1mbwoYsBk5sHgcJivJEHxSiGV9yFEmc028=; b=Vacbav0JtCn2GlvkrI7wwwbqDfb9n9WLepo5SdcvE52BBGvH0sEqkaodpCAXbOnPHrTMIuhcZHSqrlZub+yNMjNQVgZpiHcG8ojZl0S0n5wk6WlTb588+QVyFieLZGcXu/nLVatQkatEv6GLZfpgD2LA2TWH2PZXBMgBqzYd66xR8nfUqVwjE3aEd37VB6XSFJ2SGTL5lnrv7wwJ3Fu9cEw7OLWVhI+3iDKjrdvbiEQAmtSjQuvT7kwMmg2WMWOkcaVD8T5gYDTW/tTEmfYmi16iH50ZqZ06lPEH0epFM1sLuTUGvV87m7e4iEvjIgVpf/qd3WmULoq9G/bkpSmQ/A== 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=Jt4sMv4uG1mbwoYsBk5sHgcJivJEHxSiGV9yFEmc028=; b=rOt/mnF2vgWmLd7of+FNmdFreDYAqU/ZvckaZR4KTUNMf18/fF7klfyqyNb2jkWrtJFkKYZNvBilCq4rzTUxmjIkG8lGV1iOuwh++qi2SrFw0PPu+jJsQrLUf4qYA0/rQ3V/5GMQuPK/5+bH6JaFyMX27UwPS4/X8HzXHclbuEA= 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 DU2PR04MB8934.eurprd04.prod.outlook.com (2603:10a6:10:2e1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 25 Aug 2021 08:22:32 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 08:22:32 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Date: Wed, 25 Aug 2021 13:48:37 +0530 Message-Id: <20210825081837.23830-11-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> <20210825081837.23830-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) 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 SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Wed, 25 Aug 2021 08:22:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1cd96fa3-620a-43fa-519a-08d967a17c2e X-MS-TrafficTypeDiagnostic: DU2PR04MB8934: 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: oLiBbTCPD7SwXGfrkbFDNb6SKOhxk3JjCfMHoJ7yKflsSjuU3wYs8TKMPruThC1Klu1PqUNfZRxc3w5Ojrx0mLkS9bid6aUfgxdw0o8A0QSXkIgaWRl4XBhYihhPYOdFy1jsnEEhP3WHha+HdUOpYLOBTTd62yoUOoTFz98OmCJzBJCeze66u/ahBn87hEDHJ3q5EMVya8v2xHSaoX+OzzKj7/DDWWZGG2kycPhvxpqXk4JVW2mUBh4t58RE7+8Lu+4jG3m2HGwjhXvhl6tv+xhk6x89tKkb1ZUCD2SvFEOKfE0B/2GRbKh2hQLsIyNuJ/J1mn9FNwH8Xs6jWE6QryFGzmxK9sH6tPX8dWburE7hxOEWvhcnPHizuvYnnTuDW7MbTbKblDtO0YYy8PPK3Ozc7WVAUZ1yu2MXX9/tPAOLASFPPD0v8j35QhjvLJ8ez1Qa17vWEC3JJiR6i6hN4G9QEdeAsKgtBgZDLnkR3Sgi3ItUZulvvHim4JZpe2qSWqS4jY28+7f9FV76oj4Zo7yegbS/8EWfmumrZnJm/nTB1eXKvv4z09xVgA54Sa5RkYkM3njohihWEj9rNFYRIXgCgwkXXyoemJYq4jsm28bn1LVcPiJ0kXBdQ5/gXrNEyZBV+PKVuMrf2khQ0KfVr+8FfE05JGhwK/qKe5cN2UgkjloO866mhI5su9hAT2yu9z3f03uv6KXRJPzWB9ljZg== 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)(346002)(366004)(396003)(376002)(39860400002)(136003)(6486002)(44832011)(316002)(26005)(5660300002)(6512007)(2906002)(186003)(8936002)(36756003)(38350700002)(38100700002)(478600001)(52116002)(2616005)(956004)(66476007)(66556008)(86362001)(8676002)(1076003)(66946007)(6506007)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Znx7pe/WNNcizLbBIlrwCsH+1bJLbRjjJa+DuZQvfzInUQxoY+XdGBec9rH86NLnuHeTrhQPC/m7MsoKTcYVItDJR4OHt/murp7/tYapZaTibjomqMDCnxke+gk7n41zmmGWvQhEt1APC9WJoZiHj4DUSxqlei9z+iIYXxY+lP9v74vz5pyr4u/x3VzfgnaJ2j99XTeX0QJFN+mwK7vZFf1G95khxdIcO4Qzv9a6SPvEmNd/m8bj98NhKK/Py7nAEfn1CiLSJC5fsw/eCGrprZSGDgveqTTq7B2y2m87Y4QKe8tWXZQxt+gn0y8t4yj7M/fDeKtG7vWEdxIUhhXekwHBIwUiozXT0RqqM/NXG1YodVmAbGXsyKNVSrqB8SSAeoCtxFFp0lt3DA35upIETziaP+3eQrqx3R1up/8PAU4HJEEyYEMS4G99JjBguHGQwlTPhu49jLxq1NzN76/pU7exgKgMk2JeV6TLcM13WMb5QY+hf+utrSOnodt+6+hXEGtv0I+kxhl8uY3Dg2U0eC+PaCCLT1D9HpN+4HnfugkX5pUixy21uGReLxOLsP0AtIcf4STJIsqgGD/ZaarXB3bDjQa8OBhWR07t5AUaCovo50ep9ZW27mEwXznyrdJhfqW47agCOo/2fahnGgdDXSQBEUW06699xmLc/RDzRsdXUVPQCukTZjVCjaOFmLIG2TLssrLk3Cpe9WfL6kgucCzNvVngtDA9ll/BmaXLVN2JlMuxJ9yJLx2Pxp3N9Ovnws6u2ptVJH+84DzYhhP7zd9WlcH5QPSmpuZxDid/zrvHl0HSVUWwpuQYka64Z+29N6quBzN2YHopYyg6ZZjxWIlWDGHmuEWGyAN40IrlPV5tSb0UgwZvGGjyOAaoZ+72IOCqpyle3kCDa4eCpcoXnxWl1LnY7G2qjolKj7GD4J7nwwEn1kfuXnvw+WYnAANbVgaGw56Z7KEq6jpBaf1+jIni1oi7f/fSiyztUVp7I4bWXgX6Muy74cnK0QwyQYzf/Q5W3yYGOu1c3ylSTVFgplEuUG5x68B2TtoEAE4bk1vvDaiVaoj2F4TUs7Fk0JghlVvA+hW+dAT9PJPfUYQAW+8/YJZC20AToAJxfIF0HvnWXqYEt2cE/OY6EKEKj59ZP0jgbfuB0zWHK0nbxopaOgWHISsVSLnO3eXBnsqZMrssv6BA9nvuKfCEXnYrwcttb7WBDQbOY/QndcuEkdX/Ny4zfs7B2UFJP33w68XN+bX33RORJXzQaWwkFeciYr5a5kErMkpa89SQJ5CBnyYDgDHmDuf9tvC71uQnOiigcl42NzniSBSLn8OTONJ1gtrk X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1cd96fa3-620a-43fa-519a-08d967a17c2e X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 08:22:32.3269 (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: VHV4NqSP5OpmK1k0fNswkq3uuYWumw7lVilWdE5ZXNxLixL5s5tLbw12mo7JsqkyinzWEyx90ieeWS6ZFcL+NA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8934 Subject: [dpdk-dev] [PATCH v2 11/11] 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 3362e176a9..3a8b11c4bb 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1702,8 +1702,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; @@ -1715,7 +1716,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; }