DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: filter destroy event before probed
@ 2018-10-24 13:12 Thomas Monjalon
  2018-10-25 12:38 ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2018-10-24 13:12 UTC (permalink / raw)
  To: Ferruh Yigit, Andrew Rybchenko; +Cc: dev

If a port is being created and rollbacked because of an error,
the event RTE_ETH_EVENT_DESTROY should not be sent.
It makes no sense to receive a destroy event for a port which
was not yet announced via RTE_ETH_EVENT_NEW.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_ethdev/rte_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 1c04f95ea..9c7d82575 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -512,7 +512,9 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)
 
 	rte_eth_dev_shared_data_prepare();
 
-	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_DESTROY, NULL);
+	if (eth_dev->state != RTE_ETH_DEV_UNUSED)
+		_rte_eth_dev_callback_process(eth_dev,
+				RTE_ETH_EVENT_DESTROY, NULL);
 
 	rte_spinlock_lock(&rte_eth_dev_shared_data->ownership_lock);
 
-- 
2.19.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: filter destroy event before probed
  2018-10-24 13:12 [dpdk-dev] [PATCH] ethdev: filter destroy event before probed Thomas Monjalon
@ 2018-10-25 12:38 ` Ferruh Yigit
  2018-10-25 12:47   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2018-10-25 12:38 UTC (permalink / raw)
  To: Thomas Monjalon, Andrew Rybchenko; +Cc: dev

On 10/24/2018 2:12 PM, Thomas Monjalon wrote:
> If a port is being created and rollbacked because of an error,
> the event RTE_ETH_EVENT_DESTROY should not be sent.
> It makes no sense to receive a destroy event for a port which
> was not yet announced via RTE_ETH_EVENT_NEW.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: filter destroy event before probed
  2018-10-25 12:38 ` Ferruh Yigit
@ 2018-10-25 12:47   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-10-25 12:47 UTC (permalink / raw)
  To: Thomas Monjalon, Andrew Rybchenko; +Cc: dev

On 10/25/2018 1:38 PM, Ferruh Yigit wrote:
> On 10/24/2018 2:12 PM, Thomas Monjalon wrote:
>> If a port is being created and rollbacked because of an error,
>> the event RTE_ETH_EVENT_DESTROY should not be sent.
>> It makes no sense to receive a destroy event for a port which
>> was not yet announced via RTE_ETH_EVENT_NEW.
>>
>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-25 12:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-24 13:12 [dpdk-dev] [PATCH] ethdev: filter destroy event before probed Thomas Monjalon
2018-10-25 12:38 ` Ferruh Yigit
2018-10-25 12:47   ` Ferruh Yigit

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).