* [dpdk-dev] [PATCH v2] pdump: fix vdev cleanup
@ 2019-01-11 17:41 Reshma Pattan
2019-01-11 17:51 ` [dpdk-dev] [PATCH v3] " Reshma Pattan
0 siblings, 1 reply; 10+ messages in thread
From: Reshma Pattan @ 2019-01-11 17:41 UTC (permalink / raw)
To: dev; +Cc: reshmapa, stable, ferruh.yigit
From: reshmapa <reshma.pattan@intel.com>
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.
Fixes: 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdev attach")
CC: stable@dpdk.org
CC: ferruh.yigit@intel.com
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
v2: fix typo in commit message
---
app/pdump/main.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/app/pdump/main.c b/app/pdump/main.c
index 9e86bf623..5e183ea90 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -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();
}
--
2.17.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH v3] pdump: fix vdev cleanup
2019-01-11 17:41 [dpdk-dev] [PATCH v2] pdump: fix vdev cleanup Reshma Pattan
@ 2019-01-11 17:51 ` Reshma Pattan
2019-01-15 0:59 ` Thomas Monjalon
2019-01-15 13:45 ` [dpdk-dev] [PATCH v4] " Reshma Pattan
0 siblings, 2 replies; 10+ messages in thread
From: Reshma Pattan @ 2019-01-11 17:51 UTC (permalink / raw)
To: dev; +Cc: Reshma Pattan, stable, ferruh.yigit
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.
Fixes: 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdev attach")
CC: stable@dpdk.org
CC: ferruh.yigit@intel.com
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
v3: fix author
v2: fix typo in commit message
---
---
app/pdump/main.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/app/pdump/main.c b/app/pdump/main.c
index 9e86bf623..5e183ea90 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -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();
}
--
2.17.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v3] pdump: fix vdev cleanup
2019-01-11 17:51 ` [dpdk-dev] [PATCH v3] " Reshma Pattan
@ 2019-01-15 0:59 ` Thomas Monjalon
2019-01-15 10:09 ` Pattan, Reshma
2019-01-15 13:45 ` [dpdk-dev] [PATCH v4] " Reshma Pattan
1 sibling, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2019-01-15 0:59 UTC (permalink / raw)
To: Reshma Pattan; +Cc: dev, stable, ferruh.yigit
11/01/2019 18:51, Reshma Pattan:
> Virtual devices added in pdump application
> using rte_eal_hotplug_add should be removed explicitly
> while existing the pdump application, otherwise the
existing -> exiting ?
> 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")
> CC: stable@dpdk.org
> CC: ferruh.yigit@intel.com
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?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v3] pdump: fix vdev cleanup
2019-01-15 0:59 ` Thomas Monjalon
@ 2019-01-15 10:09 ` Pattan, Reshma
2019-01-15 10:10 ` Thomas Monjalon
0 siblings, 1 reply; 10+ messages in thread
From: Pattan, Reshma @ 2019-01-15 10:09 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, stable, Yigit, Ferruh
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Tuesday, January 15, 2019 12:59 AM
> To: Pattan, Reshma <reshma.pattan@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v3] pdump: fix vdev cleanup
>
> 11/01/2019 18:51, Reshma Pattan:
> > Virtual devices added in pdump application using rte_eal_hotplug_add
> > should be removed explicitly while existing the pdump application,
> > otherwise the
>
> existing -> exiting ?
>
> > 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")
> > CC: stable@dpdk.org
> > CC: ferruh.yigit@intel.com
>
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v3] pdump: fix vdev cleanup
2019-01-15 10:09 ` Pattan, Reshma
@ 2019-01-15 10:10 ` Thomas Monjalon
2019-01-15 10:25 ` Pattan, Reshma
0 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2019-01-15 10:10 UTC (permalink / raw)
To: Pattan, Reshma; +Cc: dev, stable, Yigit, Ferruh
15/01/2019 11:09, Pattan, Reshma:
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > 11/01/2019 18:51, Reshma Pattan:
> > > Virtual devices added in pdump application using rte_eal_hotplug_add
> > > should be removed explicitly while existing the pdump application,
> > > otherwise the
> >
> > existing -> exiting ?
> >
> > > 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")
> > > CC: stable@dpdk.org
> > > CC: ferruh.yigit@intel.com
> >
> > 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?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v3] pdump: fix vdev cleanup
2019-01-15 10:10 ` Thomas Monjalon
@ 2019-01-15 10:25 ` Pattan, Reshma
2019-01-17 20:23 ` Thomas Monjalon
0 siblings, 1 reply; 10+ messages in thread
From: Pattan, Reshma @ 2019-01-15 10:25 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, stable, Yigit, Ferruh
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Tuesday, January 15, 2019 10:11 AM
> To: Pattan, Reshma <reshma.pattan@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v3] pdump: fix vdev cleanup
>
> 15/01/2019 11:09, Pattan, Reshma:
> > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > > 11/01/2019 18:51, Reshma Pattan:
> > > > Virtual devices added in pdump application using
> > > > rte_eal_hotplug_add should be removed explicitly while existing
> > > > the pdump application, otherwise the
> > >
> > > existing -> exiting ?
> > >
> > > > 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")
> > > > CC: stable@dpdk.org
> > > > CC: ferruh.yigit@intel.com
> > >
> > > 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH v4] pdump: fix vdev cleanup
2019-01-11 17:51 ` [dpdk-dev] [PATCH v3] " Reshma Pattan
2019-01-15 0:59 ` Thomas Monjalon
@ 2019-01-15 13:45 ` Reshma Pattan
2019-01-15 14:57 ` Ferruh Yigit
1 sibling, 1 reply; 10+ messages in thread
From: Reshma Pattan @ 2019-01-15 13:45 UTC (permalink / raw)
To: dev; +Cc: Reshma Pattan, stable, ferruh.yigit
Virtual 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.
Fixes: 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdev attach")
CC: stable@dpdk.org
CC: ferruh.yigit@intel.com
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
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(+)
diff --git a/app/pdump/main.c b/app/pdump/main.c
index 9e86bf623..5e183ea90 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -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();
}
--
2.17.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v4] pdump: fix vdev cleanup
2019-01-15 13:45 ` [dpdk-dev] [PATCH v4] " Reshma Pattan
@ 2019-01-15 14:57 ` Ferruh Yigit
2019-01-17 20:28 ` Thomas Monjalon
0 siblings, 1 reply; 10+ messages in thread
From: Ferruh Yigit @ 2019-01-15 14:57 UTC (permalink / raw)
To: Reshma Pattan, dev; +Cc: stable
On 1/15/2019 1:45 PM, Reshma Pattan wrote:
> Virtual 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.
>
> Fixes: 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdev attach")
> CC: stable@dpdk.org
> CC: ferruh.yigit@intel.com
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v3] pdump: fix vdev cleanup
2019-01-15 10:25 ` Pattan, Reshma
@ 2019-01-17 20:23 ` Thomas Monjalon
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2019-01-17 20:23 UTC (permalink / raw)
To: Pattan, Reshma; +Cc: dev, stable, Yigit, Ferruh
15/01/2019 11:25, Pattan, Reshma:
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > 15/01/2019 11:09, Pattan, Reshma:
> > > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > > > 11/01/2019 18:51, Reshma Pattan:
> > > > > Virtual devices added in pdump application using
> > > > > rte_eal_hotplug_add should be removed explicitly while existing
> > > > > the pdump application, otherwise the
> > > >
> > > > existing -> exiting ?
> > > >
> > > > > 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")
> > > > > CC: stable@dpdk.org
> > > > > CC: ferruh.yigit@intel.com
> > > >
> > > > 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.
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v4] pdump: fix vdev cleanup
2019-01-15 14:57 ` Ferruh Yigit
@ 2019-01-17 20:28 ` Thomas Monjalon
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2019-01-17 20:28 UTC (permalink / raw)
To: Reshma Pattan; +Cc: dev, Ferruh Yigit, stable
15/01/2019 15:57, Ferruh Yigit:
> On 1/15/2019 1:45 PM, Reshma Pattan wrote:
> > Virtual 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.
> >
> > Fixes: 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdev attach")
> > CC: stable@dpdk.org
> > CC: ferruh.yigit@intel.com
> >
> > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
>
> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2019-01-17 20:28 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11 17:41 [dpdk-dev] [PATCH v2] pdump: fix vdev cleanup Reshma Pattan
2019-01-11 17:51 ` [dpdk-dev] [PATCH v3] " Reshma Pattan
2019-01-15 0:59 ` Thomas Monjalon
2019-01-15 10:09 ` Pattan, Reshma
2019-01-15 10:10 ` Thomas Monjalon
2019-01-15 10:25 ` Pattan, Reshma
2019-01-17 20:23 ` Thomas Monjalon
2019-01-15 13:45 ` [dpdk-dev] [PATCH v4] " Reshma Pattan
2019-01-15 14:57 ` Ferruh Yigit
2019-01-17 20:28 ` Thomas Monjalon
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).