[v2] net/i40e: fix device hotplug remove

Message ID 20191106050847.82673-1-chenxux.di@intel.com (mailing list archive)
State Superseded, archived
Delegated to: xiaolong ye
Headers
Series [v2] net/i40e: fix device hotplug remove |

Checks

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

Commit Message

Chenxu Di Nov. 6, 2019, 5:08 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: ac89d46096d5 ("net/i40e: release port upon close")

Signed-off-by: Di ChenxuX <chenxux.di@intel.com>

v2:
change the code in driver.
---
 drivers/net/i40e/i40e_ethdev.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
  

Comments

Xiaolong Ye Nov. 7, 2019, 2:50 a.m. UTC | #1
On 11/06, 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: ac89d46096d5 ("net/i40e: release port upon close")
>
>Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
>
>v2:
>change the code in driver.
>---
> drivers/net/i40e/i40e_ethdev.c | 12 +-----------
> 1 file changed, 1 insertion(+), 11 deletions(-)
>
>diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
>index 77a46832c..64842867d 100644
>--- a/drivers/net/i40e/i40e_ethdev.c
>+++ b/drivers/net/i40e/i40e_ethdev.c
>@@ -694,17 +694,7 @@ eth_i40e_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
> 
> static int eth_i40e_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, i40e_vf_representor_uninit);
>-	else
>-		return rte_eth_dev_destroy(ethdev, eth_i40e_dev_uninit);
>+	return rte_eth_dev_pci_generic_remove(pci_dev, eth_i40e_dev_uninit);

What about i40e_vf_representor_uninit, you also need to take it into consideration.

And you should also call rte_eth_dev_release_port in remove ops in case user 
detach a port directly without closing it first.

This comment also applies your ixgbe fix.


Thanks,
Xiaolong


> }
> 
> static struct rte_pci_driver rte_i40e_pmd = {
>-- 
>2.17.1
>
  
Chenxu Di Nov. 7, 2019, 3 a.m. UTC | #2
Hi, Xiaolong

About pf and vf for fm10k, e1000, igb, ixgbe, ice, i40e; only i40e pf and ixgbe vf use 
Rte_eth_dev_destory() in their remove function, others have already use the generic remove function.

I have send another patch about ixgbe because they fix different commits.

Thanks
Di Chenxu 

> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Thursday, November 7, 2019 10:50 AM
> To: Di, ChenxuX <chenxux.di@intel.com>
> Cc: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug remove
> 
> On 11/06, 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: ac89d46096d5 ("net/i40e: release port upon close")
> >
> >Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
> >
> >v2:
> >change the code in driver.
> >---
> > drivers/net/i40e/i40e_ethdev.c | 12 +-----------
> > 1 file changed, 1 insertion(+), 11 deletions(-)
> >
> >diff --git a/drivers/net/i40e/i40e_ethdev.c
> >b/drivers/net/i40e/i40e_ethdev.c index 77a46832c..64842867d 100644
> >--- a/drivers/net/i40e/i40e_ethdev.c
> >+++ b/drivers/net/i40e/i40e_ethdev.c
> >@@ -694,17 +694,7 @@ eth_i40e_pci_probe(struct rte_pci_driver *pci_drv
> >__rte_unused,
> >
> > static int eth_i40e_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,
> i40e_vf_representor_uninit);
> >-	else
> >-		return rte_eth_dev_destroy(ethdev, eth_i40e_dev_uninit);
> >+	return rte_eth_dev_pci_generic_remove(pci_dev, eth_i40e_dev_uninit);
> 
> What about i40e_vf_representor_uninit, you also need to take it into
> consideration.
> 
> And you should also call rte_eth_dev_release_port in remove ops in case user
> detach a port directly without closing it first.
> 
> This comment also applies your ixgbe fix.
> 
> 
> Thanks,
> Xiaolong
> 
> 
> > }
> >
> > static struct rte_pci_driver rte_i40e_pmd = {
> >--
> >2.17.1
> >
  
Xiaolong Ye Nov. 7, 2019, 3:11 a.m. UTC | #3
Hi,

On 11/07, Di, ChenxuX wrote:
>Hi, Xiaolong
>
>About pf and vf for fm10k, e1000, igb, ixgbe, ice, i40e; only i40e pf and ixgbe vf use 

For fm10k, e1000, igb, ice, please check whether they have called rte_eth_dev_release_port
in the remove ops.

>Rte_eth_dev_destory() in their remove function, others have already use the generic remove function.
>
>I have send another patch about ixgbe because they fix different commits.

For i40e and ixgbe, please address the comments I raised in previous mail.

Thanks,
Xiaolong

>
>Thanks
>Di Chenxu 
>
>> -----Original Message-----
>> From: Ye, Xiaolong
>> Sent: Thursday, November 7, 2019 10:50 AM
>> To: Di, ChenxuX <chenxux.di@intel.com>
>> Cc: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
>> <qiming.yang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug remove
>> 
>> On 11/06, 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: ac89d46096d5 ("net/i40e: release port upon close")
>> >
>> >Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
>> >
>> >v2:
>> >change the code in driver.
>> >---
>> > drivers/net/i40e/i40e_ethdev.c | 12 +-----------
>> > 1 file changed, 1 insertion(+), 11 deletions(-)
>> >
>> >diff --git a/drivers/net/i40e/i40e_ethdev.c
>> >b/drivers/net/i40e/i40e_ethdev.c index 77a46832c..64842867d 100644
>> >--- a/drivers/net/i40e/i40e_ethdev.c
>> >+++ b/drivers/net/i40e/i40e_ethdev.c
>> >@@ -694,17 +694,7 @@ eth_i40e_pci_probe(struct rte_pci_driver *pci_drv
>> >__rte_unused,
>> >
>> > static int eth_i40e_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,
>> i40e_vf_representor_uninit);
>> >-	else
>> >-		return rte_eth_dev_destroy(ethdev, eth_i40e_dev_uninit);
>> >+	return rte_eth_dev_pci_generic_remove(pci_dev, eth_i40e_dev_uninit);
>> 
>> What about i40e_vf_representor_uninit, you also need to take it into
>> consideration.
>> 
>> And you should also call rte_eth_dev_release_port in remove ops in case user
>> detach a port directly without closing it first.
>> 
>> This comment also applies your ixgbe fix.
>> 
>> 
>> Thanks,
>> Xiaolong
>> 
>> 
>> > }
>> >
>> > static struct rte_pci_driver rte_i40e_pmd = {
>> >--
>> >2.17.1
>> >
  
Chenxu Di Nov. 7, 2019, 5:45 a.m. UTC | #4
Hi,

> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Thursday, November 7, 2019 11:11 AM
> To: Di, ChenxuX <chenxux.di@intel.com>
> Cc: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug remove
> 
> Hi,
> 
> On 11/07, Di, ChenxuX wrote:
> >Hi, Xiaolong
> >
> >About pf and vf for fm10k, e1000, igb, ixgbe, ice, i40e; only i40e pf
> >and ixgbe vf use
> 
> For fm10k, e1000, igb, ice, please check whether they have called
> rte_eth_dev_release_port in the remove ops.
> 

The function rte_eth_dev_pci_generic_remove will call rte_eth_dev_release_port
After the uninit function of drivers.

> >Rte_eth_dev_destory() in their remove function, others have already use the
> generic remove function.
> >
> >I have send another patch about ixgbe because they fix different commits.
> 
> For i40e and ixgbe, please address the comments I raised in previous mail.
> 

When app detach a port without a close, it will call the remove function,
What will uninit the port and rte_eth_dev_release_port.

Thx
Di Chenxu

> Thanks,
> Xiaolong
> 
> >
> >Thanks
> >Di Chenxu
> >
> >> -----Original Message-----
> >> From: Ye, Xiaolong
> >> Sent: Thursday, November 7, 2019 10:50 AM
> >> To: Di, ChenxuX <chenxux.di@intel.com>
> >> Cc: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> >> <qiming.yang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> >> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug
> >> remove
> >>
> >> On 11/06, 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: ac89d46096d5 ("net/i40e: release port upon close")
> >> >
> >> >Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
> >> >
> >> >v2:
> >> >change the code in driver.
> >> >---
> >> > drivers/net/i40e/i40e_ethdev.c | 12 +-----------
> >> > 1 file changed, 1 insertion(+), 11 deletions(-)
> >> >
> >> >diff --git a/drivers/net/i40e/i40e_ethdev.c
> >> >b/drivers/net/i40e/i40e_ethdev.c index 77a46832c..64842867d 100644
> >> >--- a/drivers/net/i40e/i40e_ethdev.c
> >> >+++ b/drivers/net/i40e/i40e_ethdev.c
> >> >@@ -694,17 +694,7 @@ eth_i40e_pci_probe(struct rte_pci_driver
> >> >*pci_drv __rte_unused,
> >> >
> >> > static int eth_i40e_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,
> >> i40e_vf_representor_uninit);
> >> >-	else
> >> >-		return rte_eth_dev_destroy(ethdev, eth_i40e_dev_uninit);
> >> >+	return rte_eth_dev_pci_generic_remove(pci_dev,
> >> >+eth_i40e_dev_uninit);
> >>
> >> What about i40e_vf_representor_uninit, you also need to take it into
> >> consideration.
> >>
> >> And you should also call rte_eth_dev_release_port in remove ops in
> >> case user detach a port directly without closing it first.
> >>
> >> This comment also applies your ixgbe fix.
> >>
> >>
> >> Thanks,
> >> Xiaolong
> >>
> >>
> >> > }
> >> >
> >> > static struct rte_pci_driver rte_i40e_pmd = {
> >> >--
> >> >2.17.1
> >> >
  
Xiaolong Ye Nov. 7, 2019, 5:45 a.m. UTC | #5
On 11/07, Di, ChenxuX wrote:
>Hi,
>
>> -----Original Message-----
>> From: Ye, Xiaolong
>> Sent: Thursday, November 7, 2019 11:11 AM
>> To: Di, ChenxuX <chenxux.di@intel.com>
>> Cc: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
>> <qiming.yang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug remove
>> 
>> Hi,
>> 
>> On 11/07, Di, ChenxuX wrote:
>> >Hi, Xiaolong
>> >
>> >About pf and vf for fm10k, e1000, igb, ixgbe, ice, i40e; only i40e pf
>> >and ixgbe vf use
>> 
>> For fm10k, e1000, igb, ice, please check whether they have called
>> rte_eth_dev_release_port in the remove ops.
>> 
>
>The function rte_eth_dev_pci_generic_remove will call rte_eth_dev_release_port
>After the uninit function of drivers.

Emm, yes, just double checked, rte_eth_dev_pci_generic_remove will call rte_eth_dev_pci_release
which finally invokes rte_eth_dev_release_port.

>
>> >Rte_eth_dev_destory() in their remove function, others have already use the
>> generic remove function.
>> >
>> >I have send another patch about ixgbe because they fix different commits.
>> 
>> For i40e and ixgbe, please address the comments I raised in previous mail.
>> 
>
>When app detach a port without a close, it will call the remove function,
>What will uninit the port and rte_eth_dev_release_port.

You'll still need to handle i40e_vf_representor_uninit.


Thanks,
Xiaolong
>
>Thx
>Di Chenxu
>
>> Thanks,
>> Xiaolong
>> 
>> >
>> >Thanks
>> >Di Chenxu
>> >
>> >> -----Original Message-----
>> >> From: Ye, Xiaolong
>> >> Sent: Thursday, November 7, 2019 10:50 AM
>> >> To: Di, ChenxuX <chenxux.di@intel.com>
>> >> Cc: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
>> >> <qiming.yang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
>> >> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug
>> >> remove
>> >>
>> >> On 11/06, 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: ac89d46096d5 ("net/i40e: release port upon close")
>> >> >
>> >> >Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
>> >> >
>> >> >v2:
>> >> >change the code in driver.
>> >> >---
>> >> > drivers/net/i40e/i40e_ethdev.c | 12 +-----------
>> >> > 1 file changed, 1 insertion(+), 11 deletions(-)
>> >> >
>> >> >diff --git a/drivers/net/i40e/i40e_ethdev.c
>> >> >b/drivers/net/i40e/i40e_ethdev.c index 77a46832c..64842867d 100644
>> >> >--- a/drivers/net/i40e/i40e_ethdev.c
>> >> >+++ b/drivers/net/i40e/i40e_ethdev.c
>> >> >@@ -694,17 +694,7 @@ eth_i40e_pci_probe(struct rte_pci_driver
>> >> >*pci_drv __rte_unused,
>> >> >
>> >> > static int eth_i40e_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,
>> >> i40e_vf_representor_uninit);
>> >> >-	else
>> >> >-		return rte_eth_dev_destroy(ethdev, eth_i40e_dev_uninit);
>> >> >+	return rte_eth_dev_pci_generic_remove(pci_dev,
>> >> >+eth_i40e_dev_uninit);
>> >>
>> >> What about i40e_vf_representor_uninit, you also need to take it into
>> >> consideration.
>> >>
>> >> And you should also call rte_eth_dev_release_port in remove ops in
>> >> case user detach a port directly without closing it first.
>> >>
>> >> This comment also applies your ixgbe fix.
>> >>
>> >>
>> >> Thanks,
>> >> Xiaolong
>> >>
>> >>
>> >> > }
>> >> >
>> >> > static struct rte_pci_driver rte_i40e_pmd = {
>> >> >--
>> >> >2.17.1
>> >> >
  
Chenxu Di Nov. 7, 2019, 6:02 a.m. UTC | #6
> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Thursday, November 7, 2019 1:46 PM
> To: Di, ChenxuX <chenxux.di@intel.com>
> Cc: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug remove
> 
> On 11/07, Di, ChenxuX wrote:
> >Hi,
> >
> >> -----Original Message-----
> >> From: Ye, Xiaolong
> >> Sent: Thursday, November 7, 2019 11:11 AM
> >> To: Di, ChenxuX <chenxux.di@intel.com>
> >> Cc: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> >> <qiming.yang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> >> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug
> >> remove
> >>
> >> Hi,
> >>
> >> On 11/07, Di, ChenxuX wrote:
> >> >Hi, Xiaolong
> >> >
> >> >About pf and vf for fm10k, e1000, igb, ixgbe, ice, i40e; only i40e
> >> >pf and ixgbe vf use
> >>
> >> For fm10k, e1000, igb, ice, please check whether they have called
> >> rte_eth_dev_release_port in the remove ops.
> >>
> >
> >The function rte_eth_dev_pci_generic_remove will call
> >rte_eth_dev_release_port After the uninit function of drivers.
> 
> Emm, yes, just double checked, rte_eth_dev_pci_generic_remove will call
> rte_eth_dev_pci_release which finally invokes rte_eth_dev_release_port.
> 

Ok

> >
> >> >Rte_eth_dev_destory() in their remove function, others have already
> >> >use the
> >> generic remove function.
> >> >
> >> >I have send another patch about ixgbe because they fix different commits.
> >>
> >> For i40e and ixgbe, please address the comments I raised in previous mail.
> >>
> >
> >When app detach a port without a close, it will call the remove
> >function, What will uninit the port and rte_eth_dev_release_port.
> 
> You'll still need to handle i40e_vf_representor_uninit.
> 

Ok,I will modify the code and send a new version later.

> 
> Thanks,
> Xiaolong
> >
> >Thx
> >Di Chenxu
> >
> >> Thanks,
> >> Xiaolong
> >>
> >> >
> >> >Thanks
> >> >Di Chenxu
> >> >
> >> >> -----Original Message-----
> >> >> From: Ye, Xiaolong
> >> >> Sent: Thursday, November 7, 2019 10:50 AM
> >> >> To: Di, ChenxuX <chenxux.di@intel.com>
> >> >> Cc: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> >> >> <qiming.yang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> >> >> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug
> >> >> remove
> >> >>
> >> >> On 11/06, 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: ac89d46096d5 ("net/i40e: release port upon close")
> >> >> >
> >> >> >Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
> >> >> >
> >> >> >v2:
> >> >> >change the code in driver.
> >> >> >---
> >> >> > drivers/net/i40e/i40e_ethdev.c | 12 +-----------
> >> >> > 1 file changed, 1 insertion(+), 11 deletions(-)
> >> >> >
> >> >> >diff --git a/drivers/net/i40e/i40e_ethdev.c
> >> >> >b/drivers/net/i40e/i40e_ethdev.c index 77a46832c..64842867d
> >> >> >100644
> >> >> >--- a/drivers/net/i40e/i40e_ethdev.c
> >> >> >+++ b/drivers/net/i40e/i40e_ethdev.c
> >> >> >@@ -694,17 +694,7 @@ eth_i40e_pci_probe(struct rte_pci_driver
> >> >> >*pci_drv __rte_unused,
> >> >> >
> >> >> > static int eth_i40e_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,
> >> >> i40e_vf_representor_uninit);
> >> >> >-	else
> >> >> >-		return rte_eth_dev_destroy(ethdev,
> eth_i40e_dev_uninit);
> >> >> >+	return rte_eth_dev_pci_generic_remove(pci_dev,
> >> >> >+eth_i40e_dev_uninit);
> >> >>
> >> >> What about i40e_vf_representor_uninit, you also need to take it
> >> >> into consideration.
> >> >>
> >> >> And you should also call rte_eth_dev_release_port in remove ops in
> >> >> case user detach a port directly without closing it first.
> >> >>
> >> >> This comment also applies your ixgbe fix.
> >> >>
> >> >>
> >> >> Thanks,
> >> >> Xiaolong
> >> >>
> >> >>
> >> >> > }
> >> >> >
> >> >> > static struct rte_pci_driver rte_i40e_pmd = {
> >> >> >--
> >> >> >2.17.1
> >> >> >
  

Patch

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 77a46832c..64842867d 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -694,17 +694,7 @@  eth_i40e_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 static int eth_i40e_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, i40e_vf_representor_uninit);
-	else
-		return rte_eth_dev_destroy(ethdev, eth_i40e_dev_uninit);
+	return rte_eth_dev_pci_generic_remove(pci_dev, eth_i40e_dev_uninit);
 }
 
 static struct rte_pci_driver rte_i40e_pmd = {