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 9CC00A0C46; Tue, 7 Sep 2021 10:45:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D3AAB4115F; Tue, 7 Sep 2021 10:44:49 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70088.outbound.protection.outlook.com [40.107.7.88]) by mails.dpdk.org (Postfix) with ESMTP id 3EAFA41154 for ; Tue, 7 Sep 2021 10:44:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OE3j0KE0FwOKCW4geNXlTLeThfQ2Io2/zQCIuEEerXBM0kl7vjPGna4Y9Z0eS1eJZLVtBn5S7GZxxybJqzAX9uvRnMqPOv1Ct351/C9aOMc0U06SJBFrcx2migp0WwwByR2yDvUlidNwGtZ/9bxsKadrTUh8Ig2cGB4sx2OUkMrnQyaESDWBPFCyvJmf+jIP++eXeKS40LDbh13NL0Q9UA3tFWui2vEBI1z4Xrn2VKQ6nzwvzEmG19zn4iZ11DEHZU0sNip+TUjGRtieNbYFsW7H8PVN4kHVgaz7CTJ4rmwE7jV4FPSWLMQ1KUYfBWbco8VHxNPfmm3slZGpTzZhgA== 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=l1n4SkC6Enuk4hzJj677WJbXyl8DMU5LkldOtaRyyg8=; b=J/vuxZ712qTaE0XIHqZNlA60x8axRu+p/SD2u7M5F/FOnz52KPd20O5nj+85PXZxR06EWYa1qpoyEa//b2/2TYYd/Cq0SBlAzVKcNwXgwwvhvyNlw7lC15u2/9knBEkGRhdTcUBhfis+mb7Oo9Qb//4twrUU7GCDenpcZRVe8HyAcd+Kg2rurHv2I2i4PsV8mRIKBUEq6dIMi/NHMXnKt/Bu+TIYLmFQrF2d1prsDdwi57NhE51VTm2cPbji9gPdZ84DNMltLz+Z4ysROW87jSADPqzsTzBEqN4mlbI+MGXmp/ZeCKlEu6rMIIS23r3jOxQPKQHOFt2N2yckf3xMrg== 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=qg1bjuv29Eau0EKspXUWLWZnuLOzhUNLuz3uxCyG57nTUUuc6vOuuk2gW2puFAImb9Ya9joF/Isb7JYNmrlLTBrtfZSNfqR0bKKZpBkgKpWdRivQ7NXR1NnvXGgy5aGXWcTPAfQPMuMJd2T+ofYq09nmT0L6GtZUtRRXmXY+3f4= 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 DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:44:47 +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; Tue, 7 Sep 2021 08:44:47 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh , Franck LENORMAND Date: Tue, 7 Sep 2021 14:09:52 +0530 Message-Id: <20210907083953.8948-9-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907083953.8948-1-hemant.agrawal@nxp.com> References: <20210825081837.23830-1-hemant.agrawal@nxp.com> <20210907083953.8948-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) 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 SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Tue, 7 Sep 2021 08:44:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c81f185b-2f6d-4369-474e-08d971dbbf37 X-MS-TrafficTypeDiagnostic: DU2PR04MB8949: 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: KfVh5l0gLYdrp0ncg6mfuPREbURofRYBR/11fCS9EtKscLoC+v/kJELj3ML1hLhqYMpzBSkBJy8VVGmWM2jW0dFxwMxPaCcnC27JSF2C0VAXOc9tBVYw27mIWts8PByav+ow+EZJwEyNjDh4jeD/alqzx9PCDS8eKnkfDG0Nyhf1DAf5ra//XJqAxczdqMVIzSvYM/qdz11LwULdkY5gthkddBriKU0axLKDR28zS2YTXeswnh4H7J4MfeLSkD0karSGPkH1qY+48Cw8+r1bXhu4rqoxHefE/sx2AxVg+KUHoUjzbWf36DFhndAPbMT+/8Tz/htKAU7jxnYJRvqHVpiMdsbCofLBQ4jRkxGuxZdd/yIY41QexCMOUbDgsb+3QUgDUIoGHLOflmoM5X7mW6sem5wNwgY3RCTdKd15lLh0XNm8zOQvmkR4TRlqTLERJYFptr0SBwTdnum2vuGkKyuqWMkbm+wVmiRfQvHvsEkndKNgGIMCvXJL4rfJ0SJliMHd/UCewC0Nc4zbb8ucpVVQpVv1dvCx4LoycLNCBwF1fGvbQ+OhIDN8SKakHYMtsbKbjH4wfWCE99UTXtYDz8IFGPgVs7eLHz7eO/JPFFaETwxg9VRskJO1qQLRy3InPLxwXZ9IOBUihUm2uZwWoIpc/WAZa50K9Jeb5OlgnXlO3EsWiOFD68c2uyysR9uJYiWzGzjxE2Y4UKAJcg9ydQ== 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)(396003)(366004)(136003)(376002)(346002)(39860400002)(86362001)(36756003)(38100700002)(38350700002)(316002)(44832011)(52116002)(6506007)(6512007)(186003)(2906002)(956004)(6666004)(5660300002)(8936002)(8676002)(6486002)(2616005)(26005)(1076003)(83380400001)(4326008)(66946007)(478600001)(66556008)(66476007)(54906003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?XLiRqS57LLpZoZ3sBvGrVPTNvNUAFbq3wgruH9WU74I6ZgfRYBxBZF4U6tCG?= =?us-ascii?Q?TU1UPTpklwNtGjnwN11pNzPx/5WQ/O0ec6QMLC030TvPCwEXl8h+KKhdaxXs?= =?us-ascii?Q?5/PL+TzS85zhXLqn6LWqQBnFXZyB3fvwHYtBe18ML1/X5WKFJHvnqD9U92oG?= =?us-ascii?Q?P4JxD6yZk+6n7Zpw2ob1Nc95pWm9X0RiP15SZoBS4917s//cLmNZafaeeKHN?= =?us-ascii?Q?+KcWDvFo5TXThNNyEd7FYGTfBy12r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JPfdTSReBI3bIbblbb7ajDrkbuQIcoHzDFPsjw6GPggEYbh/KDHsw9bGN?= =?us-ascii?Q?DAtlzlLKN/TFlVNzxq3uQHsTF5KmqCkoBHGfvBZqHiIwFe66jChJPaCHHM4U?= =?us-ascii?Q?oGYz/lrsmNscaiD8VEq7hYZ/sLz4Fz5XeY88WWNgxs73oIrBkAnFW5mWBmIV?= =?us-ascii?Q?BqkBOgS7LU4CMNJ4ytpr4DTK?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c81f185b-2f6d-4369-474e-08d971dbbf37 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:44:47.1325 (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: +JNvVzXIpf89h/awix3awdWRBcIMWT89QlG0OTXA14p6R6aG2C/ZgyyyX48VvZ0J3MHh8RUyEzsJZ3Q0cGNuQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Subject: [dpdk-dev] [PATCH v3 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 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) { -- 2.17.1