* RE: [PATCH] event/sw: fix missing device pointer
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
` (3 subsequent siblings)
4 siblings, 0 replies; 18+ messages in thread
From: Van Haaren, Harry @ 2023-10-17 12:45 UTC (permalink / raw)
To: Richardson, Bruce, dev; +Cc: stable, Jerin Jacob
> -----Original Message-----
> From: Richardson, Bruce <bruce.richardson@intel.com>
> Sent: Monday, October 16, 2023 4:17 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; stable@dpdk.org; Van
> Haaren, Harry <harry.van.haaren@intel.com>; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>
> Subject: [PATCH] event/sw: fix missing device pointer
>
> 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>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v2 1/2] event/sw: fix missing device pointer
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 ` Bruce Richardson
2023-10-17 15:51 ` [PATCH v2 2/2] event/dsw: " Bruce Richardson
[not found] ` <20231017164610.191852-1-bruce.richardson@intel.com>
` (2 subsequent siblings)
4 siblings, 1 reply; 18+ messages in thread
From: Bruce Richardson @ 2023-10-17 15:51 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, stable, Harry van Haaren
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@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@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
* [PATCH v2 2/2] event/dsw: fix missing device pointer
2023-10-17 15:51 ` [PATCH v2 1/2] " Bruce Richardson
@ 2023-10-17 15:51 ` Bruce Richardson
0 siblings, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2023-10-17 15:51 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, mattias.ronnblom, stable
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 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
Cc: stable@dpdk.org
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] 18+ messages in thread
[parent not found: <20231017164610.191852-1-bruce.richardson@intel.com>]
* [PATCH v3 1/4] event/sw: fix missing device pointer
[not found] ` <20231017164610.191852-1-bruce.richardson@intel.com>
@ 2023-10-17 16:46 ` Bruce Richardson
2023-10-17 16:46 ` [PATCH v3 2/4] event/dsw: " Bruce Richardson
` (2 subsequent siblings)
3 siblings, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2023-10-17 16:46 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, stable, Harry van Haaren, Jerin Jacob
Initialize the "dev" pointer in the eventdev structure so it can be
returned in calls to "rte_event_dev_info_get()" and avoid potential
crashes due to a NULL value being passed to "rte_dev_name()"
Fixes: aaa4a221da26 ("event/sw: add new software-only eventdev driver")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@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
* [PATCH v3 2/4] event/dsw: fix missing device pointer
[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 ` 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
3 siblings, 1 reply; 18+ messages in thread
From: Bruce Richardson @ 2023-10-17 16:46 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, mattias.ronnblom, stable, Jerin Jacob
Initialize the "dev" pointer in the eventdev structure so it can be
returned in calls to "rte_event_dev_info_get()" and avoid potential
crashes due to a NULL value being passed to "rte_dev_name()"
Fixes: 46a186b1f0c5 ("event/dsw: add device registration and build system")
Cc: mattias.ronnblom@ericsson.com
Cc: stable@dpdk.org
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] 18+ messages in thread
* Re: [PATCH v3 2/4] event/dsw: fix missing device pointer
2023-10-17 16:46 ` [PATCH v3 2/4] event/dsw: " Bruce Richardson
@ 2023-10-18 6:27 ` Mattias Rönnblom
0 siblings, 0 replies; 18+ messages in thread
From: Mattias Rönnblom @ 2023-10-18 6:27 UTC (permalink / raw)
To: Bruce Richardson, dev; +Cc: mattias.ronnblom, stable, Jerin Jacob
On 2023-10-17 18:46, Bruce Richardson wrote:
> Initialize the "dev" pointer in the eventdev structure so it can be
> returned in calls to "rte_event_dev_info_get()" and avoid potential
> crashes due to a NULL value being passed to "rte_dev_name()"
>
> Fixes: 46a186b1f0c5 ("event/dsw: add device registration and build system")
> Cc: mattias.ronnblom@ericsson.com
> Cc: stable@dpdk.org
>
> 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;
Acked-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v3 3/4] event/skeleton: fix missing device pointer
[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-17 16:46 ` Bruce Richardson
2023-10-17 16:46 ` [PATCH v3 4/4] event/skeleton: set driver name string Bruce Richardson
3 siblings, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2023-10-17 16:46 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, stable, Jerin Jacob
Initialize the "dev" pointer in the eventdev structure so it can be
returned in calls to "rte_event_dev_info_get()" and avoid potential
crashes due to a NULL value being passed to "rte_dev_name()"
Fixes: bbbb929da5e6 ("event/skeleton: add skeleton eventdev driver")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/event/skeleton/skeleton_eventdev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c
index dc9b131641..3aa6657f39 100644
--- a/drivers/event/skeleton/skeleton_eventdev.c
+++ b/drivers/event/skeleton/skeleton_eventdev.c
@@ -428,7 +428,7 @@ RTE_PMD_REGISTER_PCI_TABLE(event_skeleton_pci, pci_id_skeleton_map);
/* VDEV based event device */
static int
-skeleton_eventdev_create(const char *name, int socket_id)
+skeleton_eventdev_create(const char *name, int socket_id, struct rte_vdev_device *vdev)
{
struct rte_eventdev *eventdev;
@@ -440,6 +440,7 @@ skeleton_eventdev_create(const char *name, int socket_id)
}
eventdev->dev_ops = &skeleton_eventdev_ops;
+ eventdev->dev = &vdev->device;
eventdev->enqueue = skeleton_eventdev_enqueue;
eventdev->enqueue_burst = skeleton_eventdev_enqueue_burst;
eventdev->dequeue = skeleton_eventdev_dequeue;
@@ -459,7 +460,7 @@ skeleton_eventdev_probe(struct rte_vdev_device *vdev)
name = rte_vdev_device_name(vdev);
RTE_LOG(INFO, PMD, "Initializing %s on NUMA node %d\n", name,
rte_socket_id());
- return skeleton_eventdev_create(name, rte_socket_id());
+ return skeleton_eventdev_create(name, rte_socket_id(), vdev);
}
static int
--
2.39.2
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v3 4/4] event/skeleton: set driver name string
[not found] ` <20231017164610.191852-1-bruce.richardson@intel.com>
` (2 preceding siblings ...)
2023-10-17 16:46 ` [PATCH v3 3/4] event/skeleton: " Bruce Richardson
@ 2023-10-17 16:46 ` Bruce Richardson
3 siblings, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2023-10-17 16:46 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, stable, Jerin Jacob
When calling rte_eventdev_info_get() the driver name string field should
be populated.
Fixes: bbbb929da5e6 ("event/skeleton: add skeleton eventdev driver")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/event/skeleton/skeleton_eventdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c
index 3aa6657f39..ccceae22ad 100644
--- a/drivers/event/skeleton/skeleton_eventdev.c
+++ b/drivers/event/skeleton/skeleton_eventdev.c
@@ -24,6 +24,7 @@
#define EVENTDEV_NAME_SKELETON_PMD event_skeleton
/**< Skeleton event device PMD name */
+#define EVENTDEV_NAME_STRING RTE_STR(EVENTDEV_NAME_SKELETON_PMD)
static uint16_t
skeleton_eventdev_enqueue(void *port, const struct rte_event *ev)
@@ -88,6 +89,7 @@ skeleton_eventdev_info_get(struct rte_eventdev *dev,
RTE_SET_USED(skel);
+ dev_info->driver_name = EVENTDEV_NAME_STRING;
dev_info->min_dequeue_timeout_ns = 1;
dev_info->max_dequeue_timeout_ns = 10000;
dev_info->dequeue_timeout_ns = 25;
--
2.39.2
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v4 1/2] event/*: set device pointer for vdev-based eventdevs
2023-10-16 15:17 [PATCH] event/sw: fix missing device pointer Bruce Richardson
` (2 preceding siblings ...)
[not found] ` <20231017164610.191852-1-bruce.richardson@intel.com>
@ 2023-10-18 12:25 ` Bruce Richardson
2023-10-18 12:25 ` [PATCH v4 2/2] event/skeleton: set driver name string 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
4 siblings, 2 replies; 18+ messages in thread
From: Bruce Richardson @ 2023-10-18 12:25 UTC (permalink / raw)
To: dev
Cc: Bruce Richardson, stable, Hemant Agrawal, Sachin Saxena,
Mattias Rönnblom, Jerin Jacob, Liang Ma, Peter Mccarthy,
Harry van Haaren, Nipun Gupta, Santosh Shukla, Gage Eads
The eventdevs based on vdevs, rather than on e.g. HW PCI devices, were,
as a rule, not setting the ".dev" pointer in the eventdev structure.
This caused issues as a NULL pointer was returned in calls to info_get,
triggering crashes if the pointer is passed unchecked to e.g.
rte_dev_name() to print out the name of an event device.
Most effective, and future-proofed fix, is to not rely on the eventdev
drivers to set the pointer themselves, but to change the vdev init
function to take the vdev struct as parameter, and set the "dev" pointer
centrally on init. This allows us to fix all drivers in one go, enforced
by compiler error if the parameter is missing.
Fixes: aaa4a221da26 ("event/sw: add new software-only eventdev driver")
Fixes: 46a186b1f0c5 ("event/dsw: add device registration and build system")
Fixes: bbbb929da5e6 ("event/skeleton: add skeleton eventdev driver")
Fixes: 3c7f3dcfb099 ("event/opdl: add PMD main body and helper function")
Fixes: 9caac5dd1e7f ("event/dpaa: introduce PMD")
Fixes: 8a5d7a8ec74b ("event/dpaa2: initialize device")
Fixes: 34498de6000f ("event/octeontx: add octeontx eventdev driver")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/event/dpaa/dpaa_eventdev.c | 6 +++---
drivers/event/dpaa2/dpaa2_eventdev.c | 6 +++---
drivers/event/dsw/dsw_evdev.c | 2 +-
drivers/event/octeontx/ssovf_evdev.c | 2 +-
drivers/event/opdl/opdl_evdev.c | 2 +-
drivers/event/skeleton/skeleton_eventdev.c | 6 +++---
drivers/event/sw/sw_evdev.c | 2 +-
lib/eventdev/eventdev_pmd_vdev.h | 3 ++-
8 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c
index f615da3813..46a9b88c73 100644
--- a/drivers/event/dpaa/dpaa_eventdev.c
+++ b/drivers/event/dpaa/dpaa_eventdev.c
@@ -994,14 +994,14 @@ dpaa_event_check_flags(const char *params)
}
static int
-dpaa_event_dev_create(const char *name, const char *params)
+dpaa_event_dev_create(const char *name, const char *params, struct rte_vdev_device *vdev)
{
struct rte_eventdev *eventdev;
struct dpaa_eventdev *priv;
eventdev = rte_event_pmd_vdev_init(name,
sizeof(struct dpaa_eventdev),
- rte_socket_id());
+ rte_socket_id(), vdev);
if (eventdev == NULL) {
DPAA_EVENTDEV_ERR("Failed to create eventdev vdev %s", name);
goto fail;
@@ -1051,7 +1051,7 @@ dpaa_event_dev_probe(struct rte_vdev_device *vdev)
params = rte_vdev_device_args(vdev);
- return dpaa_event_dev_create(name, params);
+ return dpaa_event_dev_create(name, params, vdev);
}
static int
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index ffc5550f85..dd4e64395f 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -1086,7 +1086,7 @@ dpaa2_eventdev_setup_dpci(struct dpaa2_dpci_dev *dpci_dev,
}
static int
-dpaa2_eventdev_create(const char *name)
+dpaa2_eventdev_create(const char *name, struct rte_vdev_device *vdev)
{
struct rte_eventdev *eventdev;
struct dpaa2_eventdev *priv;
@@ -1096,7 +1096,7 @@ dpaa2_eventdev_create(const char *name)
eventdev = rte_event_pmd_vdev_init(name,
sizeof(struct dpaa2_eventdev),
- rte_socket_id());
+ rte_socket_id(), vdev);
if (eventdev == NULL) {
DPAA2_EVENTDEV_ERR("Failed to create Event device %s", name);
goto fail;
@@ -1190,7 +1190,7 @@ dpaa2_eventdev_probe(struct rte_vdev_device *vdev)
name = rte_vdev_device_name(vdev);
DPAA2_EVENTDEV_INFO("Initializing %s", name);
- return dpaa2_eventdev_create(name);
+ return dpaa2_eventdev_create(name, vdev);
}
static int
diff --git a/drivers/event/dsw/dsw_evdev.c b/drivers/event/dsw/dsw_evdev.c
index 785c12f61f..1209e73a9d 100644
--- a/drivers/event/dsw/dsw_evdev.c
+++ b/drivers/event/dsw/dsw_evdev.c
@@ -435,7 +435,7 @@ dsw_probe(struct rte_vdev_device *vdev)
name = rte_vdev_device_name(vdev);
dev = rte_event_pmd_vdev_init(name, sizeof(struct dsw_evdev),
- rte_socket_id());
+ rte_socket_id(), vdev);
if (dev == NULL)
return -EFAULT;
diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c
index 0eb9358981..a16f24e088 100644
--- a/drivers/event/octeontx/ssovf_evdev.c
+++ b/drivers/event/octeontx/ssovf_evdev.c
@@ -880,7 +880,7 @@ ssovf_vdev_probe(struct rte_vdev_device *vdev)
}
eventdev = rte_event_pmd_vdev_init(name, sizeof(struct ssovf_evdev),
- rte_socket_id());
+ rte_socket_id(), vdev);
if (eventdev == NULL) {
ssovf_log_err("Failed to create eventdev vdev %s", name);
return -ENOMEM;
diff --git a/drivers/event/opdl/opdl_evdev.c b/drivers/event/opdl/opdl_evdev.c
index dd25749654..0cccaf7e97 100644
--- a/drivers/event/opdl/opdl_evdev.c
+++ b/drivers/event/opdl/opdl_evdev.c
@@ -697,7 +697,7 @@ opdl_probe(struct rte_vdev_device *vdev)
}
}
dev = rte_event_pmd_vdev_init(name,
- sizeof(struct opdl_evdev), socket_id);
+ sizeof(struct opdl_evdev), socket_id, vdev);
if (dev == NULL) {
PMD_DRV_LOG(ERR, "eventdev vdev init() failed");
diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c
index dc9b131641..7db1efaf14 100644
--- a/drivers/event/skeleton/skeleton_eventdev.c
+++ b/drivers/event/skeleton/skeleton_eventdev.c
@@ -428,12 +428,12 @@ RTE_PMD_REGISTER_PCI_TABLE(event_skeleton_pci, pci_id_skeleton_map);
/* VDEV based event device */
static int
-skeleton_eventdev_create(const char *name, int socket_id)
+skeleton_eventdev_create(const char *name, int socket_id, struct rte_vdev_device *vdev)
{
struct rte_eventdev *eventdev;
eventdev = rte_event_pmd_vdev_init(name,
- sizeof(struct skeleton_eventdev), socket_id);
+ sizeof(struct skeleton_eventdev), socket_id, vdev);
if (eventdev == NULL) {
PMD_DRV_ERR("Failed to create eventdev vdev %s", name);
goto fail;
@@ -459,7 +459,7 @@ skeleton_eventdev_probe(struct rte_vdev_device *vdev)
name = rte_vdev_device_name(vdev);
RTE_LOG(INFO, PMD, "Initializing %s on NUMA node %d\n", name,
rte_socket_id());
- return skeleton_eventdev_create(name, rte_socket_id());
+ return skeleton_eventdev_create(name, rte_socket_id(), vdev);
}
static int
diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index 6d1816b76d..55e7735cb0 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -1075,7 +1075,7 @@ sw_probe(struct rte_vdev_device *vdev)
min_burst_size, deq_burst_size, refill_once);
dev = rte_event_pmd_vdev_init(name,
- sizeof(struct sw_evdev), socket_id);
+ sizeof(struct sw_evdev), socket_id, vdev);
if (dev == NULL) {
SW_LOG_ERR("eventdev vdev init() failed");
return -EFAULT;
diff --git a/lib/eventdev/eventdev_pmd_vdev.h b/lib/eventdev/eventdev_pmd_vdev.h
index 5fa9d699ac..bb433ba955 100644
--- a/lib/eventdev/eventdev_pmd_vdev.h
+++ b/lib/eventdev/eventdev_pmd_vdev.h
@@ -45,7 +45,7 @@ extern "C" {
__rte_internal
static inline struct rte_eventdev *
rte_event_pmd_vdev_init(const char *name, size_t dev_private_size,
- int socket_id)
+ int socket_id, struct rte_vdev_device *vdev)
{
struct rte_eventdev *eventdev;
@@ -67,6 +67,7 @@ rte_event_pmd_vdev_init(const char *name, size_t dev_private_size,
rte_panic("Cannot allocate memzone for private device"
" data");
}
+ eventdev->dev = &vdev->device;
return eventdev;
}
--
2.39.2
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v4 2/2] event/skeleton: set driver name string
2023-10-18 12:25 ` [PATCH v4 1/2] event/*: set device pointer for vdev-based eventdevs Bruce Richardson
@ 2023-10-18 12:25 ` Bruce Richardson
2023-10-18 12:44 ` David Marchand
2023-10-18 13:01 ` [PATCH v4 1/2] event/*: set device pointer for vdev-based eventdevs David Marchand
1 sibling, 1 reply; 18+ messages in thread
From: Bruce Richardson @ 2023-10-18 12:25 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, stable, Jerin Jacob
When calling rte_eventdev_info_get() the driver name string field should
be populated.
Fixes: bbbb929da5e6 ("event/skeleton: add skeleton eventdev driver")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/event/skeleton/skeleton_eventdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c
index 7db1efaf14..6afb5de824 100644
--- a/drivers/event/skeleton/skeleton_eventdev.c
+++ b/drivers/event/skeleton/skeleton_eventdev.c
@@ -24,6 +24,7 @@
#define EVENTDEV_NAME_SKELETON_PMD event_skeleton
/**< Skeleton event device PMD name */
+#define EVENTDEV_NAME_STRING RTE_STR(EVENTDEV_NAME_SKELETON_PMD)
static uint16_t
skeleton_eventdev_enqueue(void *port, const struct rte_event *ev)
@@ -88,6 +89,7 @@ skeleton_eventdev_info_get(struct rte_eventdev *dev,
RTE_SET_USED(skel);
+ dev_info->driver_name = EVENTDEV_NAME_STRING;
dev_info->min_dequeue_timeout_ns = 1;
dev_info->max_dequeue_timeout_ns = 10000;
dev_info->dequeue_timeout_ns = 25;
--
2.39.2
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v4 2/2] event/skeleton: set driver name string
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
0 siblings, 1 reply; 18+ messages in thread
From: David Marchand @ 2023-10-18 12:44 UTC (permalink / raw)
To: Bruce Richardson, Jerin Jacob; +Cc: dev, stable
On Wed, Oct 18, 2023 at 2:26 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> When calling rte_eventdev_info_get() the driver name string field should
> be populated.
>
> Fixes: bbbb929da5e6 ("event/skeleton: add skeleton eventdev driver")
> Cc: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
event/dpaa2 seems affected too.
Can rte_eventdev_info_get() fill this based on the driver attached to
the device, like ethdev does?
Something like untested:
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 95373bbaad..37ccc0dc77 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -104,6 +104,7 @@ rte_event_dev_info_get(uint8_t dev_id, struct
rte_event_dev_info *dev_info)
dev_info->dequeue_timeout_ns = dev->data->dev_conf.dequeue_timeout_ns;
dev_info->dev = dev->dev;
+ dev_info->driver_name = dev->dev->driver->name;
rte_eventdev_trace_info_get(dev_id, dev_info, dev_info->dev);
--
David Marchand
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v4 2/2] event/skeleton: set driver name string
2023-10-18 12:44 ` David Marchand
@ 2023-10-18 12:52 ` Bruce Richardson
2023-10-18 13:42 ` Bruce Richardson
0 siblings, 1 reply; 18+ messages in thread
From: Bruce Richardson @ 2023-10-18 12:52 UTC (permalink / raw)
To: David Marchand; +Cc: Jerin Jacob, dev, stable
On Wed, Oct 18, 2023 at 02:44:11PM +0200, David Marchand wrote:
> On Wed, Oct 18, 2023 at 2:26 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > When calling rte_eventdev_info_get() the driver name string field should
> > be populated.
> >
> > Fixes: bbbb929da5e6 ("event/skeleton: add skeleton eventdev driver")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
>
> event/dpaa2 seems affected too.
>
Ok, hadn't noticed that. I tested all the SW drivers I could and didn't
find any of them affected.
> Can rte_eventdev_info_get() fill this based on the driver attached to
> the device, like ethdev does?
>
> Something like untested:
>
> diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
> index 95373bbaad..37ccc0dc77 100644
> --- a/lib/eventdev/rte_eventdev.c
> +++ b/lib/eventdev/rte_eventdev.c
> @@ -104,6 +104,7 @@ rte_event_dev_info_get(uint8_t dev_id, struct
> rte_event_dev_info *dev_info)
> dev_info->dequeue_timeout_ns = dev->data->dev_conf.dequeue_timeout_ns;
>
> dev_info->dev = dev->dev;
> + dev_info->driver_name = dev->dev->driver->name;
>
> rte_eventdev_trace_info_get(dev_id, dev_info, dev_info->dev);
>
Ok, let me do up and test a patch.
/Bruce
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v4 2/2] event/skeleton: set driver name string
2023-10-18 12:52 ` Bruce Richardson
@ 2023-10-18 13:42 ` Bruce Richardson
0 siblings, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2023-10-18 13:42 UTC (permalink / raw)
To: David Marchand; +Cc: Jerin Jacob, dev, stable
On Wed, Oct 18, 2023 at 01:52:08PM +0100, Bruce Richardson wrote:
> On Wed, Oct 18, 2023 at 02:44:11PM +0200, David Marchand wrote:
> > On Wed, Oct 18, 2023 at 2:26 PM Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > >
> > > When calling rte_eventdev_info_get() the driver name string field should
> > > be populated.
> > >
> > > Fixes: bbbb929da5e6 ("event/skeleton: add skeleton eventdev driver")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> >
> > event/dpaa2 seems affected too.
> >
>
> Ok, hadn't noticed that. I tested all the SW drivers I could and didn't
> find any of them affected.
>
> > Can rte_eventdev_info_get() fill this based on the driver attached to
> > the device, like ethdev does?
> >
> > Something like untested:
> >
> > diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
> > index 95373bbaad..37ccc0dc77 100644
> > --- a/lib/eventdev/rte_eventdev.c
> > +++ b/lib/eventdev/rte_eventdev.c
> > @@ -104,6 +104,7 @@ rte_event_dev_info_get(uint8_t dev_id, struct
> > rte_event_dev_info *dev_info)
> > dev_info->dequeue_timeout_ns = dev->data->dev_conf.dequeue_timeout_ns;
> >
> > dev_info->dev = dev->dev;
> > + dev_info->driver_name = dev->dev->driver->name;
> >
> > rte_eventdev_trace_info_get(dev_id, dev_info, dev_info->dev);
> >
> Ok, let me do up and test a patch.
>
V5 sent with this fix instead. I just added some additional conditionals
around it, just in case we end up with some Null pointers in that chain
(hopefully not after the previous patch, but better to check).
Testing with skeleton, sw, dsw and opdl drivers showed no issues with
reporting the driver name.
/Bruce
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v4 1/2] event/*: set device pointer for vdev-based eventdevs
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 13:01 ` David Marchand
1 sibling, 0 replies; 18+ messages in thread
From: David Marchand @ 2023-10-18 13:01 UTC (permalink / raw)
To: Bruce Richardson
Cc: dev, stable, Hemant Agrawal, Sachin Saxena,
Mattias Rönnblom, Jerin Jacob, Liang Ma, Peter Mccarthy,
Harry van Haaren, Nipun Gupta, Santosh Shukla, Gage Eads
On Wed, Oct 18, 2023 at 2:26 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> The eventdevs based on vdevs, rather than on e.g. HW PCI devices, were,
> as a rule, not setting the ".dev" pointer in the eventdev structure.
> This caused issues as a NULL pointer was returned in calls to info_get,
> triggering crashes if the pointer is passed unchecked to e.g.
> rte_dev_name() to print out the name of an event device.
>
> Most effective, and future-proofed fix, is to not rely on the eventdev
> drivers to set the pointer themselves, but to change the vdev init
> function to take the vdev struct as parameter, and set the "dev" pointer
> centrally on init. This allows us to fix all drivers in one go, enforced
> by compiler error if the parameter is missing.
>
> Fixes: aaa4a221da26 ("event/sw: add new software-only eventdev driver")
> Fixes: 46a186b1f0c5 ("event/dsw: add device registration and build system")
> Fixes: bbbb929da5e6 ("event/skeleton: add skeleton eventdev driver")
> Fixes: 3c7f3dcfb099 ("event/opdl: add PMD main body and helper function")
> Fixes: 9caac5dd1e7f ("event/dpaa: introduce PMD")
> Fixes: 8a5d7a8ec74b ("event/dpaa2: initialize device")
> Fixes: 34498de6000f ("event/octeontx: add octeontx eventdev driver")
> Cc: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
--
David Marchand
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v5 1/2] eventdev: fix device pointer for vdev-based eventdevs
2023-10-16 15:17 [PATCH] event/sw: fix missing device pointer Bruce Richardson
` (3 preceding siblings ...)
2023-10-18 12:25 ` [PATCH v4 1/2] event/*: set device pointer for vdev-based eventdevs Bruce Richardson
@ 2023-10-18 13:39 ` Bruce Richardson
2023-10-18 13:39 ` [PATCH v5 2/2] eventdev: fix missing driver names in info struct Bruce Richardson
4 siblings, 1 reply; 18+ messages in thread
From: Bruce Richardson @ 2023-10-18 13:39 UTC (permalink / raw)
To: dev; +Cc: Jerin Jacob, David Marchand, Bruce Richardson, stable
The eventdevs based on vdevs, rather than on e.g. HW PCI devices, were,
as a rule, not setting the ".dev" pointer in the eventdev structure.
This caused issues as a NULL pointer was returned in calls to info_get,
triggering crashes if the pointer is passed unchecked to e.g.
rte_dev_name() to print out the name of an event device.
Most effective, and future-proofed fix, is to not rely on the eventdev
drivers to set the pointer themselves, but to change the vdev init
function to take the vdev struct as parameter, and set the "dev" pointer
centrally on init. This allows us to fix all drivers in one go, enforced
by compiler error if the parameter is missing.
Fixes: aaa4a221da26 ("event/sw: add new software-only eventdev driver")
Fixes: 46a186b1f0c5 ("event/dsw: add device registration and build system")
Fixes: bbbb929da5e6 ("event/skeleton: add skeleton eventdev driver")
Fixes: 3c7f3dcfb099 ("event/opdl: add PMD main body and helper function")
Fixes: 9caac5dd1e7f ("event/dpaa: introduce PMD")
Fixes: 8a5d7a8ec74b ("event/dpaa2: initialize device")
Fixes: 34498de6000f ("event/octeontx: add octeontx eventdev driver")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
---
drivers/event/dpaa/dpaa_eventdev.c | 6 +++---
drivers/event/dpaa2/dpaa2_eventdev.c | 6 +++---
drivers/event/dsw/dsw_evdev.c | 2 +-
drivers/event/octeontx/ssovf_evdev.c | 2 +-
drivers/event/opdl/opdl_evdev.c | 2 +-
drivers/event/skeleton/skeleton_eventdev.c | 6 +++---
drivers/event/sw/sw_evdev.c | 2 +-
lib/eventdev/eventdev_pmd_vdev.h | 3 ++-
8 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c
index f615da3813..46a9b88c73 100644
--- a/drivers/event/dpaa/dpaa_eventdev.c
+++ b/drivers/event/dpaa/dpaa_eventdev.c
@@ -994,14 +994,14 @@ dpaa_event_check_flags(const char *params)
}
static int
-dpaa_event_dev_create(const char *name, const char *params)
+dpaa_event_dev_create(const char *name, const char *params, struct rte_vdev_device *vdev)
{
struct rte_eventdev *eventdev;
struct dpaa_eventdev *priv;
eventdev = rte_event_pmd_vdev_init(name,
sizeof(struct dpaa_eventdev),
- rte_socket_id());
+ rte_socket_id(), vdev);
if (eventdev == NULL) {
DPAA_EVENTDEV_ERR("Failed to create eventdev vdev %s", name);
goto fail;
@@ -1051,7 +1051,7 @@ dpaa_event_dev_probe(struct rte_vdev_device *vdev)
params = rte_vdev_device_args(vdev);
- return dpaa_event_dev_create(name, params);
+ return dpaa_event_dev_create(name, params, vdev);
}
static int
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index ffc5550f85..dd4e64395f 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -1086,7 +1086,7 @@ dpaa2_eventdev_setup_dpci(struct dpaa2_dpci_dev *dpci_dev,
}
static int
-dpaa2_eventdev_create(const char *name)
+dpaa2_eventdev_create(const char *name, struct rte_vdev_device *vdev)
{
struct rte_eventdev *eventdev;
struct dpaa2_eventdev *priv;
@@ -1096,7 +1096,7 @@ dpaa2_eventdev_create(const char *name)
eventdev = rte_event_pmd_vdev_init(name,
sizeof(struct dpaa2_eventdev),
- rte_socket_id());
+ rte_socket_id(), vdev);
if (eventdev == NULL) {
DPAA2_EVENTDEV_ERR("Failed to create Event device %s", name);
goto fail;
@@ -1190,7 +1190,7 @@ dpaa2_eventdev_probe(struct rte_vdev_device *vdev)
name = rte_vdev_device_name(vdev);
DPAA2_EVENTDEV_INFO("Initializing %s", name);
- return dpaa2_eventdev_create(name);
+ return dpaa2_eventdev_create(name, vdev);
}
static int
diff --git a/drivers/event/dsw/dsw_evdev.c b/drivers/event/dsw/dsw_evdev.c
index 785c12f61f..1209e73a9d 100644
--- a/drivers/event/dsw/dsw_evdev.c
+++ b/drivers/event/dsw/dsw_evdev.c
@@ -435,7 +435,7 @@ dsw_probe(struct rte_vdev_device *vdev)
name = rte_vdev_device_name(vdev);
dev = rte_event_pmd_vdev_init(name, sizeof(struct dsw_evdev),
- rte_socket_id());
+ rte_socket_id(), vdev);
if (dev == NULL)
return -EFAULT;
diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c
index 0eb9358981..a16f24e088 100644
--- a/drivers/event/octeontx/ssovf_evdev.c
+++ b/drivers/event/octeontx/ssovf_evdev.c
@@ -880,7 +880,7 @@ ssovf_vdev_probe(struct rte_vdev_device *vdev)
}
eventdev = rte_event_pmd_vdev_init(name, sizeof(struct ssovf_evdev),
- rte_socket_id());
+ rte_socket_id(), vdev);
if (eventdev == NULL) {
ssovf_log_err("Failed to create eventdev vdev %s", name);
return -ENOMEM;
diff --git a/drivers/event/opdl/opdl_evdev.c b/drivers/event/opdl/opdl_evdev.c
index dd25749654..0cccaf7e97 100644
--- a/drivers/event/opdl/opdl_evdev.c
+++ b/drivers/event/opdl/opdl_evdev.c
@@ -697,7 +697,7 @@ opdl_probe(struct rte_vdev_device *vdev)
}
}
dev = rte_event_pmd_vdev_init(name,
- sizeof(struct opdl_evdev), socket_id);
+ sizeof(struct opdl_evdev), socket_id, vdev);
if (dev == NULL) {
PMD_DRV_LOG(ERR, "eventdev vdev init() failed");
diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c
index dc9b131641..7db1efaf14 100644
--- a/drivers/event/skeleton/skeleton_eventdev.c
+++ b/drivers/event/skeleton/skeleton_eventdev.c
@@ -428,12 +428,12 @@ RTE_PMD_REGISTER_PCI_TABLE(event_skeleton_pci, pci_id_skeleton_map);
/* VDEV based event device */
static int
-skeleton_eventdev_create(const char *name, int socket_id)
+skeleton_eventdev_create(const char *name, int socket_id, struct rte_vdev_device *vdev)
{
struct rte_eventdev *eventdev;
eventdev = rte_event_pmd_vdev_init(name,
- sizeof(struct skeleton_eventdev), socket_id);
+ sizeof(struct skeleton_eventdev), socket_id, vdev);
if (eventdev == NULL) {
PMD_DRV_ERR("Failed to create eventdev vdev %s", name);
goto fail;
@@ -459,7 +459,7 @@ skeleton_eventdev_probe(struct rte_vdev_device *vdev)
name = rte_vdev_device_name(vdev);
RTE_LOG(INFO, PMD, "Initializing %s on NUMA node %d\n", name,
rte_socket_id());
- return skeleton_eventdev_create(name, rte_socket_id());
+ return skeleton_eventdev_create(name, rte_socket_id(), vdev);
}
static int
diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index 6d1816b76d..55e7735cb0 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -1075,7 +1075,7 @@ sw_probe(struct rte_vdev_device *vdev)
min_burst_size, deq_burst_size, refill_once);
dev = rte_event_pmd_vdev_init(name,
- sizeof(struct sw_evdev), socket_id);
+ sizeof(struct sw_evdev), socket_id, vdev);
if (dev == NULL) {
SW_LOG_ERR("eventdev vdev init() failed");
return -EFAULT;
diff --git a/lib/eventdev/eventdev_pmd_vdev.h b/lib/eventdev/eventdev_pmd_vdev.h
index 5fa9d699ac..bb433ba955 100644
--- a/lib/eventdev/eventdev_pmd_vdev.h
+++ b/lib/eventdev/eventdev_pmd_vdev.h
@@ -45,7 +45,7 @@ extern "C" {
__rte_internal
static inline struct rte_eventdev *
rte_event_pmd_vdev_init(const char *name, size_t dev_private_size,
- int socket_id)
+ int socket_id, struct rte_vdev_device *vdev)
{
struct rte_eventdev *eventdev;
@@ -67,6 +67,7 @@ rte_event_pmd_vdev_init(const char *name, size_t dev_private_size,
rte_panic("Cannot allocate memzone for private device"
" data");
}
+ eventdev->dev = &vdev->device;
return eventdev;
}
--
2.39.2
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v5 2/2] eventdev: fix missing driver names in info struct
2023-10-18 13:39 ` [PATCH v5 1/2] eventdev: fix " Bruce Richardson
@ 2023-10-18 13:39 ` Bruce Richardson
2023-10-19 5:35 ` Jerin Jacob
0 siblings, 1 reply; 18+ messages in thread
From: Bruce Richardson @ 2023-10-18 13:39 UTC (permalink / raw)
To: dev; +Cc: Jerin Jacob, David Marchand, Bruce Richardson, stable
Rather than relying on the individual drivers to always populated the
driver name field in the info structure - something missed by some
drivers, we can do so in the eventdev rte_event_dev_info_get() function.
This fixes issues
Fixes: bbbb929da5e6 ("event/skeleton: add skeleton eventdev driver")
Fixes: 0ce3ce7c275c ("event/dpaa2: add configuration functions")
Cc: stable@dpdk.org
Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/eventdev/rte_eventdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 95373bbaad..0ca32d6721 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -104,6 +104,8 @@ rte_event_dev_info_get(uint8_t dev_id, struct rte_event_dev_info *dev_info)
dev_info->dequeue_timeout_ns = dev->data->dev_conf.dequeue_timeout_ns;
dev_info->dev = dev->dev;
+ if (dev->dev != NULL && dev->dev->driver != NULL)
+ dev_info->driver_name = dev->dev->driver->name;
rte_eventdev_trace_info_get(dev_id, dev_info, dev_info->dev);
--
2.39.2
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v5 2/2] eventdev: fix missing driver names in info struct
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
0 siblings, 0 replies; 18+ messages in thread
From: Jerin Jacob @ 2023-10-19 5:35 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, Jerin Jacob, David Marchand, stable
On Wed, Oct 18, 2023 at 9:07 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> Rather than relying on the individual drivers to always populated the
> driver name field in the info structure - something missed by some
> drivers, we can do so in the eventdev rte_event_dev_info_get() function.
> This fixes issues
>
> Fixes: bbbb929da5e6 ("event/skeleton: add skeleton eventdev driver")
> Fixes: 0ce3ce7c275c ("event/dpaa2: add configuration functions")
> Cc: stable@dpdk.org
>
> Suggested-by: David Marchand <david.marchand@redhat.com>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Series applied to dpdk-next--eventdev/for-main. Thanks
^ permalink raw reply [flat|nested] 18+ messages in thread