eventdev: fix event driver name to eventdev lookup
authorJerin Jacob <jerin.jacob@caviumnetworks.com>
Mon, 6 Feb 2017 05:23:37 +0000 (10:53 +0530)
committerJerin Jacob <jerin.jacob@caviumnetworks.com>
Tue, 4 Apr 2017 17:17:08 +0000 (19:17 +0200)
- Removed uninitialized max_devs value
- Corrected dev assignment

Fixes: 4f0804bbdfb9 ("eventdev: implement the northbound APIs")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
lib/librte_eventdev/rte_eventdev_pmd.h

index 2e3e5d3..82d5e48 100644 (file)
@@ -149,7 +149,6 @@ struct rte_eventdev_driver {
 /** Global structure used for maintaining state of allocated event devices */
 struct rte_eventdev_global {
        uint8_t nb_devs;        /**< Number of devices found */
-       uint8_t max_devs;       /**< Max number of devices */
 };
 
 extern struct rte_eventdev_global *rte_eventdev_globals;
@@ -175,8 +174,8 @@ rte_event_pmd_get_named_dev(const char *name)
        if (name == NULL)
                return NULL;
 
-       for (i = 0, dev = &rte_eventdevs[i];
-                       i < rte_eventdev_globals->max_devs; i++) {
+       for (i = 0; i < RTE_EVENT_MAX_DEVS; i++) {
+               dev = &rte_eventdevs[i];
                if ((dev->attached == RTE_EVENTDEV_ATTACHED) &&
                                (strcmp(dev->data->name, name) == 0))
                        return dev;