* [dpdk-stable] [PATCH 1/2] eventdev: fix eth Rx adapter hotplug incompatibility @ 2018-09-06 9:11 Nikhil Rao 2018-09-06 9:11 ` [dpdk-stable] [PATCH 2/2] test/eventdev: remove eth Rx adapter vdev workaround Nikhil Rao ` (2 more replies) 0 siblings, 3 replies; 5+ messages in thread From: Nikhil Rao @ 2018-09-06 9:11 UTC (permalink / raw) To: jerin.jacob; +Cc: dev, Nikhil Rao, stable 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> --- lib/librte_eventdev/rte_event_eth_rx_adapter.c | 5 ++--- lib/librte_eventdev/rte_event_eth_rx_adapter.h | 4 ---- 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 @@ static int rxa_sw_add(struct rte_event_eth_rx_adapter *rx_adapter, 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 @@ static int rxa_sw_add(struct rte_event_eth_rx_adapter *rx_adapter, 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 -- 1.8.3.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-stable] [PATCH 2/2] test/eventdev: remove eth Rx adapter vdev workaround 2018-09-06 9:11 [dpdk-stable] [PATCH 1/2] eventdev: fix eth Rx adapter hotplug incompatibility Nikhil Rao @ 2018-09-06 9:11 ` Nikhil Rao 2018-09-20 6:38 ` Jerin Jacob 2018-09-20 6:37 ` [dpdk-stable] [PATCH 1/2] eventdev: fix eth Rx adapter hotplug incompatibility Jerin Jacob 2018-09-23 8:31 ` Jerin Jacob 2 siblings, 1 reply; 5+ messages in thread From: Nikhil Rao @ 2018-09-06 9:11 UTC (permalink / raw) To: jerin.jacob; +Cc: dev, Nikhil Rao, vipin.varghese, stable eth Rx adapter has been updated to support hotplugged devices, devices created after adapter creation can now be added to the adapter. Update the adapter_multi_eth_add_del test case to create the adapter as part of test setup instead of creating it after creating vdevs. Fixes: 2a9c83ae3b2e ("test/eventdev: add multi-ports test") Cc: vipin.varghese@intel.com Cc: stable@dpdk.org Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> --- test/test/test_event_eth_rx_adapter.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/test/test_event_eth_rx_adapter.c b/test/test/test_event_eth_rx_adapter.c index 4cca77f..d6d137e 100644 --- a/test/test/test_event_eth_rx_adapter.c +++ b/test/test/test_event_eth_rx_adapter.c @@ -489,9 +489,6 @@ struct event_eth_rx_adapter_test_params { err = init_ports(rte_eth_dev_count_total()); TEST_ASSERT(err == 0, "Port initialization failed err %d\n", err); - /* creating new instance for all newly added eth devices */ - adapter_create(); - /* eth_rx_adapter_queue_add for n ports */ port_index = 0; for (; port_index < rte_eth_dev_count_total(); port_index += 1) { @@ -509,8 +506,6 @@ struct event_eth_rx_adapter_test_params { TEST_ASSERT(err == 0, "Expected 0 got %d", err); } - adapter_free(); - return TEST_SUCCESS; } @@ -675,7 +670,8 @@ struct event_eth_rx_adapter_test_params { TEST_CASE_ST(NULL, NULL, adapter_create_free), TEST_CASE_ST(adapter_create, adapter_free, adapter_queue_add_del), - TEST_CASE_ST(NULL, NULL, adapter_multi_eth_add_del), + TEST_CASE_ST(adapter_create, adapter_free, + adapter_multi_eth_add_del), TEST_CASE_ST(adapter_create, adapter_free, adapter_start_stop), TEST_CASE_ST(adapter_create, adapter_free, adapter_stats), TEST_CASES_END() /**< NULL terminate unit test array */ -- 1.8.3.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-stable] [PATCH 2/2] test/eventdev: remove eth Rx adapter vdev workaround 2018-09-06 9:11 ` [dpdk-stable] [PATCH 2/2] test/eventdev: remove eth Rx adapter vdev workaround Nikhil Rao @ 2018-09-20 6:38 ` Jerin Jacob 0 siblings, 0 replies; 5+ messages in thread From: Jerin Jacob @ 2018-09-20 6:38 UTC (permalink / raw) To: Nikhil Rao; +Cc: dev, vipin.varghese, stable -----Original Message----- > Date: Thu, 6 Sep 2018 14:41:43 +0530 > From: Nikhil Rao <nikhil.rao@intel.com> > To: jerin.jacob@caviumnetworks.com > CC: dev@dpdk.org, Nikhil Rao <nikhil.rao@intel.com>, > vipin.varghese@intel.com, stable@dpdk.org > Subject: [PATCH 2/2] test/eventdev: remove eth Rx adapter vdev workaround > X-Mailer: git-send-email 1.8.3.1 > > > eth Rx adapter has been updated to support hotplugged > devices, devices created after adapter creation can now be > added to the adapter. > > Update the adapter_multi_eth_add_del > test case to create the adapter as part of test setup > instead of creating it after creating vdevs. > > Fixes: 2a9c83ae3b2e ("test/eventdev: add multi-ports test") > Cc: vipin.varghese@intel.com > Cc: stable@dpdk.org > Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> > --- > test/test/test_event_eth_rx_adapter.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/test/test/test_event_eth_rx_adapter.c b/test/test/test_event_eth_rx_adapter.c > index 4cca77f..d6d137e 100644 > --- a/test/test/test_event_eth_rx_adapter.c > +++ b/test/test/test_event_eth_rx_adapter.c > @@ -489,9 +489,6 @@ struct event_eth_rx_adapter_test_params { > err = init_ports(rte_eth_dev_count_total()); > TEST_ASSERT(err == 0, "Port initialization failed err %d\n", err); > > - /* creating new instance for all newly added eth devices */ > - adapter_create(); > - > /* eth_rx_adapter_queue_add for n ports */ > port_index = 0; > for (; port_index < rte_eth_dev_count_total(); port_index += 1) { > @@ -509,8 +506,6 @@ struct event_eth_rx_adapter_test_params { > TEST_ASSERT(err == 0, "Expected 0 got %d", err); > } > > - adapter_free(); > - > return TEST_SUCCESS; > } > > @@ -675,7 +670,8 @@ struct event_eth_rx_adapter_test_params { > TEST_CASE_ST(NULL, NULL, adapter_create_free), > TEST_CASE_ST(adapter_create, adapter_free, > adapter_queue_add_del), > - TEST_CASE_ST(NULL, NULL, adapter_multi_eth_add_del), > + TEST_CASE_ST(adapter_create, adapter_free, > + adapter_multi_eth_add_del), > TEST_CASE_ST(adapter_create, adapter_free, adapter_start_stop), > TEST_CASE_ST(adapter_create, adapter_free, adapter_stats), > TEST_CASES_END() /**< NULL terminate unit test array */ > -- > 1.8.3.1 > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-stable] [PATCH 1/2] eventdev: fix eth Rx adapter hotplug incompatibility 2018-09-06 9:11 [dpdk-stable] [PATCH 1/2] eventdev: fix eth Rx adapter hotplug incompatibility Nikhil Rao 2018-09-06 9:11 ` [dpdk-stable] [PATCH 2/2] test/eventdev: remove eth Rx adapter vdev workaround Nikhil Rao @ 2018-09-20 6:37 ` Jerin Jacob 2018-09-23 8:31 ` Jerin Jacob 2 siblings, 0 replies; 5+ messages in thread From: Jerin Jacob @ 2018-09-20 6:37 UTC (permalink / raw) To: Nikhil Rao; +Cc: dev, stable -----Original Message----- > Date: Thu, 6 Sep 2018 14:41:42 +0530 > From: Nikhil Rao <nikhil.rao@intel.com> > To: jerin.jacob@caviumnetworks.com > CC: dev@dpdk.org, Nikhil Rao <nikhil.rao@intel.com>, stable@dpdk.org > Subject: [PATCH 1/2] eventdev: fix eth Rx adapter hotplug incompatibility > X-Mailer: git-send-email 1.8.3.1 > > > 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> > --- > lib/librte_eventdev/rte_event_eth_rx_adapter.c | 5 ++--- > lib/librte_eventdev/rte_event_eth_rx_adapter.h | 4 ---- > 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 @@ static int rxa_sw_add(struct rte_event_eth_rx_adapter *rx_adapter, > 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 @@ static int rxa_sw_add(struct rte_event_eth_rx_adapter *rx_adapter, > 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 > -- > 1.8.3.1 > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-stable] [PATCH 1/2] eventdev: fix eth Rx adapter hotplug incompatibility 2018-09-06 9:11 [dpdk-stable] [PATCH 1/2] eventdev: fix eth Rx adapter hotplug incompatibility Nikhil Rao 2018-09-06 9:11 ` [dpdk-stable] [PATCH 2/2] test/eventdev: remove eth Rx adapter vdev workaround Nikhil Rao 2018-09-20 6:37 ` [dpdk-stable] [PATCH 1/2] eventdev: fix eth Rx adapter hotplug incompatibility Jerin Jacob @ 2018-09-23 8:31 ` Jerin Jacob 2 siblings, 0 replies; 5+ messages in thread From: Jerin Jacob @ 2018-09-23 8:31 UTC (permalink / raw) To: Nikhil Rao; +Cc: dev, stable -----Original Message----- > Date: Thu, 6 Sep 2018 14:41:42 +0530 > From: Nikhil Rao <nikhil.rao@intel.com> > To: jerin.jacob@caviumnetworks.com > CC: dev@dpdk.org, Nikhil Rao <nikhil.rao@intel.com>, stable@dpdk.org > Subject: [PATCH 1/2] eventdev: fix eth Rx adapter hotplug incompatibility > X-Mailer: git-send-email 1.8.3.1 > > > 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> Applied this series to dpdk-next-eventdev/master. Thanks. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-09-23 8:47 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-09-06 9:11 [dpdk-stable] [PATCH 1/2] eventdev: fix eth Rx adapter hotplug incompatibility Nikhil Rao 2018-09-06 9:11 ` [dpdk-stable] [PATCH 2/2] test/eventdev: remove eth Rx adapter vdev workaround Nikhil Rao 2018-09-20 6:38 ` Jerin Jacob 2018-09-20 6:37 ` [dpdk-stable] [PATCH 1/2] eventdev: fix eth Rx adapter hotplug incompatibility Jerin Jacob 2018-09-23 8:31 ` 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).