From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 852A7A0C56; Wed, 8 Sep 2021 09:04:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A42D64116F; Wed, 8 Sep 2021 09:04:18 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60072.outbound.protection.outlook.com [40.107.6.72]) by mails.dpdk.org (Postfix) with ESMTP id 5D24841167 for ; Wed, 8 Sep 2021 09:04:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K+UjOA38NutqNeDRJbxNq8n+DWmb2o9XbS1KZOpqtz5ulQ+l8zipRPZwe31laiUJA3vfRQRSs9L40s4bEZ2n5ax2QE9GBd0qjgzHxLI5i6c9d9dctKmFhNdWrWTeLIwlwrsUlMZrkfFijXJuvWAbj+P4UqiVO/WhNmhJzQUE9+hEN6T7scCeGns1zWs1SBVy8ncw9otjr2TsCI9ce+xEK9f+oaBorTT4+vD+ohjguSLnao+51RY0N9wun2Cd0nDRxtMM5Y3Yvvjxt0R4gccz7W8TT77nX01nZ7dNYJ+buFfo/mD4WLKf89oUCJyOgADTkryI3lnMOZs16kTGeTbpPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Yx0pGPIfjigzk+7796zPqlOTl29QqOTO2nOISkmoB7E=; b=LysdRCs5e27T3p6/LLz9ewrDRH4SH0Vq69Q9MyfR/9cbpeVu1+ITiCsdLArIx0oLSzalAAcNjGDoh8SBNrx04E5ZeTM2F3jAJ43o1mh1qNO19D49nEv2qs3JVC9/uoKnBqtruw3nxnO17QRFqx50F2dMiqf58Kqw43pV5N1XfcPF+IanQyeou9I0fxac8yeXyv65Q0qF82FJefy/ya3GuUdhefURbBkN8nCtHCg7rDKgynxNt0RIsGdLrmn+FDnjarx45jXKwOKe7aVH8KzhWTQ8CHdrmKutULVlpoOCWkNdRVV5DqLm8NuCFR9Y+7sBUuCEDv3We11lkL9d7Pl4Qg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Yx0pGPIfjigzk+7796zPqlOTl29QqOTO2nOISkmoB7E=; b=VEDRYMPbbVNh+p2oRKUYimKEeuV/CAqRCfpMnDeUX8VfuLb3J9wAiK6wtLkOfz+K5cbHOLI58+1wPqW3iBdBMdxvGCQV+7QDf/Qk8NCmUbZMNnUjQKc6P8JxF8u48yM/F0K8Fqwni03piLyJ7Ou7S7WbFuxY0Nxa/EldG3bKG2c= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8709.eurprd04.prod.outlook.com (2603:10a6:10:2dc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Wed, 8 Sep 2021 07:04:15 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Wed, 8 Sep 2021 07:04:15 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh , Franck LENORMAND Date: Wed, 8 Sep 2021 12:29:52 +0530 Message-Id: <20210908065953.28349-9-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210908065953.28349-1-hemant.agrawal@nxp.com> References: <20210907083953.8948-1-hemant.agrawal@nxp.com> <20210908065953.28349-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 07:04:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a4855a0-db75-4cfc-7dda-08d97296deaf X-MS-TrafficTypeDiagnostic: DU2PR04MB8709: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1360; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: njIUPv60+WIGcjdNeEshX3A5p8HD1+h1RoUkwdDxAVJzGab9xBT9S9623BxVgNrC/BcYDZhk3tD8YDv+BPXwAZHCmPNbt+NgBhvb/gArLyuwA/EFdNCY7BFsIWhJlPbN6ywvFsT9RSwirXi82kx8BdXaTWxSyMjizzjWUIi+n8YK3Z3ApzcnhbEdATr5+Ph12B+8sXLFCbdFpU6tXbhnug9vdtAYjJ+Du96aIDBhf//c/FrMs3bFsCuFyLQvPIanhvqeREaYAtVaQ+Qj99iExGpRXx7KWWw+GsItiFe1Jm6TtD0Ss1tO1ZmrNcDYlWQJHNSrmFEGEdGXy8ys1w5B0NH52ZuQGNXPt1IYqutVIKkr4xj0Q/C1YyLKLBhhjhvru9Q4WhsYpr0agVp9MOnoviHsL4UTwALzeBFvxRR6Eh5YBhBrrxVbWuvDFCZnHvPw9c94BKm8K5R0OS4Fj9uHgOzgys2wCxmtf4PEyDMfhIcX3hA3YTpShXM7XtOy1OVmJVY0tNMFPgovnQKKzr27BaKr/RhNTu75LOh543p5Fe2YSF2XcToBlL8IaaSKJr0In9JmMusspYEe9SqbXaMf2Iv+Uyi/8+2iY/gu0QI8WVgOYg/OT22yMOj6ld4uZ+NFFCStIYlwf8zbdeK1oLeEshvK7iG/2rQR+cCFXOUmxNkR/ZRE/mrACWzhUi868qHYkZSgzuDR50TRnodPUmQXgQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(346002)(376002)(396003)(366004)(86362001)(2616005)(956004)(52116002)(66476007)(2906002)(316002)(83380400001)(478600001)(6512007)(4326008)(38350700002)(36756003)(54906003)(186003)(1076003)(26005)(44832011)(66946007)(66556008)(38100700002)(6506007)(5660300002)(6486002)(8676002)(8936002)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?h0Cqm/TZFVXR4NwWdQVOGZC7oW9zd5aU1REJQY/5kSUHUPvL17rtFirSbR1m?= =?us-ascii?Q?A7hywVqDZHUgs0NOu9vCQWJHN/QBBRjGnrPhJUJgrULv38Q6XUWaWA2J5S40?= =?us-ascii?Q?DTmNVFHgtPOIVqWloo3nnnofLYp3lgGgAxrCH9AhIMqT7/XwyZnMRDFv4nMD?= =?us-ascii?Q?ahwe3yAuMRefKyum4HW9kH19USXUGAsgRPHr0aY8tG/T7vaBQ4Co/FZip4K8?= =?us-ascii?Q?ernOLYkSCcoTHfC9B6W4zqqY3GcROw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se7D6nWY+sG84HOaasfSLw+lQr8XqtoosCaOdxF+5fnJvOomzSgedqy?= =?us-ascii?Q?Is27kv4HcMPwbBST6sP0kVkUpCbeVhe6b8lRvJWVkzf/LRQUs+7a8M04boxb?= =?us-ascii?Q?gwKvMuksiIyum2bMHUesbdMfrPPjrnG31LhaJ/7V3gVj5Yf1T4+pK3hq9AwW?= =?us-ascii?Q?zsAdgJbb6qyQnbxJwTYjDAmX?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a4855a0-db75-4cfc-7dda-08d97296deaf X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 07:04:15.8440 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: K9Ds6CQF7myi7g8Y9bQu3YlyIJxHv0p66CpSI/EJZNH7RRMauMDL13LL4Pxi44c4ZHXPk3Is1j34cig5Ehq8Lw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8709 Subject: [dpdk-dev] [PATCH v4 09/10] crypto/dpaa_sec: force inline of the keys to save space X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Gagandeep Singh This patch improve storage and performance by force inline of the keys. Signed-off-by: Franck LENORMAND Signed-off-by: Gagandeep Singh --- drivers/crypto/dpaa_sec/dpaa_sec.c | 35 ++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index c5416df726..10ef990886 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2017-2019 NXP + * Copyright 2017-2021 NXP * */ @@ -263,14 +263,31 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses) p_authdata = &authdata; } - if (rta_inline_pdcp_query(authdata.algtype, - cipherdata.algtype, - ses->pdcp.sn_size, - ses->pdcp.hfn_ovd)) { - cipherdata.key = - (size_t)rte_dpaa_mem_vtop((void *) - (size_t)cipherdata.key); - cipherdata.key_type = RTA_DATA_PTR; + if (ses->pdcp.sdap_enabled) { + int nb_keys_to_inline = + rta_inline_pdcp_sdap_query(authdata.algtype, + cipherdata.algtype, + ses->pdcp.sn_size, + ses->pdcp.hfn_ovd); + if (nb_keys_to_inline >= 1) { + cipherdata.key = (size_t)rte_dpaa_mem_vtop((void *) + (size_t)cipherdata.key); + cipherdata.key_type = RTA_DATA_PTR; + } + if (nb_keys_to_inline >= 2) { + authdata.key = (size_t)rte_dpaa_mem_vtop((void *) + (size_t)authdata.key); + authdata.key_type = RTA_DATA_PTR; + } + } else { + if (rta_inline_pdcp_query(authdata.algtype, + cipherdata.algtype, + ses->pdcp.sn_size, + ses->pdcp.hfn_ovd)) { + cipherdata.key = (size_t)rte_dpaa_mem_vtop((void *) + (size_t)cipherdata.key); + cipherdata.key_type = RTA_DATA_PTR; + } } if (ses->pdcp.domain == RTE_SECURITY_PDCP_MODE_CONTROL) { -- 2.17.1