summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikhil Rao <nikhil.rao@intel.com>2018-09-06 14:41:42 +0530
committerJerin Jacob <jerin.jacob@caviumnetworks.com>2018-10-01 16:47:56 +0200
commitd7b5f102c4781bd2e9a952243eb59cffe135b01c (patch)
treeed9c855346d9d01b75616bf39c7e1ac6b064010b
parent4ab57b042e7c87a3aaadd97fb2c59e62e9f94672 (diff)
downloaddpdk-d7b5f102c4781bd2e9a952243eb59cffe135b01c.zip
dpdk-d7b5f102c4781bd2e9a952243eb59cffe135b01c.tar.gz
dpdk-d7b5f102c4781bd2e9a952243eb59cffe135b01c.tar.xz
eventdev: fix eth Rx adapter hotplug incompatibility
Use RTE_MAX_ETHPORTS instead of rte_eth_dev_count_total() when allocating eth Rx adapter's per-eth device data structure to account for hotplugged devices. Fixes: 9c38b704d280 ("eventdev: add eth Rx adapter implementation") Cc: stable@dpdk.org Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
-rw-r--r--lib/librte_eventdev/rte_event_eth_rx_adapter.c5
-rw-r--r--lib/librte_eventdev/rte_event_eth_rx_adapter.h4
2 files changed, 2 insertions, 7 deletions
diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
index f5e5a0b..870ac8c 100644
--- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
@@ -1998,8 +1998,7 @@ rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id,
rx_adapter->id = id;
strcpy(rx_adapter->mem_name, mem_name);
rx_adapter->eth_devices = rte_zmalloc_socket(rx_adapter->mem_name,
- /* FIXME: incompatible with hotplug */
- rte_eth_dev_count_total() *
+ RTE_MAX_ETHPORTS *
sizeof(struct eth_device_info), 0,
socket_id);
rte_convert_rss_key((const uint32_t *)default_rss_key,
@@ -2012,7 +2011,7 @@ rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id,
return -ENOMEM;
}
rte_spinlock_init(&rx_adapter->rx_lock);
- RTE_ETH_FOREACH_DEV(i)
+ for (i = 0; i < RTE_MAX_ETHPORTS; i++)
rx_adapter->eth_devices[i].dev = &rte_eth_devices[i];
event_eth_rx_adapter[id] = rx_adapter;
diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.h b/lib/librte_eventdev/rte_event_eth_rx_adapter.h
index 332ee21..863b72a 100644
--- a/lib/librte_eventdev/rte_event_eth_rx_adapter.h
+++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.h
@@ -76,10 +76,6 @@
* rte_event_eth_rx_adapter_cb_register() function allows the
* application to register a callback that selects which packets to enqueue
* to the event device.
- *
- * Note:
- * 1) Devices created after an instance of rte_event_eth_rx_adapter_create
- * should be added to a new instance of the rx adapter.
*/
#ifdef __cplusplus