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 BF84EA0C4E; Tue, 2 Nov 2021 10:35:15 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F3464068F; Tue, 2 Nov 2021 10:35:15 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 706BE40689 for ; Tue, 2 Nov 2021 10:35:14 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10155"; a="218414407" X-IronPort-AV: E=Sophos;i="5.87,202,1631602800"; d="scan'208";a="218414407" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2021 02:35:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,202,1631602800"; d="scan'208";a="540779404" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga008.fm.intel.com with ESMTP; 02 Nov 2021 02:35:12 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 2 Nov 2021 02:35:12 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 2 Nov 2021 02:35:12 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 2 Nov 2021 02:35:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pabu5tGee+7N6FENYNUGaOxDeGuukBMmdzoq93xZ39/sujJ3mJ7b2CBflhgzR6VQM3QBZ85SOvbCdZgM4NdsCOVoOLrgcdGjT+ylrIAMiSUfoGGBhKfe1MpD+iNeiLofr3BI0kshWfluE4ZaJYvFKoi/JGVudredu528gV+gEqYqAXJ8tCnsIslqpTKmXKiKxizFgc7aWcRAgoXZ1CKfrspqmt8suXqaCth8SMb0d2Rr+eFQq2biRk7lzaNdZttOY44zG0lukVNsjlaswsIRIP43CgGh7y0SXQOC514At/nkxqbVPcVLkzAenWvnLNuUTAN7YqPE6nU6ImAb+Zu7gA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XM0BuX9SzEo7BHfVyebd+q4uY6lwkJXmhvDb4Vx/goI=; b=B6d1nPMyh3hrxs44bHsW1xN8P6zUirgHAMcT+2kHg0EwMVWxRjSOi3vaWlZ8fPaqIHLe+eyJvxkntuQe+08rUv6TggYDEH/AiENNN+ytdmL2R695aNzV9gh9MIswC6PgqNTqdcjCyMtuU2HV5vYqixWsstdwPloyxLUfhwMV4Gzs7Db4CabKPLg/kR+dkGbjvu2B83LbXd7QWHFP76qFr4R+YheMRC/Mv0Bj+ZW/NgnF1DMvlVfn0iafqkITZK33KeHYJ0uNjrWCzaRpLp3g0KTfsp1Pq9E4xg/3SMNMIsCfOYR6+yC8LHCRHXouP/NHe/rx5oF0b3/p5ve9CK1xxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XM0BuX9SzEo7BHfVyebd+q4uY6lwkJXmhvDb4Vx/goI=; b=kA8FccVOYZv4uuNEe4osn8H73HHXFeYgE09Y0izdtD4Jt3Cz0Psa+c5UrLgdRCsuNCb/zk7NHfVKolZDxeaMCXHz9wpFlYCcY5gQ04vLGn6DILY4oegtKzetPm/1f9SmYXZNZ0CuMGsfk1hMpHhfeEsLqY/LOEYweinQNY3BYho= Received: from SJ0PR11MB5150.namprd11.prod.outlook.com (2603:10b6:a03:2d4::18) by BYAPR11MB2647.namprd11.prod.outlook.com (2603:10b6:a02:be::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Tue, 2 Nov 2021 09:35:09 +0000 Received: from SJ0PR11MB5150.namprd11.prod.outlook.com ([fe80::1c99:cc97:391:1406]) by SJ0PR11MB5150.namprd11.prod.outlook.com ([fe80::1c99:cc97:391:1406%9]) with mapi id 15.20.4649.019; Tue, 2 Nov 2021 09:35:09 +0000 From: "Jiang, YuX" To: David Marchand , "dev@dpdk.org" CC: Harman Kalra Thread-Topic: [PATCH] eal: fix device hotplug Thread-Index: AQHXz77JzJeawL/yFk6gzCovgTmGIKvv+hmQ Date: Tue, 2 Nov 2021 09:35:09 +0000 Message-ID: References: <20211102075259.3392-1-david.marchand@redhat.com> In-Reply-To: <20211102075259.3392-1-david.marchand@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ec094148-d2f4-46d9-61bd-08d99de40fbe x-ms-traffictypediagnostic: BYAPR11MB2647: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4tNQK3vdgCzuAbqnSNBZVS3x5s3GFHGMJHUPZkhiz1WIguEqSSmpxfXIPBZEg2rMPRmUoAZM2LKbKfEwrfrrDp4KNAtBqI2iCKW5nqMrBG6ctNfo2yA3wMVQRIYtGa1hVQmeomkYqJ0aWHRn7qNAzE3LqprGxYYj7euT1UWmeIxawAFi6QOACNttkn/p+VnIIur8EnjKcqSMqwXFTEp9FrTJKltOdqcks+yvnqURgu5ovVC5pZeijhx3s5e9KSMhLqbQgxnaY4Rhj1N+IdcGbMmeFVAR5Kna8FXLLFDzOaqtKF1bPeNexz5WfbUPKibIaGqTQSNNhS1L0ex41RAUT/NDkKIqiyLlFJsZv3ZwsYDqashhqVseI0oOpbfEliNCtR5xZlUCsvsiIFqOVstJdW3RiXh+aHOBKhLNXYx5Jc0BGPGGT/u47gv50XF3Gx0VgvGv5R5TbCMRIADHOv9ZXws30OCklppkDvvTCfqze1YtrPeIoSwROD5OW/6UxOzVi/2ou8EcWbur272v9rN5vq/OAJmtv79UIOZ6ijRoHPRePo1q639uze//5+n67KiYUqUzy76i3m9tcAiOpIvDZ5RDclSYjDVVKXBy5CgD/dAlgvOuC707XLOOX7vWpOgJYGj25gxUgmgrupG/beSJwLHVTbHRnfSCp8P1WczM+tLW8wHNn27wlRYQp8Zs0olXZh+QTR1Vj4XvIcB82zDFE/9Jh0HvqEEGOYdc5sXWKrlmFW6Quq2buQZzP/F0lxCzL2GHZg7+zpkc2kV+yh21HD73rSDaPauObtevR0+UxKg= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB5150.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(33656002)(66946007)(83380400001)(76116006)(38070700005)(66476007)(64756008)(316002)(6506007)(53546011)(110136005)(508600001)(122000001)(4326008)(7696005)(52536014)(2906002)(86362001)(66556008)(66446008)(5660300002)(8936002)(82960400001)(38100700002)(71200400001)(9686003)(8676002)(186003)(26005)(55016002)(966005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?G26HgAZpwr37qc3FlHCqTiIzTy5ZCwEdZqHEghzWgHHzl2tCCBHz2unoXjAf?= =?us-ascii?Q?FTnRzFpTInEkVMcfoTZ+oPNDjQx0Cv1O+AT5SwmPZEDowmj8otDHhgqb/Aoo?= =?us-ascii?Q?9Ii4LCZ+OxanlydoCfvdUa/nqXnNE3KSEka4ZAXg2+n91dkREolLkJQQ76NR?= =?us-ascii?Q?OBeIZLt8xxNWsAlWhGeq7CKu3pZsaZrxbO5tPmfArCyn4CshLZGYddIWmkIx?= =?us-ascii?Q?Zbpxl5ihjMOkqtY+7Jce2CjvKxbsBtaeJPYjypNxhB6Zj1gqld5gfqKYMK93?= =?us-ascii?Q?R6em+8C3lsu62W/Q58bRjblUu0AYeD6FInSJhNe5SIqhxdklb3B2T4AXRGMB?= =?us-ascii?Q?c6w7yAkc9eaTcxmAwxZBZC16Rv7JCMs+9z2fBhtRfvmB9fvAsUOuZkU0b17j?= =?us-ascii?Q?PZZcEgQjzBSrX6OFU8rEgcAGNuGKbIU0Idug11lMVn4t7MUxyPNf4rgbGIP9?= =?us-ascii?Q?bdeJijxKhtxRDJoDR6FKSWC2934mkO+TJ5KUgxu5TinHRRcCrNth7lCYINMX?= =?us-ascii?Q?KOx1Etbq9U9svmVgzu1RXgdmUzSCYZUuoyEYywFbvNjHoESy280WzVqtkwdm?= =?us-ascii?Q?qHeN2Ys7IdV2oTD0VsQ3oEZMdsDIi6nPatYGJT0IsT/+w8p8iJfViKzTKS5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oJzzbLdUhEyGbXznCHhXY8Nc?= =?us-ascii?Q?lHnpUQNue97cqm29tvxVSK2spbxiylfop6wY3IAI/Y+dtiCws8q3haKRqomS?= =?us-ascii?Q?VQ=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5150.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec094148-d2f4-46d9-61bd-08d99de40fbe X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2021 09:35:09.1088 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rTVIMitiNbNlzKQfPbvWHfH3nQSrudWTn5RQ2xWbuJnlaHbmstO0K/Ni/cxvdLAo3o6fWaqvK/XbLKJlIJzFnw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2647 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] eal: fix device hotplug 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" > -----Original Message----- > From: David Marchand > Sent: Tuesday, November 2, 2021 3:53 PM > To: dev@dpdk.org > Cc: Jiang, YuX ; Harman Kalra > Subject: [PATCH] eal: fix device hotplug >=20 > The device event interrupt handler was always freed. >=20 > Bugzilla ID: 845 > Fixes: c2bd9367e18f ("lib: remove direct access to interrupt handle") >=20 > Signed-off-by: David Marchand > --- > lib/eal/linux/eal_dev.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c index > 06820a3666..925cdba553 100644 > --- a/lib/eal/linux/eal_dev.c > +++ b/lib/eal/linux/eal_dev.c > @@ -317,10 +317,12 @@ rte_dev_event_monitor_start(void) > goto exit; > } >=20 > - if (rte_intr_type_set(intr_handle, RTE_INTR_HANDLE_DEV_EVENT)) > + ret =3D rte_intr_type_set(intr_handle, > RTE_INTR_HANDLE_DEV_EVENT); > + if (ret) > goto exit; >=20 > - if (rte_intr_fd_set(intr_handle, -1)) > + ret =3D rte_intr_fd_set(intr_handle, -1); > + if (ret) > goto exit; >=20 > ret =3D dev_uev_socket_fd_create(); > @@ -339,7 +341,10 @@ rte_dev_event_monitor_start(void) > monitor_refcount++; >=20 > exit: > - rte_intr_instance_free(intr_handle); > + if (ret) { > + rte_intr_instance_free(intr_handle); > + intr_handle =3D NULL; > + } > rte_rwlock_write_unlock(&monitor_lock); > return ret; > } > @@ -370,6 +375,7 @@ rte_dev_event_monitor_stop(void) >=20 > close(rte_intr_fd_get(intr_handle)); > rte_intr_instance_free(intr_handle); > + intr_handle =3D NULL; >=20 > monitor_refcount--; >=20 > -- > 2.23.0 Hi David, The patch https://patchwork.dpdk.org/project/dpdk/patch/20211102075259.3392= -1-david.marchand@redhat.com/ =20 failed to verify.=20 after executing "device_del dev1" in the qemu window, the testpmd window ha= ngs to death and output as following: EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0) EAL: Cannot find bus for device (0000:00:05.0)