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) {