* [dpdk-dev] [PATCH] net/ixgbe: fix device hotplug remove
@ 2019-11-06 5:09 Di ChenxuX
2019-11-07 6:28 ` [dpdk-dev] [PATCH v2] " Di ChenxuX
0 siblings, 1 reply; 8+ messages in thread
From: Di ChenxuX @ 2019-11-06 5:09 UTC (permalink / raw)
To: dev; +Cc: Yang Qiming, Di ChenxuX
testpmd will occur infinite loops when device hotplug remove.
We can fix the issue by using the pci generic remove function
Fixes: f2f4990eff94 ("net/ixgbe: release port upon close")
Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index dbce7a80e..84b98071d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1796,16 +1796,7 @@ eth_ixgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
static int eth_ixgbe_pci_remove(struct rte_pci_device *pci_dev)
{
- struct rte_eth_dev *ethdev;
-
- ethdev = rte_eth_dev_allocated(pci_dev->device.name);
- if (!ethdev)
- return -ENODEV;
-
- if (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)
- return rte_eth_dev_destroy(ethdev, ixgbe_vf_representor_uninit);
- else
- return rte_eth_dev_destroy(ethdev, eth_ixgbe_dev_uninit);
+ return rte_eth_dev_pci_generic_remove(pci_dev, eth_ixgbe_dev_uninit);
}
static struct rte_pci_driver rte_ixgbe_pmd = {
--
2.17.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v2] net/ixgbe: fix device hotplug remove
2019-11-06 5:09 [dpdk-dev] [PATCH] net/ixgbe: fix device hotplug remove Di ChenxuX
@ 2019-11-07 6:28 ` Di ChenxuX
2019-11-11 8:41 ` Ye Xiaolong
2019-11-12 6:00 ` [dpdk-dev] [PATCH v3] " Di ChenxuX
0 siblings, 2 replies; 8+ messages in thread
From: Di ChenxuX @ 2019-11-07 6:28 UTC (permalink / raw)
To: dev; +Cc: Yang Qiming, Di ChenxuX
testpmd will occur infinite loops when device hotplug remove.
We can fix the issue by using the pci generic remove function
Fixes: f2f4990eff94 ("net/ixgbe: release port upon close")
Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
v2:
reverted the code about ixgbe_vf_representor_uninit.
---
drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index dbce7a80e..7ec55a4de 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1800,12 +1800,13 @@ static int eth_ixgbe_pci_remove(struct rte_pci_device *pci_dev)
ethdev = rte_eth_dev_allocated(pci_dev->device.name);
if (!ethdev)
- return -ENODEV;
+ return 0;
if (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)
return rte_eth_dev_destroy(ethdev, ixgbe_vf_representor_uninit);
else
- return rte_eth_dev_destroy(ethdev, eth_ixgbe_dev_uninit);
+ return rte_eth_dev_pci_generic_remove(pci_dev,
+ eth_ixgbe_dev_uninit);
}
static struct rte_pci_driver rte_ixgbe_pmd = {
--
2.17.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix device hotplug remove
2019-11-07 6:28 ` [dpdk-dev] [PATCH v2] " Di ChenxuX
@ 2019-11-11 8:41 ` Ye Xiaolong
2019-11-11 8:50 ` Di, ChenxuX
2019-11-12 6:00 ` [dpdk-dev] [PATCH v3] " Di ChenxuX
1 sibling, 1 reply; 8+ messages in thread
From: Ye Xiaolong @ 2019-11-11 8:41 UTC (permalink / raw)
To: Di ChenxuX; +Cc: dev, Yang Qiming
On 11/07, Di ChenxuX wrote:
>testpmd will occur infinite loops when device hotplug remove.
>We can fix the issue by using the pci generic remove function
>
>Fixes: f2f4990eff94 ("net/ixgbe: release port upon close")
>
>Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
>
>v2:
>reverted the code about ixgbe_vf_representor_uninit.
>---
> drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>index dbce7a80e..7ec55a4de 100644
>--- a/drivers/net/ixgbe/ixgbe_ethdev.c
>+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>@@ -1800,12 +1800,13 @@ static int eth_ixgbe_pci_remove(struct rte_pci_device *pci_dev)
>
> ethdev = rte_eth_dev_allocated(pci_dev->device.name);
> if (!ethdev)
>- return -ENODEV;
>+ return 0;
>
> if (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)
> return rte_eth_dev_destroy(ethdev, ixgbe_vf_representor_uninit);
Can we use rte_eth_dev_pci_generic_remove for vf representor as well?
Thanks,
Xiaolong
> else
>- return rte_eth_dev_destroy(ethdev, eth_ixgbe_dev_uninit);
>+ return rte_eth_dev_pci_generic_remove(pci_dev,
>+ eth_ixgbe_dev_uninit);
> }
>
> static struct rte_pci_driver rte_ixgbe_pmd = {
>--
>2.17.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix device hotplug remove
2019-11-11 8:41 ` Ye Xiaolong
@ 2019-11-11 8:50 ` Di, ChenxuX
2019-11-11 9:00 ` Ye Xiaolong
0 siblings, 1 reply; 8+ messages in thread
From: Di, ChenxuX @ 2019-11-11 8:50 UTC (permalink / raw)
To: Ye, Xiaolong; +Cc: dev, Yang, Qiming
Hi,
> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Monday, November 11, 2019 4:42 PM
> To: Di, ChenxuX <chenxux.di@intel.com>
> Cc: dev@dpdk.org; Yang, Qiming <qiming.yang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix device hotplug remove
>
> On 11/07, Di ChenxuX wrote:
> >testpmd will occur infinite loops when device hotplug remove.
> >We can fix the issue by using the pci generic remove function
> >
> >Fixes: f2f4990eff94 ("net/ixgbe: release port upon close")
> >
> >Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
> >
> >v2:
> >reverted the code about ixgbe_vf_representor_uninit.
> >---
> > drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> >diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> >index dbce7a80e..7ec55a4de 100644
> >--- a/drivers/net/ixgbe/ixgbe_ethdev.c
> >+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> >@@ -1800,12 +1800,13 @@ static int eth_ixgbe_pci_remove(struct
> rte_pci_device *pci_dev)
> >
> > ethdev = rte_eth_dev_allocated(pci_dev->device.name);
> > if (!ethdev)
> >- return -ENODEV;
> >+ return 0;
> >
> > if (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)
> > return rte_eth_dev_destroy(ethdev,
> ixgbe_vf_representor_uninit);
>
> Can we use rte_eth_dev_pci_generic_remove for vf representor as well?
>
I think it can be used. Should I do it and send a new patch?
Thx
Di Chenxu
> Thanks,
> Xiaolong
> > else
> >- return rte_eth_dev_destroy(ethdev, eth_ixgbe_dev_uninit);
> >+ return rte_eth_dev_pci_generic_remove(pci_dev,
> >+ eth_ixgbe_dev_uninit);
> > }
> >
> > static struct rte_pci_driver rte_ixgbe_pmd = {
> >--
> >2.17.1
> >
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix device hotplug remove
2019-11-11 8:50 ` Di, ChenxuX
@ 2019-11-11 9:00 ` Ye Xiaolong
2019-11-11 9:38 ` Di, ChenxuX
0 siblings, 1 reply; 8+ messages in thread
From: Ye Xiaolong @ 2019-11-11 9:00 UTC (permalink / raw)
To: Di, ChenxuX; +Cc: dev, Yang, Qiming
On 11/11, Di, ChenxuX wrote:
>Hi,
>
>> -----Original Message-----
>> From: Ye, Xiaolong
>> Sent: Monday, November 11, 2019 4:42 PM
>> To: Di, ChenxuX <chenxux.di@intel.com>
>> Cc: dev@dpdk.org; Yang, Qiming <qiming.yang@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix device hotplug remove
>>
>> On 11/07, Di ChenxuX wrote:
>> >testpmd will occur infinite loops when device hotplug remove.
>> >We can fix the issue by using the pci generic remove function
>> >
>> >Fixes: f2f4990eff94 ("net/ixgbe: release port upon close")
>> >
>> >Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
>> >
>> >v2:
>> >reverted the code about ixgbe_vf_representor_uninit.
>> >---
>> > drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++--
>> > 1 file changed, 3 insertions(+), 2 deletions(-)
>> >
>> >diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
>> b/drivers/net/ixgbe/ixgbe_ethdev.c
>> >index dbce7a80e..7ec55a4de 100644
>> >--- a/drivers/net/ixgbe/ixgbe_ethdev.c
>> >+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>> >@@ -1800,12 +1800,13 @@ static int eth_ixgbe_pci_remove(struct
>> rte_pci_device *pci_dev)
>> >
>> > ethdev = rte_eth_dev_allocated(pci_dev->device.name);
>> > if (!ethdev)
>> >- return -ENODEV;
>> >+ return 0;
>> >
>> > if (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)
>> > return rte_eth_dev_destroy(ethdev,
>> ixgbe_vf_representor_uninit);
>>
>> Can we use rte_eth_dev_pci_generic_remove for vf representor as well?
>>
>
>I think it can be used. Should I do it and send a new patch?
Yes, please send a new patch after verification, and don't forget to remove
rte_eth_dev_allocated check int eth_ixgbe_pci_remove, since it has been contained
in rte_eth_dev_pci_generic_remove.
Same for i40e patch.
Thanks,
Xiaolong
>
>Thx
>Di Chenxu
>
>> Thanks,
>> Xiaolong
>> > else
>> >- return rte_eth_dev_destroy(ethdev, eth_ixgbe_dev_uninit);
>> >+ return rte_eth_dev_pci_generic_remove(pci_dev,
>> >+ eth_ixgbe_dev_uninit);
>> > }
>> >
>> > static struct rte_pci_driver rte_ixgbe_pmd = {
>> >--
>> >2.17.1
>> >
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix device hotplug remove
2019-11-11 9:00 ` Ye Xiaolong
@ 2019-11-11 9:38 ` Di, ChenxuX
0 siblings, 0 replies; 8+ messages in thread
From: Di, ChenxuX @ 2019-11-11 9:38 UTC (permalink / raw)
To: Ye, Xiaolong; +Cc: dev, Yang, Qiming
> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Monday, November 11, 2019 5:00 PM
> To: Di, ChenxuX <chenxux.di@intel.com>
> Cc: dev@dpdk.org; Yang, Qiming <qiming.yang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix device hotplug remove
>
> On 11/11, Di, ChenxuX wrote:
> >Hi,
> >
> >> -----Original Message-----
> >> From: Ye, Xiaolong
> >> Sent: Monday, November 11, 2019 4:42 PM
> >> To: Di, ChenxuX <chenxux.di@intel.com>
> >> Cc: dev@dpdk.org; Yang, Qiming <qiming.yang@intel.com>
> >> Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix device hotplug
> >> remove
> >>
> >> On 11/07, Di ChenxuX wrote:
> >> >testpmd will occur infinite loops when device hotplug remove.
> >> >We can fix the issue by using the pci generic remove function
> >> >
> >> >Fixes: f2f4990eff94 ("net/ixgbe: release port upon close")
> >> >
> >> >Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
> >> >
> >> >v2:
> >> >reverted the code about ixgbe_vf_representor_uninit.
> >> >---
> >> > drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++--
> >> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >> >
> >> >diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> >> b/drivers/net/ixgbe/ixgbe_ethdev.c
> >> >index dbce7a80e..7ec55a4de 100644
> >> >--- a/drivers/net/ixgbe/ixgbe_ethdev.c
> >> >+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> >> >@@ -1800,12 +1800,13 @@ static int eth_ixgbe_pci_remove(struct
> >> rte_pci_device *pci_dev)
> >> >
> >> > ethdev = rte_eth_dev_allocated(pci_dev->device.name);
> >> > if (!ethdev)
> >> >- return -ENODEV;
> >> >+ return 0;
> >> >
> >> > if (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)
> >> > return rte_eth_dev_destroy(ethdev,
> >> ixgbe_vf_representor_uninit);
> >>
> >> Can we use rte_eth_dev_pci_generic_remove for vf representor as well?
> >>
> >
> >I think it can be used. Should I do it and send a new patch?
>
> Yes, please send a new patch after verification, and don't forget to remove
> rte_eth_dev_allocated check int eth_ixgbe_pci_remove, since it has been
> contained in rte_eth_dev_pci_generic_remove.
>
Ok,I will prepare new patch.
however the ethdev->data->dev_flags need to be check, I don't think rte_eth_dev_allocated
Can be removed.
Thx
Di Chenxu
> Same for i40e patch.
>
> Thanks,
> Xiaolong
>
> >
> >Thx
> >Di Chenxu
> >
> >> Thanks,
> >> Xiaolong
> >> > else
> >> >- return rte_eth_dev_destroy(ethdev, eth_ixgbe_dev_uninit);
> >> >+ return rte_eth_dev_pci_generic_remove(pci_dev,
> >> >+ eth_ixgbe_dev_uninit);
> >> > }
> >> >
> >> > static struct rte_pci_driver rte_ixgbe_pmd = {
> >> >--
> >> >2.17.1
> >> >
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v3] net/ixgbe: fix device hotplug remove
2019-11-07 6:28 ` [dpdk-dev] [PATCH v2] " Di ChenxuX
2019-11-11 8:41 ` Ye Xiaolong
@ 2019-11-12 6:00 ` Di ChenxuX
2019-11-13 2:11 ` Ye Xiaolong
1 sibling, 1 reply; 8+ messages in thread
From: Di ChenxuX @ 2019-11-12 6:00 UTC (permalink / raw)
To: dev; +Cc: Yang Qiming, Di ChenxuX
testpmd will occur infinite loops when device hotplug remove.
We can fix the issue by using the pci generic remove function
Fixes: f2f4990eff94 ("net/ixgbe: release port upon close")
Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
v4:
used generic remove function for ixgbe_vf_representor_uninit.
v3:
reverted the code about ixgbe_vf_representor_uninit.
---
drivers/net/ixgbe/ixgbe_ethdev.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index dbce7a80e..94721141a 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1800,12 +1800,14 @@ static int eth_ixgbe_pci_remove(struct rte_pci_device *pci_dev)
ethdev = rte_eth_dev_allocated(pci_dev->device.name);
if (!ethdev)
- return -ENODEV;
+ return 0;
if (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)
- return rte_eth_dev_destroy(ethdev, ixgbe_vf_representor_uninit);
+ return rte_eth_dev_pci_generic_remove(pci_dev,
+ ixgbe_vf_representor_uninit);
else
- return rte_eth_dev_destroy(ethdev, eth_ixgbe_dev_uninit);
+ return rte_eth_dev_pci_generic_remove(pci_dev,
+ eth_ixgbe_dev_uninit);
}
static struct rte_pci_driver rte_ixgbe_pmd = {
--
2.17.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v3] net/ixgbe: fix device hotplug remove
2019-11-12 6:00 ` [dpdk-dev] [PATCH v3] " Di ChenxuX
@ 2019-11-13 2:11 ` Ye Xiaolong
0 siblings, 0 replies; 8+ messages in thread
From: Ye Xiaolong @ 2019-11-13 2:11 UTC (permalink / raw)
To: Di ChenxuX; +Cc: dev, Yang Qiming
On 11/12, Di ChenxuX wrote:
>testpmd will occur infinite loops when device hotplug remove.
>We can fix the issue by using the pci generic remove function
>
>Fixes: f2f4990eff94 ("net/ixgbe: release port upon close")
>
>Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
>
>v4:
>used generic remove function for ixgbe_vf_representor_uninit.
>v3:
>reverted the code about ixgbe_vf_representor_uninit.
>---
Please put the change log after '---' marker.
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Applied to dpdk-next-net-intel with changelog removed. Thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-11-13 2:14 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 5:09 [dpdk-dev] [PATCH] net/ixgbe: fix device hotplug remove Di ChenxuX
2019-11-07 6:28 ` [dpdk-dev] [PATCH v2] " Di ChenxuX
2019-11-11 8:41 ` Ye Xiaolong
2019-11-11 8:50 ` Di, ChenxuX
2019-11-11 9:00 ` Ye Xiaolong
2019-11-11 9:38 ` Di, ChenxuX
2019-11-12 6:00 ` [dpdk-dev] [PATCH v3] " Di ChenxuX
2019-11-13 2:11 ` Ye Xiaolong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).