summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPavan Nikhilesh <pbhagavatula@marvell.com>2019-03-12 20:41:09 +0000
committerJerin Jacob <jerinj@marvell.com>2019-03-15 06:46:50 +0100
commit66af142f2a307da10a5f68d9288e0b72ad60e35e (patch)
treecf13549ec07bf1c33137719aec36d529516c6d45 /examples
parent66b82db2ef7af55601165b944959645d77ee1f3c (diff)
downloaddpdk-next-eventdev-66af142f2a307da10a5f68d9288e0b72ad60e35e.zip
dpdk-next-eventdev-66af142f2a307da10a5f68d9288e0b72ad60e35e.tar.gz
dpdk-next-eventdev-66af142f2a307da10a5f68d9288e0b72ad60e35e.tar.xz
examples/eventdev: start ethdev after adapter setup
Start ethdev after the Rx/Tx adapter setup is complete as in some architectures it might lead to undefined behaviour or events being dropped. Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> Reviewed-by: Nikhil Rao <nikhil.rao@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/eventdev_pipeline/main.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index 2ad7d24..58f8904 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -316,11 +316,6 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
return retval;
}
- /* Start the Ethernet port. */
- retval = rte_eth_dev_start(port);
- if (retval < 0)
- return retval;
-
/* Display the port MAC address. */
struct ether_addr addr;
rte_eth_macaddr_get(port, &addr);
@@ -441,6 +436,7 @@ main(int argc, char **argv)
{
struct worker_data *worker_data;
uint16_t num_ports;
+ uint16_t portid;
int lcore_id;
int err;
@@ -508,6 +504,14 @@ main(int argc, char **argv)
init_ports(num_ports);
fdata->cap.adptr_setup(num_ports);
+ /* Start the Ethernet port. */
+ RTE_ETH_FOREACH_DEV(portid) {
+ err = rte_eth_dev_start(portid);
+ if (err < 0)
+ rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n",
+ portid);
+ }
+
int worker_idx = 0;
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (lcore_id >= MAX_NUM_CORE)