DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] ethdev: fix push new event
@ 2022-05-21  6:55 Min Hu (Connor)
  2022-05-23  9:51 ` David Marchand
  0 siblings, 1 reply; 14+ messages in thread
From: Min Hu (Connor) @ 2022-05-21  6:55 UTC (permalink / raw)
  To: dev
  Cc: Huisong Li, stable, Min Hu, Thomas Monjalon, Ferruh Yigit,
	Andrew Rybchenko, Bruce Richardson

From: Huisong Li <lihuisong@huawei.com>

The 'state' in struct rte_eth_dev may be used to update some information
when app receive these events. For example, when app receives a new event,
app may get the socket id of this port by calling rte_eth_dev_socket_id to
setup the attached port. The 'state' is used in rte_eth_dev_socket_id.

If the state isn't modified to RTE_ETH_DEV_ATTACHED before pushing the new
event, app will get the socket id failed. So this patch moves pushing event
operation after the state updated.

Fixes: 99a2dd955fba ("lib: remove librte_ prefix from directory names")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 lib/ethdev/rte_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index cea2f0b498..f555647c7a 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -4816,9 +4816,8 @@ rte_eth_dev_probing_finish(struct rte_eth_dev *dev)
 	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
 		eth_dev_fp_ops_setup(rte_eth_fp_ops + dev->data->port_id, dev);
 
-	rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_NEW, NULL);
-
 	dev->state = RTE_ETH_DEV_ATTACHED;
+	rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_NEW, NULL);
 }
 
 int
-- 
2.33.0


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

end of thread, other threads:[~2022-10-08  4:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-21  6:55 [PATCH] ethdev: fix push new event Min Hu (Connor)
2022-05-23  9:51 ` David Marchand
2022-05-23 12:33   ` Ferruh Yigit
2022-05-23 14:36   ` Thomas Monjalon
2022-05-28  8:53     ` lihuisong (C)
2022-05-30  8:28       ` Thomas Monjalon
2022-05-30 11:10         ` Ferruh Yigit
2022-06-02 11:24           ` lihuisong (C)
2022-06-03  7:42             ` Thomas Monjalon
2022-06-07  1:23               ` lihuisong (C)
2022-06-07  6:44                 ` Thomas Monjalon
2022-06-11  8:59                   ` lihuisong (C)
2022-09-27 10:29                     ` Thomas Monjalon
2022-10-08  4:06                       ` lihuisong (C)

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