From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0080.outbound.protection.outlook.com [104.47.0.80]) by dpdk.org (Postfix) with ESMTP id 280B22082 for ; Tue, 6 Nov 2018 07:22:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IYW+kue+Dy+xXfhtEFj7xeCCy3HXy9GuoqnqKraTj98=; b=tp/OSmPJxdJEYfFutlKpmTwq5ZKo9fwJ3miA4i9+/qN1BMeY0yMo8SIY0MQCfyX7yIXRNqO63axL/gkwg/uULx8Mq9SXheG+oYj4m4DNnPSBfqC+UHDkvHuuzmL/OjAhc8izQU13vdpYP27h/9kRvgfb9AWTctwauxBX/ZagD8I= Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com (52.133.41.11) by AM0PR0502MB3684.eurprd05.prod.outlook.com (52.133.46.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.33; Tue, 6 Nov 2018 06:22:44 +0000 Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::b158:af20:5026:3d25]) by AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::b158:af20:5026:3d25%2]) with mapi id 15.20.1294.034; Tue, 6 Nov 2018 06:22:44 +0000 From: Matan Azrad To: Jeff Guo , "konstantin.ananyev@intel.com" , "anatoly.burakov@intel.com" , Thomas Monjalon , "bernard.iremonger@intel.com" , "jingjing.wu@intel.com" , "wenzhuo.lu@intel.com" CC: "ferruh.yigit@intel.com" , "dev@dpdk.org" , "helin.zhang@intel.com" , "shaopeng.he@intel.com" Thread-Topic: [PATCH 1/3] eal: fix lock issue for hot-unplug Thread-Index: AQHUdZZ66ub+GmSlpEGmt4z4Lo/60KVCRl1w Date: Tue, 6 Nov 2018 06:22:44 +0000 Message-ID: References: <1541484436-91320-1-git-send-email-jia.guo@intel.com> <1541484436-91320-2-git-send-email-jia.guo@intel.com> In-Reply-To: <1541484436-91320-2-git-send-email-jia.guo@intel.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR0502MB3684; 6:BlLBBS3RR/ZwxV6viHW/XuutXAJKZBVu5pdGhcYcomPODHzXnJSXJfTHGBnnoM4D/5LgK2C3XcHMQ3Xb6YBDjavxD0rXgXIuARcBjq3/PAT4XBwb8mIL4REzn0o5206Bmcz8c5UJsoyKyiiNIfVYfD7XowDqIYfOWIh7T29fVCgccJu38XSUZ7tqrhccy3ln1KjrvBesAAq82Z4oA3+VoHPPKpzP/FBuZGsMqKaEmcOojAjDpT8XxKACbKu/BUCDK0l+rtc3ZDfTczuSg4leukygA8lRyQKiGMAKVeYiivdnfgrDQeUS2CfdPz2js8xRW3BCDGSrW1/rplxJ3BkT621aN3SoLa80m/hGeQ7nf7sdgRAZk1K1LiKpOSn51zDrPq7dweLo6H8sbY6m5EvDSEeO75SRP85kd12Cc9qkotyiMf/gTo1xrS4q7lyplaQrDJZ8O+mvgvPbQ2u5eDqpYg==; 5:K/UW7yjzJE7qQhHoGXZ/w3BoMc3kniaAE1k5YW+okQgLaSm5GZ72ql+T+J67ZeFFhrG7RR9il67qn63+aF7b4IdfEbk/TNvWSghpPyl6n/ZBTtAF2AB4bOikFeDu4uCvvhbBnpdg3xqEM5QOwWT2YICTLCOf/H6qjtGB9WEstFk=; 7:/SgY2fmWWIWj0HWEVHD8IiXVVWDTTCro8JpWUCoF+gFphtGiQSIG+U54UMX/TLJjyV+/LXq5EpC1YYHarYvjfNI0oS6GO2Yj3Mgr89UNgjHcKUGoVZDYqEbHGtjUcM1LrD84CV3lEMYXwF4ZAsZ/mA== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 77d34a1c-ba22-401c-4ac7-08d643b0435e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB3684; x-ms-traffictypediagnostic: AM0PR0502MB3684: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231382)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM0PR0502MB3684; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0502MB3684; x-forefront-prvs: 0848C1A6AA x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39860400002)(346002)(396003)(136003)(189003)(199004)(13464003)(478600001)(4326008)(186003)(2201001)(6246003)(86362001)(66066001)(14454004)(53936002)(97736004)(2501003)(99286004)(102836004)(33656002)(5660300001)(305945005)(53546011)(6506007)(7416002)(106356001)(7736002)(7696005)(26005)(105586002)(76176011)(74316002)(54906003)(110136005)(6436002)(316002)(2906002)(8676002)(71200400001)(71190400001)(476003)(55016002)(229853002)(446003)(486006)(9686003)(11346002)(2900100001)(14444005)(81156014)(6116002)(68736007)(81166006)(8936002)(256004)(3846002)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3684; H:AM0PR0502MB4019.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: VhHH8NaZvRVVvkYQx4xx3dUVg0kBznLxW7aywRPVtdnw6lI1mto29zLosksgpamEmIYRXOIIPLdpWJJtISdcvoOuEqd7fBy8zYYxseL2uhoucKGF92cPha5NbN37o0Z+vrWQD20Ci9WQXh35CybefuxrKmUs01J6guK4t4gOjx38iA/0un3BjP5gOi5RkJmpgHZkVXrl9iMcuu3YEA4kS3zt7vE9jRZGTwovQhkdymHVKqjWDebhix4xBYr6ze0upYNOiqYRtcrG6uGGi7h92+sfh5CpqDwqB1f7jzPE3JZT6nmCUxUj5rKlyPDX69ZXuvsYrypSFBBmIpakebJ3BafY1lISfCLxOAxKvmuOJv8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77d34a1c-ba22-401c-4ac7-08d643b0435e X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2018 06:22:44.1560 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3684 Subject: Re: [dpdk-dev] [PATCH 1/3] eal: fix lock issue for hot-unplug X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2018 06:22:46 -0000 Hi Jeff Can you detail more in the commit log that we can understand the deadlock s= cenario. And how does this commit fix it?=20 > -----Original Message----- > From: Jeff Guo > Sent: Tuesday, November 6, 2018 8:07 AM > To: konstantin.ananyev@intel.com; anatoly.burakov@intel.com; Thomas > Monjalon ; bernard.iremonger@intel.com; > jingjing.wu@intel.com; wenzhuo.lu@intel.com > Cc: ferruh.yigit@intel.com; dev@dpdk.org; jia.guo@intel.com; > helin.zhang@intel.com; Matan Azrad ; > shaopeng.he@intel.com > Subject: [PATCH 1/3] eal: fix lock issue for hot-unplug >=20 > This patch will add missing unlock for hot-unplug handler, without this p= atch > potential dead lock will occur when device be hotplug-in after device be = hot- > unplugged. >=20 > Fixes: 0fc54536b14a ("eal: add failure handling for hot-unplug") > Signed-off-by: Jeff Guo > --- > lib/librte_eal/linuxapp/eal/eal_dev.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) >=20 > diff --git a/lib/librte_eal/linuxapp/eal/eal_dev.c > b/lib/librte_eal/linuxapp/eal/eal_dev.c > index d589c69..2830c86 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_dev.c > +++ b/lib/librte_eal/linuxapp/eal/eal_dev.c > @@ -258,7 +258,7 @@ dev_uev_handler(__rte_unused void *param) > if (bus =3D=3D NULL) { > RTE_LOG(ERR, EAL, "Cannot find bus (%s)\n", > busname); > - return; > + goto failure_handle_err; > } >=20 > dev =3D bus->find_device(NULL, cmp_dev_name, @@ > -266,19 +266,23 @@ dev_uev_handler(__rte_unused void *param) > if (dev =3D=3D NULL) { > RTE_LOG(ERR, EAL, "Cannot find device (%s) > on " > "bus (%s)\n", uevent.devname, > busname); > - return; > + goto failure_handle_err; > } >=20 > ret =3D bus->hot_unplug_handler(dev); > - rte_spinlock_unlock(&failure_handle_lock); > if (ret) { > RTE_LOG(ERR, EAL, "Can not handle hot- > unplug " > "for device (%s)\n", dev->name); > - return; > } > + rte_spinlock_unlock(&failure_handle_lock); > } > rte_dev_event_callback_process(uevent.devname, > uevent.type); > } > + > + return; > + > +failure_handle_err: > + rte_spinlock_unlock(&failure_handle_lock); > } >=20 > int __rte_experimental > -- > 2.7.4