Skip to contentSkip to conversation

eventdev: add PCI probe named convenience function

PATCH Superseded Timothy McDaniel 2 participants 4 messages Oct 5, 2020 – Oct 12, 2020

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 eventdev: add PCI probe named convenience function

Add new internal wrapper function for use by pci drivers as a .probe function to attach to an event interface. Same as rte_event_pmd_pci_probe, except the caller can specify the name.

Updated rte_event_pmd_pci_probe so as to not duplicate code.

---
 lib/librte_eventdev/rte_eventdev_pmd_pci.h | 44 ++++++++++++++++++++++--------
 1 file changed, 32 insertions(+), 12 deletions(-)
lib/librte_eventdev/rte_eventdev_pmd_pci.h +32 -12
index a3f9244..fa9954d 100644
@@ -32,28 +32,25 @@ typedef int (*eventdev_pmd_pci_callback_t)(struct rte_eventdev *dev);
 
 /**
  * @internal
- * Wrapper for use by pci drivers as a .probe function to attach to a event
- * interface.
+ * Wrapper for use by pci drivers as a .probe function to attach to an event
+ * interface.  Same as rte_event_pmd_pci_probe, except caller can specify
+ * the name.
  */
 static inline int
-rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv,
-			    struct rte_pci_device *pci_dev,
-			    size_t private_data_size,
-			    eventdev_pmd_pci_callback_t devinit)
+rte_event_pmd_pci_probe_named(struct rte_pci_driver *pci_drv,
+			      struct rte_pci_device *pci_dev,
+			      size_t private_data_size,
+			      eventdev_pmd_pci_callback_t devinit,
+			      const char *name)
 {
 	struct rte_eventdev *eventdev;
 
-	char eventdev_name[RTE_EVENTDEV_NAME_MAX_LEN];
-
 	int retval;
 
 	if (devinit == NULL)
 		return -EINVAL;
 
-	rte_pci_device_name(&pci_dev->addr, eventdev_name,
-			sizeof(eventdev_name));
-
-	eventdev = rte_event_pmd_allocate(eventdev_name,
+	eventdev = rte_event_pmd_allocate(name,
 			 pci_dev->device.numa_node);
 	if (eventdev == NULL)
 		return -ENOMEM;
@@ -90,6 +87,29 @@ rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv,
 
 /**
  * @internal
+ * Wrapper for use by pci drivers as a .probe function to attach to a event
+ * interface.
+ */
+static inline int
+rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv,
+			    struct rte_pci_device *pci_dev,
+			    size_t private_data_size,
+			    eventdev_pmd_pci_callback_t devinit)
+{
+	char eventdev_name[RTE_EVENTDEV_NAME_MAX_LEN];
+
+	rte_pci_device_name(&pci_dev->addr, eventdev_name,
+			sizeof(eventdev_name));
+
+	return rte_event_pmd_pci_probe_named(pci_drv,
+					     pci_dev,
+					     private_data_size,
+					     devinit,
+					     eventdev_name);
+}
+
+/**
+ * @internal
  * Wrapper for use by pci drivers as a .remove function to detach a event
  * interface.
  */
Signature · 1 line
2.6.4
Acked-by on v2 1/1
#1 lore raw
Quoted 18 lines · Timothy McDaniel

Add new internal wrapper function for use by pci drivers as a .probe function to attach to an event interface. Same as rte_event_pmd_pci_probe, except the caller can specify the name.

Updated rte_event_pmd_pci_probe so as to not duplicate code.

---
 lib/librte_eventdev/rte_eventdev_pmd_pci.h | 44 ++++++++++++++++++++++--------
 1 file changed, 32 insertions(+), 12 deletions(-)

* @internal
+ * Wrapper for use by pci drivers as a .probe function to attach to a event
+ * interface.
+ */

lib/librte_eventdev/rte_eventdev_pmd_pci.h rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv, · line 97

Quoted 5 lines
lib/librte_eventdev/rte_eventdev_pmd_pci.h +5 -0
+static inline int
+rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv,
+                           struct rte_pci_device *pci_dev,
+                           size_t private_data_size,
+                           eventdev_pmd_pci_callback_t devinit)

rte_event_pmd_pci_probe() added in lib/librte_eventdev/rte_eventdev_version.map file. Please add the new function in the map file. With above change:

Quoted 21 lines
lib/librte_eventdev/rte_eventdev_pmd_pci.h +15 -1
+{
+       char eventdev_name[RTE_EVENTDEV_NAME_MAX_LEN];
+
+       rte_pci_device_name(&pci_dev->addr, eventdev_name,
+                       sizeof(eventdev_name));
+
+       return rte_event_pmd_pci_probe_named(pci_drv,
+                                            pci_dev,
+                                            private_data_size,
+                                            devinit,
+                                            eventdev_name);
+}
+
+/**
+ * @internal
  * Wrapper for use by pci drivers as a .remove function to detach a event
  * interface.
  */
--

2.6.4

#2 lore raw
Quoted 32 lines · Jerin Jacob
Quoted 18 lines · Timothy McDaniel

Add new internal wrapper function for use by pci drivers as a .probe function to attach to an event interface. Same as rte_event_pmd_pci_probe, except the caller can specify the name.

Updated rte_event_pmd_pci_probe so as to not duplicate code.

---
 lib/librte_eventdev/rte_eventdev_pmd_pci.h | 44 ++++++++++++++++++++++--------
 1 file changed, 32 insertions(+), 12 deletions(-)

* @internal
+ * Wrapper for use by pci drivers as a .probe function to attach to a event
+ * interface.
+ */

lib/librte_eventdev/rte_eventdev_pmd_pci.h rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv, · line 97

Quoted 5 lines
lib/librte_eventdev/rte_eventdev_pmd_pci.h +5 -0
+static inline int
+rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv,
+                           struct rte_pci_device *pci_dev,
+                           size_t private_data_size,
+                           eventdev_pmd_pci_callback_t devinit)

rte_event_pmd_pci_probe() added in lib/librte_eventdev/rte_eventdev_version.map file. Please add the new function in the map file. With above change:

Quoted 1 line

@McDaniel, Timothy
Could you send the updated version, I would like to merge this for RC1.

Quoted 24 lines
Quoted 24 lines
lib/librte_eventdev/rte_eventdev_pmd_pci.h +15 -1
+{
+       char eventdev_name[RTE_EVENTDEV_NAME_MAX_LEN];
+
+       rte_pci_device_name(&pci_dev->addr, eventdev_name,
+                       sizeof(eventdev_name));
+
+       return rte_event_pmd_pci_probe_named(pci_drv,
+                                            pci_dev,
+                                            private_data_size,
+                                            devinit,
+                                            eventdev_name);
+}
+
+/**
+ * @internal
  * Wrapper for use by pci drivers as a .remove function to detach a event
  * interface.
  */
--

2.6.4

#3 lore raw
Quoted 68 lines

-----Original Message-----
From: Jerin Jacob <[email protected]>
Sent: Sunday, October 11, 2020 4:54 AM
To: McDaniel, Timothy <[email protected]>
Cc: Jerin Jacob <[email protected]>; dpdk-dev <[email protected]>; Carrillo, Erik G <[email protected]>; Eads, Gage <[email protected]>; Van Haaren, Harry <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2 1/1] eventdev: add PCI probe named convenience function

Quoted 8 lines · Jerin Jacob
Quoted 5 lines · Timothy McDaniel

Add new internal wrapper function for use by pci drivers as a .probe function to attach to an event interface. Same as rte_event_pmd_pci_probe, except the caller can specify the name.

Quoted 6 lines
Quoted 6 lines

Updated rte_event_pmd_pci_probe so as to not duplicate code.

---
 lib/librte_eventdev/rte_eventdev_pmd_pci.h | 44

++++++++++++++++++++++--------

Quoted 18 lines

lib/librte_eventdev/rte_eventdev_pmd_pci.h rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv, · line 97

Quoted 12 lines
 1 file changed, 32 insertions(+), 12 deletions(-)

* @internal
+ * Wrapper for use by pci drivers as a .probe function to attach to a event
+ * interface.
+ */

lib/librte_eventdev/rte_eventdev_pmd_pci.h +5 -0
+static inline int
+rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv,
+                           struct rte_pci_device *pci_dev,
+                           size_t private_data_size,
+                           eventdev_pmd_pci_callback_t devinit)

rte_event_pmd_pci_probe() added in lib/librte_eventdev/rte_eventdev_version.map file. Please add the new function in the map file. With above change:

Quoted 1 line

@McDaniel, Timothy
Could you send the updated version, I would like to merge this for RC1.

Quoted 16 lines
Quoted 16 lines
lib/librte_eventdev/rte_eventdev_pmd_pci.h +13 -0
+{
+       char eventdev_name[RTE_EVENTDEV_NAME_MAX_LEN];
+
+       rte_pci_device_name(&pci_dev->addr, eventdev_name,
+                       sizeof(eventdev_name));
+
+       return rte_event_pmd_pci_probe_named(pci_drv,
+                                            pci_dev,
+                                            private_data_size,
+                                            devinit,
+                                            eventdev_name);
+}
+
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

+/**
+ * @internal
* Wrapper for use by pci drivers as a .remove function to detach a event
* interface.
*/
--
2.6.4

I will get that uploaded today.

Thanks,
Tim