[v2] net/ixgbe: fix device hotplug remove
diff mbox series

Message ID 20191107062821.32948-1-chenxux.di@intel.com
State Superseded
Delegated to: xiaolong ye
Headers show
Series
  • [v2] net/ixgbe: fix device hotplug remove
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Di ChenxuX Nov. 7, 2019, 6:28 a.m. UTC
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(-)

Comments

Ye Xiaolong Nov. 11, 2019, 8:41 a.m. UTC | #1
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
>
Di ChenxuX Nov. 11, 2019, 8:50 a.m. UTC | #2
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
> >
Ye Xiaolong Nov. 11, 2019, 9 a.m. UTC | #3
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
>> >
Di ChenxuX Nov. 11, 2019, 9:38 a.m. UTC | #4
> -----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
> >> >

Patch
diff mbox series

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 = {