patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] event/sw: fix missing device pointer
@ 2023-10-16 15:17 Bruce Richardson
  2023-10-17 12:45 ` Van Haaren, Harry
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Bruce Richardson @ 2023-10-16 15:17 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable, Harry van Haaren, Jerin Jacob

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 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@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@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


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

end of thread, other threads:[~2023-10-19  5:36 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-16 15:17 [PATCH] event/sw: fix missing device pointer Bruce Richardson
2023-10-17 12:45 ` Van Haaren, Harry
2023-10-17 15:51 ` [PATCH v2 1/2] " Bruce Richardson
2023-10-17 15:51   ` [PATCH v2 2/2] event/dsw: " Bruce Richardson
     [not found] ` <20231017164610.191852-1-bruce.richardson@intel.com>
2023-10-17 16:46   ` [PATCH v3 1/4] event/sw: " Bruce Richardson
2023-10-17 16:46   ` [PATCH v3 2/4] event/dsw: " Bruce Richardson
2023-10-18  6:27     ` Mattias Rönnblom
2023-10-17 16:46   ` [PATCH v3 3/4] event/skeleton: " Bruce Richardson
2023-10-17 16:46   ` [PATCH v3 4/4] event/skeleton: set driver name string Bruce Richardson
2023-10-18 12:25 ` [PATCH v4 1/2] event/*: set device pointer for vdev-based eventdevs Bruce Richardson
2023-10-18 12:25   ` [PATCH v4 2/2] event/skeleton: set driver name string Bruce Richardson
2023-10-18 12:44     ` David Marchand
2023-10-18 12:52       ` Bruce Richardson
2023-10-18 13:42         ` Bruce Richardson
2023-10-18 13:01   ` [PATCH v4 1/2] event/*: set device pointer for vdev-based eventdevs David Marchand
2023-10-18 13:39 ` [PATCH v5 1/2] eventdev: fix " Bruce Richardson
2023-10-18 13:39   ` [PATCH v5 2/2] eventdev: fix missing driver names in info struct Bruce Richardson
2023-10-19  5:35     ` Jerin Jacob

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