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 2B699A0524; Wed, 5 May 2021 14:18:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E35540040; Wed, 5 May 2021 14:18:30 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40078.outbound.protection.outlook.com [40.107.4.78]) by mails.dpdk.org (Postfix) with ESMTP id 064634003C; Wed, 5 May 2021 14:18:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MWCb/8lnh3/7J+SzVmPTyrUvXJ4rQ55Qxrjx8947HxvnyjTg3DRnUtngGy5FXLoKgs7CeBAyp2sRc6yxoGNnPJeE4s4lSmTuaNBs0pvEsO8lZhQpw9+H5LBoP95xuvfl+UQOxsmgAiJYopkwPx8uw0CONYh/37wcHxWBTli1ndNSA8C5RmTyyKuvpp/cJ6WIoXTfr197aEzIUv+PcXXIpsLmekk5K3pNMhxpUQ8ivIFMCYFU6uJg2sHDYFUW5tL3qZ40YrzDJsW88/H5SgH4NGH9hHW4n+KqEq+kOEBcdminlME6q/WCD6/2TT1/dsEb2OGeNTODGJe47/fhmmYAWg== 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=9apWtyr6Wg9YVArDIeQztksr2DJ8xOmEYlhq48LFqyM=; b=W0fVMpNljLsrEeLIwltz3fv22Hb4uDKdb8UDBXywUkKJgrnHfaUOtqyoa76ufEiTjU0ZYQMl5YhhjZUuGLfcf44Q/8fahHekY24yS9B2u3+a4nubQ3IMXLJJzAA0gaMH4uTDhw5vjXhnFqauPKtUelBdN4lwdwzJMuZPfKmhOMXhazrtfqNaqpxovRexMnXIP70lz7ZErZVnEPI7AA/qayYSOQEDx+27J30oTpfWOJv8dof3+SgtICPz6jLgKIo39Kfi86RSJY3OqvR9p4MO1zRxx9KAgUYAEPTPxM52dloSrGgxrTGY2fp6RF+hbg925f0nEW+F42Jjoj7pGB/iRw== 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=9apWtyr6Wg9YVArDIeQztksr2DJ8xOmEYlhq48LFqyM=; b=JJuxinzuvFpiW2qFqOjoBwBD0NxW5ql63hY+p5Qi057Ts62eY6e16LqGL+0zyeYGRLnrsN6d0BM823d+QzEbxW/6wPTNqCsKLDRvIV7TvW5Qid6lv2vBOkc2YlYuMNj4Y1aUhfChQ/NLEgO5enephY5mZEJMYCSDYN6XbLjCFfQ= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) by AM6PR04MB4326.eurprd04.prod.outlook.com (2603:10a6:209:4d::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.35; Wed, 5 May 2021 12:18:28 +0000 Received: from AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55]) by AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55%6]) with mapi id 15.20.4065.039; Wed, 5 May 2021 12:18:28 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: stable@dpdk.org, Gagandeep Singh Date: Wed, 5 May 2021 17:46:52 +0530 Message-Id: <20210505121652.17295-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain X-Originating-IP: [92.120.0.67] X-ClientProxiedBy: HK2PR04CA0089.apcprd04.prod.outlook.com (2603:1096:202:15::33) To AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by HK2PR04CA0089.apcprd04.prod.outlook.com (2603:1096:202:15::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Wed, 5 May 2021 12:18:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1730d3c2-dd9f-4d70-f30f-08d90fbfe349 X-MS-TrafficTypeDiagnostic: AM6PR04MB4326: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PqemgA7anw86Lbu84CnaoonlMLmvHJUDNPCbV7XdtqeJld3AN7S6HAR7ezJvCIFdrmInKieQfd5p0gHhSlOuBF1lDQTvnTj+0pAjm5zW/kV7Rtq0vyLLDZR7vZ/Oy50HRcUgxyuBzRT7whKu5OrfZw2+7K9yu5fhKuQX21zu5eRO2y0GBtELxxtzavtxmdmu68K9NiJ2j3thE5tI6yTldKBh+YSNMFWNa5JROCbs3IjQoonGBdZtF5C9/3HsjtHIZkWl6cPUfhwBLjMIQVAyBVX5++y8FUBvt4DL6Pg814E1fsU4MocotCwp9xQr5F1f051OFs6OqAkmtAdr3leBCB3njk4FzbjVRtu1AnbiVvluOoiqgwTnKr9WapbSRPQZL3vv1sCgj3YpI9Cjms3QPkMJP8cQBBEAqvwcFzadQuIFK5RqExW6AcLv5NNCnxcQiGslSEGAfRWXl8t57jpweXZ/3I3DecJ/nuD55tJLujez5PhE03eJKxneoG/QA4MmeRUrtryvOzGSW5lK0wbTjTK213W7a7XnHMxHe0DihQFH/b1Zaia8a/mL+e83RzgtY9zRbHYZnIE8JEN0SKkLGKo2xjVNYtF40JvInQ14XRjxXBywqMKDzoKXy+OWweTfT0ZoGkA4oH35HlwgoGB7pohad48+KN4O1MT4uoKbyn4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4456.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(136003)(346002)(376002)(366004)(39860400002)(4326008)(66946007)(38350700002)(8676002)(86362001)(16526019)(186003)(52116002)(38100700002)(83380400001)(316002)(66556008)(36756003)(6506007)(66476007)(5660300002)(6512007)(6666004)(2616005)(26005)(956004)(478600001)(2906002)(1076003)(44832011)(8936002)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?Exr5iwyMoNzHMTsG797QOaMYHfTD7eE7AH+qoJJIx+pW+TDe0jOTWDhpLAiD?= =?us-ascii?Q?mUI1C+BickcFNl/MW5w+wzrK7m01VLopGBzJ9m1/WoKGWhMCeSdB6Pq8GJm0?= =?us-ascii?Q?o6qGkWEMiF7vrc60/xnP4nOmuoBvtilIXRnm+okBHguksC4tM4tbQqdt0RVO?= =?us-ascii?Q?imJORKLmOkrHT11tYT8Vr57rvFPluBjHk18lG5sJYMq2uqc1w3s7eJWpQAxy?= =?us-ascii?Q?65hGuAfqyzDi+bUf41yKSx7e42hH3Cdi2d5sm0ew5js+pnrXkY2LUh0fFpwH?= =?us-ascii?Q?XoIEgK6hPGj+D3fLKmieRhiO3pI97naEtQ/Le2VCM/vxsdqykZ761UHW18eC?= =?us-ascii?Q?lt8UAo+bV7kg9yP51E1arrm+RQAfe2BMxgsbfJSXgQ2u/cbUbjLnifgD2YI8?= =?us-ascii?Q?1bzPSm09fFIXfu0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Q?DHa2rps5eqfqZtL5VYDkitVM?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1730d3c2-dd9f-4d70-f30f-08d90fbfe349 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4456.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2021 12:18:27.9308 (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: icKQT8PIcwFKtF5lHQ9jdbqRdMaNG685zWeEdwjJyLozkMKxRxP9uRvKHqPWZXmy7uudF6g+6OBo3aaTQH0iYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4326 Subject: [dpdk-dev] [PATCH] crypto/dpaa2_sec: fix the close and unint functions 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" The init function was calling the dpseci_open while dpseci_close was called by the open function. This is a mismatch un-init shall clean the init configurations and close shall clear the configure function settings. This was causing issue with recent changes in test framework, where the close was being called and causing DPAA2 SEC to fail in configure Fixes: e5cbdfc53765 ("crypto/dpaa2_sec: add basic operations") Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh Signed-off-by: Hemant Agrawal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 50 ++++++++++----------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 05b194ccf..1ccead364 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3564,32 +3564,10 @@ dpaa2_sec_dev_stop(struct rte_cryptodev *dev) } static int -dpaa2_sec_dev_close(struct rte_cryptodev *dev) +dpaa2_sec_dev_close(struct rte_cryptodev *dev __rte_unused) { - struct dpaa2_sec_dev_private *priv = dev->data->dev_private; - struct fsl_mc_io *dpseci = (struct fsl_mc_io *)priv->hw; - int ret; - PMD_INIT_FUNC_TRACE(); - /* Function is reverse of dpaa2_sec_dev_init. - * It does the following: - * 1. Detach a DPSECI from attached resources i.e. buffer pools, dpbp_id - * 2. Close the DPSECI device - * 3. Free the allocated resources. - */ - - /*Close the device at underlying layer*/ - ret = dpseci_close(dpseci, CMD_PRI_LOW, priv->token); - if (ret) { - DPAA2_SEC_ERR("Failure closing dpseci device: err(%d)", ret); - return -1; - } - - /*Free the allocated memory for ethernet private data and dpseci*/ - priv->hw = NULL; - rte_free(dpseci); - return 0; } @@ -3849,11 +3827,31 @@ static const struct rte_security_ops dpaa2_sec_security_ops = { static int dpaa2_sec_uninit(const struct rte_cryptodev *dev) { - struct dpaa2_sec_dev_private *internals = dev->data->dev_private; + struct dpaa2_sec_dev_private *priv = dev->data->dev_private; + struct fsl_mc_io *dpseci = (struct fsl_mc_io *)priv->hw; + int ret; - rte_free(dev->security_ctx); + PMD_INIT_FUNC_TRACE(); + + /* Function is reverse of dpaa2_sec_dev_init. + * It does the following: + * 1. Detach a DPSECI from attached resources i.e. buffer pools, dpbp_id + * 2. Close the DPSECI device + * 3. Free the allocated resources. + */ - rte_mempool_free(internals->fle_pool); + /*Close the device at underlying layer*/ + ret = dpseci_close(dpseci, CMD_PRI_LOW, priv->token); + if (ret) { + DPAA2_SEC_ERR("Failure closing dpseci device: err(%d)", ret); + return -1; + } + + /*Free the allocated memory for ethernet private data and dpseci*/ + priv->hw = NULL; + rte_free(dpseci); + rte_free(dev->security_ctx); + rte_mempool_free(priv->fle_pool); DPAA2_SEC_INFO("Closing DPAA2_SEC device %s on numa socket %u", dev->data->name, rte_socket_id()); -- 2.17.1