pdump: fix vdev cleanup
PATCH v2 1/1 pdump: fix vdev cleanup
From: reshmapa <[email protected]>
Virtual devices added in pdump application
using rte_eal_hotplug_add should be removed explicitly while existing the pdump application, otherwise the subsequent run of the pdump application will fail with the reason that virtual devices with the same name already exists in primary.
---
v2: fix typo in commit message
--- app/pdump/main.c | 9 +++++++++ 1 file changed, 9 insertions(+)
app/pdump/main.c +9 -0
@@ -494,6 +494,7 @@ cleanup_pdump_resources(void) {int i;struct pdump_tuples *pt; +char name[RTE_ETH_NAME_MAX_LEN ];/* disable pdump and free the pdump_tuple resources */ for (i =0 ; i < num_tuples; i++) {
@@ -510,6 +511,14 @@ cleanup_pdump_resources(void)free_ring_data (pt->rx_ring, pt->rx_vdev_id, &pt->stats);if (pt->dir &RTE_PDUMP_FLAG_TX )free_ring_data (pt->tx_ring, pt->tx_vdev_id, &pt->stats); + +/* Remove the vdev created */ +rte_eth_dev_get_name_by_port (pt->rx_vdev_id, name); +rte_eal_hotplug_remove ("vdev" , name); + +rte_eth_dev_get_name_by_port (pt->tx_vdev_id, name); +rte_eal_hotplug_remove ("vdev" , name); + }cleanup_rings (); }
Signature · 1 line
2.17.1
PATCH v3 1/1 pdump: fix vdev cleanup
Virtual devices added in pdump application
using rte_eal_hotplug_add should be removed explicitly while existing the pdump application, otherwise the subsequent run of the pdump application will fail with the reason that virtual devices with the same name already exists in primary.
---
v3: fix author
v2: fix typo in commit message
---
--- app/pdump/main.c | 9 +++++++++ 1 file changed, 9 insertions(+)
app/pdump/main.c +9 -0
@@ -494,6 +494,7 @@ cleanup_pdump_resources(void) {int i;struct pdump_tuples *pt; +char name[RTE_ETH_NAME_MAX_LEN ];/* disable pdump and free the pdump_tuple resources */ for (i =0 ; i < num_tuples; i++) {
@@ -510,6 +511,14 @@ cleanup_pdump_resources(void)free_ring_data (pt->rx_ring, pt->rx_vdev_id, &pt->stats);if (pt->dir &RTE_PDUMP_FLAG_TX )free_ring_data (pt->tx_ring, pt->tx_vdev_id, &pt->stats); + +/* Remove the vdev created */ +rte_eth_dev_get_name_by_port (pt->rx_vdev_id, name); +rte_eal_hotplug_remove ("vdev" , name); + +rte_eth_dev_get_name_by_port (pt->tx_vdev_id, name); +rte_eal_hotplug_remove ("vdev" , name); + }cleanup_rings (); }
Signature · 1 line
2.17.1
11/01/2019 18:51, Reshma Pattan:
Quoted 3 lines
Virtual devices added in pdump application using
rte_eal_hotplug_addshould be removed explicitly while existing the pdump application, otherwise the
existing -> exiting ?
Quoted 6 lines
subsequent run of the pdump application will fail with the reason that virtual devices with the same name already exists in primary.
Fixes 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdev attach")
Why is it marked as a fix of this commit?
Is it a miss in the conversion from ethdev attach calls? Or a changed behaviour with hotplug functions?
Quoted 19 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Tuesday, January 15, 2019 12:59 AM
To: Pattan, Reshma <[email protected]>
Cc: [email protected]; [email protected]; Yigit, Ferruh <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3] pdump: fix vdev cleanup11/01/2019 18:51, Reshma Pattan:
Quoted 3 lines
Virtual devices added in pdump application using
rte_eal_hotplug_addshould be removed explicitly while existing the pdump application, otherwise theexisting -> exiting ?
Quoted 3 lines
subsequent run of the pdump application will fail with the reason that virtual devices with the same name already exists in primary.
Quoted 10 lines
Quoted 4 lines
Fixes 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdevattach")
CC: [email protected]
CC: [email protected]Why is it marked as a fix of this commit?
Is it a miss in the conversion from ethdev attach calls? Or a changed behaviour with hotplug functions?
It is changed behaviour with hotplug functions.
Thanks,
Reshma
15/01/2019 11:09, Pattan, Reshma:
Quoted 16 lines
From: Thomas Monjalon [mailto:[email protected]]
Quoted 15 lines
11/01/2019 18:51, Reshma Pattan:
Quoted 3 lines
Virtual devices added in pdump application using
rte_eal_hotplug_addshould be removed explicitly while existing the pdump application, otherwise theexisting -> exiting ?
Quoted 7 lines
subsequent run of the pdump application will fail with the reason that virtual devices with the same name already exists in primary.
Fixes 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdevattach")
CC: [email protected]
CC: [email protected]
Quoted 5 lines
Quoted 3 lines
Why is it marked as a fix of this commit?
Is it a miss in the conversion from ethdev attach calls? Or a changed behaviour with hotplug functions?It is changed behaviour with hotplug functions.
Please, could you explain?
Quoted 26 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Tuesday, January 15, 2019 10:11 AM
To: Pattan, Reshma <[email protected]>
Cc: [email protected]; [email protected]; Yigit, Ferruh <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3] pdump: fix vdev cleanup15/01/2019 11:09, Pattan, Reshma:
Quoted 16 lines
From: Thomas Monjalon [mailto:[email protected]]
Quoted 15 lines
11/01/2019 18:51, Reshma Pattan:
Quoted 3 lines
Virtual devices added in pdump application using
rte_eal_hotplug_addshould be removed explicitly while existing the pdump application, otherwise theexisting -> exiting ?
Quoted 7 lines
subsequent run of the pdump application will fail with the reason that virtual devices with the same name already exists in primary.
Fixes 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdevattach")
CC: [email protected]
CC: [email protected]
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Why is it marked as a fix of this commit?
Is it a miss in the conversion from ethdev attach calls? Or a changed behaviour with hotplug functions?It is changed behaviour with hotplug functions.
Please, could you explain?
Attach calls were replaced with rte_eal_hotplug_remove() in pdump in the commit id given in Fixes line.
And after this change, the subsequent runs(other than 1st) of pdump application are failing with below error
1)Pdump application error:
EAL: Failed to hotplug add device
EAL: Error - exiting with code: 1
Cause: vdev creation failed:create_mp_ring_vdev:706
2)And error on primary application side is below:
testpmd> Ethernet device with name net_pcap_rx_0 already allocated
EAL: Failed to hotplug add device on primary
So, the dev added in secondary should be removed during its exit by calling rte_eal_hotplug_remove ().
So, that is the reason I chose the Fixes: commit as the one where rte_eal_hotplug_add() replaced the attach.
Earlier with attach calls though not detaching the devices upon application exit, these issues are not seen.
Thanks,
Reshma
15/01/2019 11:25, Pattan, Reshma:
Quoted 41 lines
From: Thomas Monjalon [mailto:[email protected]]
Quoted 17 lines
15/01/2019 11:09, Pattan, Reshma:
Quoted 16 lines
From: Thomas Monjalon [mailto:[email protected]]
Quoted 15 lines
11/01/2019 18:51, Reshma Pattan:
Quoted 3 lines
Virtual devices added in pdump application using
rte_eal_hotplug_addshould be removed explicitly while existing the pdump application, otherwise theexisting -> exiting ?
Quoted 7 lines
subsequent run of the pdump application will fail with the reason that virtual devices with the same name already exists in primary.
Fixes 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdevattach")
CC: [email protected]
CC: [email protected]Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Why is it marked as a fix of this commit?
Is it a miss in the conversion from ethdev attach calls? Or a changed behaviour with hotplug functions?It is changed behaviour with hotplug functions.
Please, could you explain?
Attach calls were replaced with
rte_eal_hotplug_remove()in pdump in the commit id given in Fixes line.And after this change, the subsequent runs(other than 1st) of pdump application are failing with below error
1)Pdump application error:
EAL: Failed to hotplug add device
EAL: Error - exiting with code: 1
Cause: vdev creation failed:create_mp_ring_vdev:7062)And error on primary application side is below:
testpmd> Ethernet device with namenet_pcap_rx_0already allocated
EAL: Failed to hotplug add device on primary
Quoted 5 lines
So, the dev added in secondary should be removed during its exit by calling
rte_eal_hotplug_remove().So, that is the reason I chose the Fixes: commit as the one where
rte_eal_hotplug_add()replaced the attach.Earlier with attach calls though not detaching the devices upon application exit, these issues are not seen.
OK
I won't dig to understand why this error was hidden with previous API. I'll assume there is no need to backport this fix in 17.11.
PATCH v4 1/1 pdump: fix vdev cleanup
In reply to Reshma PattanVirtual devices added in pdump application
using rte_eal_hotplug_add should be removed explicitly while exiting the pdump application, otherwise the subsequent run of the pdump application will fail with the reason that virtual devices with the same name already exists in primary.
---
v4: fix typo in commit message
v3: fix author
v2: fix typo in commit message
---
--- app/pdump/main.c | 9 +++++++++ 1 file changed, 9 insertions(+)
app/pdump/main.c +9 -0
@@ -494,6 +494,7 @@ cleanup_pdump_resources(void) {int i;struct pdump_tuples *pt; +char name[RTE_ETH_NAME_MAX_LEN ];/* disable pdump and free the pdump_tuple resources */ for (i =0 ; i < num_tuples; i++) {
@@ -510,6 +511,14 @@ cleanup_pdump_resources(void)free_ring_data (pt->rx_ring, pt->rx_vdev_id, &pt->stats);if (pt->dir &RTE_PDUMP_FLAG_TX )free_ring_data (pt->tx_ring, pt->tx_vdev_id, &pt->stats); + +/* Remove the vdev created */ +rte_eth_dev_get_name_by_port (pt->rx_vdev_id, name); +rte_eal_hotplug_remove ("vdev" , name); + +rte_eth_dev_get_name_by_port (pt->tx_vdev_id, name); +rte_eal_hotplug_remove ("vdev" , name); + }cleanup_rings (); }
Signature · 1 line
2.17.1
Quoted 11 lines · Reshma Pattan
Virtual devices added in pdump application
usingrte_eal_hotplug_addshould be removed explicitly while exiting the pdump application, otherwise the subsequent run of the pdump application will fail with the reason that virtual devices with the same name already exists in primary.Fixes 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdev attach")Signed-off-by Reshma Pattan <[email protected]>
Thomas Monjalon
Applied15/01/2019 15:57, Ferruh Yigit:
Quoted 7 lines · Reshma Pattan
Quoted 6 lines
Virtual devices added in pdump application
usingrte_eal_hotplug_addshould be removed explicitly while exiting the pdump application, otherwise the subsequent run of the pdump application will fail with the reason that virtual devices with the same name already exists in primary.
Quoted 7 lines
Quoted 5 lines
Fixes 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdev attach")Signed-off-by Reshma Pattan <[email protected]>Tested-by Ferruh Yigit <[email protected]>
Applied, thanks