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 176514601D; Wed, 8 Jan 2025 13:21:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D32F40291; Wed, 8 Jan 2025 13:21:11 +0100 (CET) Received: from mx0a-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id C6EBD400D6 for ; Wed, 8 Jan 2025 13:21:09 +0100 (CET) Received: from pps.filterd (m0431384.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 508CE10A000939; Wed, 8 Jan 2025 04:21:08 -0800 Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 441s69r0gn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jan 2025 04:21:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qiF5Dcv72Fg7BH1q4alssVk6gZS2ljjw7rCEFkNRokmTj4xr4zcyBfw7QUL+ZO46x4j/D0Tja/7T8WHkbOj03sVJDkFpuK6jtIMTmLDnb/aTQte+RiVf51gFmtCjlZnlQBFF3ITc5QWmgjhGW32c7/X1luznlhk/VDHebMSCIMUqnFoagSG7Q/ePRwJY3weUzI2elQO4Xgk/6ReUU3u63xG83bcOznepd6yEpL0bhHi483P9zMkoBpASom262qWYhZRbe1UfsrbEQN44KrIYhMZsG3VIpsJBwHFqfkfBlJLhI9tUBmH81OirTfdb3jMxxhUQDA0Zgh4eJw+0tCw28Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fyGDzEM3Uvrb3d1IFUz75kuqQ+aIrpsYEIUeuujfj0k=; b=Knw+6NJSnzsKvAwGvxf+XXTIBCVCDTCJfqKwcKUUOlCPhlk5wL1XhknOuW8nDE7+KiEC5zEFYuy1NRei9YSSCURggIam4rjI1KUN4487vBr/Zq/2/QYCm1sRsbchh95DNruAxJ49lLUxKEdYfJZaYClPai4pIxf1ICLunj4s+jlVZ+kHH++XGc9z2pxQHfYvW6CMRLwr75qxyGNImu+cjXp5sHgmgcsOY0WErQEGqadwpSpPgth3ArW8zPSBOluR7gWh7UQ8tvf/k2kHoJTu1+toyzJF8NYWzhqvnFPbB2Za34sd5ewkDd789pcHULQSpjTnrOMih7FFSKpKO0l0SA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fyGDzEM3Uvrb3d1IFUz75kuqQ+aIrpsYEIUeuujfj0k=; b=R+AIuScec+C70V2PJriG9z4RFYJ5wQIEeCZELZqyoTuHrDhiHJlv4CCuUymNXKCFpz7W7KhSaQ4K04gKQBDB+ol9I560Od9JtDlCQ+yFNOsQL9rTlCr9QFgJwEenmoeLu4g7v6Pcz9CL3TSv+flw6COtPYtBAD6WIix9/7XSvrs= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by DS1PR18MB6317.namprd18.prod.outlook.com (2603:10b6:8:1e9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.18; Wed, 8 Jan 2025 12:21:00 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d%4]) with mapi id 15.20.8335.010; Wed, 8 Jan 2025 12:21:00 +0000 From: Akhil Goyal To: Yang Ming , "dev@dpdk.org" CC: Anoob Joseph , "kai.ji@intel.com" , Gagandeep Singh , "jack.bond-preston@foss.arm.com" , "pablo.de.lara.guarch@intel.com" , "matan@nvidia.com" Subject: RE: [EXTERNAL] [PATCH v2] cryptodev: not close device when secondary exit Thread-Topic: [EXTERNAL] [PATCH v2] cryptodev: not close device when secondary exit Thread-Index: AQHbXY0K+NtcwPjXIUWyOW8EylNkurMMvLDQ Date: Wed, 8 Jan 2025 12:21:00 +0000 Message-ID: References: <20241128054829.1453-1-ming.1.yang@nokia-sbell.com> <20250103030957.1117-1-ming.1.yang@nokia-sbell.com> In-Reply-To: <20250103030957.1117-1-ming.1.yang@nokia-sbell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO6PR18MB4484:EE_|DS1PR18MB6317:EE_ x-ms-office365-filtering-correlation-id: 64c16f49-aaae-4742-516e-08dd2fdee9cb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?9+2CWx9pGK1aB29E8Y3qMjrVlcnpkCm3PE7EbkVIcCi0MYFf/M/48y1OL+2v?= =?us-ascii?Q?Tp4heF3bd4o//hfhnbn059z9TS4eqd1EK4yTDINfHRVMVi03+Jv8v0YGvsyZ?= =?us-ascii?Q?wiH5691xsLDBaX1GCUqLGLY72qdwZEixtkDvv79G3XnOGtBB00riNsfIN+vV?= =?us-ascii?Q?tYnl1WVKAYxdew4vHe+J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OJBjqk7+?= =?us-ascii?Q?6U++z3ZW9tcBHOQXoeXZrSfPvzFGShWfvvh0WIz7m1YLZkoX64XbdydDAe4Q?= =?us-ascii?Q?iLAc7G1JAh9fmb5xwjcj/IKCvG4NZqrpcKrFdp7sEQq9f5J/fE4Ikuwqk2Mq?= =?us-ascii?Q?HoiIiVI2Y8JAgKHCgmdHBzv23CN3uIdw/ORS9SZvZXj9RtscModpNBwumgeq?= =?us-ascii?Q?Xx/S5uonggHFxvWUgHKZ4Q1+iflhhnFVKz1UqTzag3094/h6cK1g6ZKNx8WW?= =?us-ascii?Q?KFwQJCsSQvV7z5WrUz7i6Ik9M2x8oPbWsM4CnNS+sn4crH8AeIG5t25MoJMF?= =?us-ascii?Q?zF2JnpmOt514HxOYHzkhhSFHM/GeNSxbt6ygyej1kFK/610kefavrCOQavUq?= =?us-ascii?Q?Yh1lvPQ4CmOu9cwcRz540xyGPJ/DziBz?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ejNhsLF3GXlZ+HqJQGgZGBvEQMBG0Io9Bd9rP+wcZO4+i/Jrm46mQsF8TaDA?= =?us-ascii?Q?H1BJPpkJo1qI5IhYKbH17782t05rwQRpZ8yrw9ULbf0DETogA1ciqqbgXFKZ?= =?us-ascii?Q?zxGtLh24cAeyJoyGaGYBw0DTT0EWU0USJaBsyI70hThtG+5SAlqHdq4JaidD?= =?us-ascii?Q?6m77gwrSUr1dmrTXIxY7Sf8wGbZNBeqNglk49UzcTPJXZ04lrVWw6PV2ZUrA?= =?us-ascii?Q?FaZP6R1AxLOnGIa7Nm50dQjwXgZl4QypE/0naodCChjGmmB2fqL8QpiZ94PX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ilPYJAkxNO10qhpiL8B4Ug?= =?us-ascii?Q?nZfYonU/NFebBWYxm+sbtw19r81EWOm6xlpLFIBicI03Eh3aDU8jRfXsrWMA?= =?us-ascii?Q?iZt10p0zKTPXKrt7HoV2vsoIihJnmiEVRM7S4yg9Amag607ZSKtgnHLWHimm?= =?us-ascii?Q?RWJr/K50n2Z0oxAEZNJkVIVvoXMwLmtNdNCJ/t61m2LQayvYmNVAn3weCopA?= =?us-ascii?Q?f1Yrfmuf+xG6u1hiG2pky9dwU3twu4B2Ur2WcO5KtAKM2dWj7xt/wy6zaIdm?= =?us-ascii?Q?CQ7ZwPc77Xavk1CC9swm01/PP1wnrmxQPOCvJ2T/QlUx6nf7rhlkIhdubC2Q?= =?us-ascii?Q?NjKDEUYeWfIXB5ogrs2GxG21XrAin++UkTFVrLBW8bnN5qxvZ9DnyVI3J61/?= =?us-ascii?Q?J+XdrRX2sYWsSErZporWFlYHnqhBu4rwqdlctGAy?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64c16f49-aaae-4742-516e-08dd2fdee9cb X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2025 12:21:00.7942 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dxt7UpBbLUuJeupAORjfqJXm29s/sUvJleaNRzZtrMQgC+8aPZ/nxBo+r8ZZrGv++h4FNQUYXK/wubxoCcOVtw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS1PR18MB6317 X-Proofpoint-GUID: OQb6xHbF_S7vXCUtpkLnRO7GsEr9N7wp X-Proofpoint-ORIG-GUID: OQb6xHbF_S7vXCUtpkLnRO7GsEr9N7wp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.687,Hydra:6.0.235,FMLib:17.0.607.475 definitions=2020-10-13_15,2020-10-13_02,2020-04-07_01 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 > The secordary process should not close the crypto device when > it exits because the primary process still manage the device. > There is no reason with occurring error log below when > secordary process exits without any operation on the crypto > device while primary process starts the device. >=20 > Case situation: > eal_bus_cleanup has been added in rte_eal_cleanup. But for > secondary process, eal_bus_cleanup will trigger vdev_cleanup > which trigger rte_vdev_driver to remove. Then crypto devices > will execute ipsec_mb_remove to rte_cryptodev_pmd_destroy. > Finially, rte_cryptodev_close will be called by secordary > process exit. >=20 > Error logs occur as below when the secordary process exit: > CRYPTODEV: rte_cryptodev_close() line 1453: Device 0 must be > stopped before closing >=20 > Function call trace: rte_eal_cleanup->eal_bus_cleanup-> > vdev_cleanup->rte_vdev_driver_remove->ipsec_mb_remove-> > rte_cryptodev_pmd_destroy->rte_cryptodev_pmd_release_device-> > rte_cryptodev_close >=20 > Signed-off-by: Yang Ming > --- > lib/cryptodev/rte_cryptodev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.= c > index 85a4b46ac9..ed1021f635 100644 > --- a/lib/cryptodev/rte_cryptodev.c > +++ b/lib/cryptodev/rte_cryptodev.c > @@ -1142,7 +1142,7 @@ rte_cryptodev_pmd_release_device(struct > rte_cryptodev *cryptodev) > cryptodev_fp_ops_reset(rte_crypto_fp_ops + dev_id); >=20 > /* Close device only if device operations have been set */ > - if (cryptodev->dev_ops) { > + if (cryptodev->dev_ops && (rte_eal_process_type() =3D=3D > RTE_PROC_PRIMARY)) { > ret =3D rte_cryptodev_close(dev_id); > if (ret < 0) > return ret; I believe dev_close is actually not required in pmd_release_device. Dev_close need to be called from the application separately before it is re= leased which I think is already happening.=20 Adding more people for review.