DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] event/dsw: fix missing device pointer
@ 2023-10-17 15:45 Bruce Richardson
  2023-10-17 15:55 ` Bruce Richardson
  2023-10-17 16:04 ` Jerin Jacob
  0 siblings, 2 replies; 10+ messages in thread
From: Bruce Richardson @ 2023-10-17 15:45 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, mattias.ronnblom

After calling rte_event_dev_info_get() the ".dev" field of the info
structure should have a pointer to the underlying device, allowing the
user to e.g. get the device name using using rte_dev_name(info.dev).

The distributed software eventdev info structure did not return a
correct device pointer, though, instead returning NULL, which caused
crashes getting "rte_dev_name". Initializing the dev pointer inside the
"eventdev" struct in the device probe function fixes this by ensuring we
have a valid pointer to return in info_get calls.

Fixes: 46a186b1f0c5 ("event/dsw: add device registration and build system")
Cc: mattias.ronnblom@ericsson.com

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/event/dsw/dsw_evdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/event/dsw/dsw_evdev.c b/drivers/event/dsw/dsw_evdev.c
index 785c12f61f..44da3c60d1 100644
--- a/drivers/event/dsw/dsw_evdev.c
+++ b/drivers/event/dsw/dsw_evdev.c
@@ -440,6 +440,7 @@ dsw_probe(struct rte_vdev_device *vdev)
 		return -EFAULT;
 
 	dev->dev_ops = &dsw_evdev_ops;
+	dev->dev = &vdev->device;
 	dev->enqueue = dsw_event_enqueue;
 	dev->enqueue_burst = dsw_event_enqueue_burst;
 	dev->enqueue_new_burst = dsw_event_enqueue_new_burst;
-- 
2.39.2


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

end of thread, other threads:[~2023-10-18 12:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-17 15:45 [PATCH] event/dsw: fix missing device pointer Bruce Richardson
2023-10-17 15:55 ` Bruce Richardson
2023-10-17 16:04 ` Jerin Jacob
2023-10-17 16:11   ` David Marchand
2023-10-17 16:15   ` Bruce Richardson
2023-10-17 16:51     ` Jerin Jacob
2023-10-18  5:18       ` Jerin Jacob
2023-10-18  6:29         ` Mattias Rönnblom
2023-10-18  9:45         ` Bruce Richardson
2023-10-18 12:13         ` Bruce Richardson

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