From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============3883019095038932840==" MIME-Version: 1.0 From: Niu, Yawei Subject: [SPDK] Re: Potential defect in pci_unplug() Date: Tue, 29 Sep 2020 01:17:40 +0000 Message-ID: In-Reply-To: 748FDEF7-6BB0-4D27-B630-4C991D06B6F8@intel.com List-ID: To: spdk@lists.01.org --===============3883019095038932840== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Thanks a lot, Jim. I've opened SPDK issue #1605 to track this, and the mail= is forwarded to dev(a)dpdk.org. Thanks -Niu =EF=BB=BFOn 2020/9/28, 11:44 PM, "Harris, James R" wrote: Hi Niu, = I agree, this doesn't look right. Could you file an SPDK issue for thi= s to make sure we track it? And then try sending an e-mail to the DPDK mai= ling list? I'm open to submitting a patch to our DPDK submodule short-term= , but only if we get agreement with DPDK community that this fix is correct. = Thanks, = Jim = = On 9/28/20, 12:17 AM, "Niu, Yawei" wrote: = Hi, = In the pci_unplug() (dpdk/drivers/bus/pci/pci_common.c), why do we = call rte_devargs_remove() to remove the saved device args? That looks a def= ect to me, since that=E2=80=99ll result in the hot removed device failed to= be detected when it=E2=80=99s plugged back (when white list option was pro= vided), the situation is described following: = 1. App starts with white list option provided, let=E2=80=99s sup= pose the device in white list is: 0000:81:00.0; 2. rte_devargs_add() is called to add this device arg on rte_eal= _init(); 3. Issue =E2=80=9Cecho 1 > /sys/bus/pci/devices/0000\:81\:00.0/r= emove=E2=80=9D to hot remove the device; 4. pci_unplug() is called to remove the device, and rte_devargs_= remove() is called, so this device arg for white list is remove too; 5. Issue =E2=80=9Cecho 1 > /sys/bus/pci/rescan=E2=80=9D then =E2= =80=9CPCI_WHITELIST=3D=E2=80=9D0000:81:00.0=E2=80=9D spdk/script/setup.sh= =E2=80=9D to do hot plug; 6. In pci_scan_one(), new dev is generated, however, the dev->de= vice.devargs is set NULL since the device args has been removed on device u= nplug; 7. rte_pci_probe() does white list scan, however, it unexpectedl= y skips the device because the devargs of the device is NULL now; = I don=E2=80=99t fully understand the DPDK code, but this rte_devarg= s_remove() in pci_unplug() doesn=E2=80=99t make sense to me (when I comment= ed it out, seems everything will work as expected). Is this a glitch or I m= issed anything? = Thanks -Niu = = _______________________________________________ SPDK mailing list -- spdk(a)lists.01.org To unsubscribe send an email to spdk-leave(a)lists.01.org = _______________________________________________ SPDK mailing list -- spdk(a)lists.01.org To unsubscribe send an email to spdk-leave(a)lists.01.org = --===============3883019095038932840==--