net/ixgbe: fix device hotplug remove
PATCH 1/1 net/ixgbe: fix device hotplug remove
testpmd will occur infinite loops when device hotplug remove. We can fix the issue by using the pci generic remove function
--- drivers/net/ixgbe/ixgbe_ethdev.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +1 -10
@@ -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 = {
Signature · 1 line
2.17.1
PATCH v2 1/1 net/ixgbe: fix device hotplug remove
testpmd will occur infinite loops when device hotplug remove. We can fix the issue by using the pci generic remove function
v2:
reverted the code about ixgbe_vf_representor_uninit.
--- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +3 -2
@@ -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 = {
Signature · 1 line
2.17.1
Quoted 18 lines · 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 <[email protected]>v2:
reverted the code aboutixgbe_vf_representor_uninit.
---drivers/net/ixgbe/ixgbe_ethdev.c| 5 +++--1 file changed, 3 insertions(+), 2 deletions(-)drivers/net/ixgbe/ixgbe_ethdev.c +0
-0
drivers/net/ixgbe/ixgbe_ethdev.c static int eth_ixgbe_pci_remove(struct rte_pci_device *pci_dev) · line 1806
Quoted 8 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1
-1@@ -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
Quoted 10 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2
-1else -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 = {Signature · 1 line
2.17.1
Hi,
Quoted 34 lines
-----Original Message-----
From: Ye, Xiaolong
Sent: Monday, November 11, 2019 4:42 PM
To: Di, ChenxuX <[email protected]>
Cc: [email protected]; Yang, Qiming <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix device hotplug removeQuoted 7 lines · 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 <[email protected]>Review
Quoted 7 lines
v2:
reverted the code aboutixgbe_vf_representor_uninit.
---drivers/net/ixgbe/ixgbe_ethdev.c| 5 +++--1 file changed, 3 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/net/ixgbe/ixgbe_ethdev.cdrivers/net/ixgbe/ixgbe_ethdev.c static int eth_ixgbe_pci_remove(struct
Quoted 4 lines
index
dbce7a80e..7ec55a4de100644drivers/net/ixgbe/ixgbe_ethdev.c +0
-0@@ -1800,12 +1800,13 @@ static int eth_ixgbe_pci_remove(struct
rte_pci_device*pci_dev)Quoted 6 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1
-1ethdev =rte_eth_dev_allocated (pci_dev->device.name);if (!ethdev) -return -ENODEV ; +return 0 ;
Quoted 6 lines
drivers/net/ixgbe/ixgbe_ethdev.c static int eth_ixgbe_pci_remove(struct · line 1805
Quoted 2 lines
drivers/net/ixgbe/ixgbe_ethdev.c +0
-0if (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_removefor vf representor as well?
I think it can be used. Should I do it and send a new patch?
Thx
Di Chenxu
Quoted 12 lines
Thanks,
XiaolongQuoted 10 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2
-2else - 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
Quoted 36 lines · ChenxuX
Hi,
Quoted 34 lines
-----Original Message-----
From: Ye, Xiaolong
Sent: Monday, November 11, 2019 4:42 PM
To: Di, ChenxuX <[email protected]>
Cc: [email protected]; Yang, Qiming <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix device hotplug removeQuoted 7 lines · 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 <[email protected]>Review
Quoted 7 lines
v2:
reverted the code aboutixgbe_vf_representor_uninit.
---drivers/net/ixgbe/ixgbe_ethdev.c| 5 +++--1 file changed, 3 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/net/ixgbe/ixgbe_ethdev.cdrivers/net/ixgbe/ixgbe_ethdev.c static int eth_ixgbe_pci_remove(struct
Quoted 4 lines
index
dbce7a80e..7ec55a4de100644drivers/net/ixgbe/ixgbe_ethdev.c +0
-0@@ -1800,12 +1800,13 @@ static int eth_ixgbe_pci_remove(struct
rte_pci_device*pci_dev)Quoted 6 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1
-1ethdev =rte_eth_dev_allocated (pci_dev->device.name);if (!ethdev) -return -ENODEV ; +return 0 ;
Quoted 8 lines
Quoted 6 lines
drivers/net/ixgbe/ixgbe_ethdev.c static int eth_ixgbe_pci_remove(struct · line 1805
Quoted 2 lines
drivers/net/ixgbe/ixgbe_ethdev.c +0
-0if (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_removefor 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
Quoted 16 lines
Thx
Di ChenxuQuoted 12 lines
Thanks,
XiaolongQuoted 10 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2
-2else - 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
Quoted 51 lines
-----Original Message-----
From: Ye, Xiaolong
Sent: Monday, November 11, 2019 5:00 PM
To: Di, ChenxuX <[email protected]>
Cc: [email protected]; Yang, Qiming <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix device hotplug removeQuoted 41 lines · ChenxuX
Hi,
Quoted 39 lines
-----Original Message-----
From: Ye, Xiaolong
Sent: Monday, November 11, 2019 4:42 PM
To: Di, ChenxuX <[email protected]>
Cc: [email protected]; Yang, Qiming <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix device hotplug removeQuoted 7 lines · 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 <[email protected]>Review
Quoted 7 lines
v2:
reverted the code aboutixgbe_vf_representor_uninit.
---drivers/net/ixgbe/ixgbe_ethdev.c| 5 +++--1 file changed, 3 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/net/ixgbe/ixgbe_ethdev.cdrivers/net/ixgbe/ixgbe_ethdev.c static int eth_ixgbe_pci_remove(struct
Quoted 4 lines
index
dbce7a80e..7ec55a4de100644drivers/net/ixgbe/ixgbe_ethdev.c +0
-0@@ -1800,12 +1800,13 @@ static int eth_ixgbe_pci_remove(struct
rte_pci_device*pci_dev)drivers/net/ixgbe/ixgbe_ethdev.c static int eth_ixgbe_pci_remove(struct rte_pci_device *pci_dev)
Quoted 8 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1
-1ethdev =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);
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Can we use
rte_eth_dev_pci_generic_removefor 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_allocatedcheck inteth_ixgbe_pci_remove, since it has been contained inrte_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
Quoted 21 lines
Same for i40e patch.
Thanks,
XiaolongQuoted 16 lines
Thx
Di ChenxuQuoted 12 lines
Thanks,
XiaolongQuoted 10 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2
-2else - 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 v3 1/1 net/ixgbe: fix device hotplug remove
In reply to Di ChenxuXtestpmd will occur infinite loops when device hotplug remove. We can fix the issue by using the pci generic remove function
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(-)
drivers/net/ixgbe/ixgbe_ethdev.c +5 -3
@@ -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 = {
Signature · 1 line
2.17.1
Quoted 5 lines · 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")
Quoted 7 lines
Signed-off-by Di ChenxuX <[email protected]>v4:
used generic remove function forixgbe_vf_representor_uninit. v3:
reverted the code aboutixgbe_vf_representor_uninit.
---
Please put the change log after '---' marker.
Applied to dpdk-next-net-intel with changelog removed. Thanks.