[PATCH v2 1/2] event/sw: fix missing device pointer

Bruce Richardson bruce.richardson at intel.com
Tue Oct 17 17:51:47 CEST 2023


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 rte_dev_name(info.dev).

The SW 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: aaa4a221da26 ("event/sw: add new software-only eventdev driver")
Cc: stable at dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Harry van Haaren <harry.van.haaren at intel.com>
---
 drivers/event/sw/sw_evdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index 6d1816b76d..bf166a8cfc 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -1080,6 +1080,7 @@ sw_probe(struct rte_vdev_device *vdev)
 		SW_LOG_ERR("eventdev vdev init() failed");
 		return -EFAULT;
 	}
+	dev->dev = &vdev->device;
 	dev->dev_ops = &evdev_sw_ops;
 	dev->enqueue = sw_event_enqueue;
 	dev->enqueue_burst = sw_event_enqueue_burst;
-- 
2.39.2



More information about the stable mailing list