diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2017-08-23 14:47:51 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2017-08-23 14:48:05 +0100 |
commit | 41921c54b898292b0140d5f322cc8ec5b0642a7e (patch) | |
tree | 70c62f3b26536abf0fa4b347300c78360d4ff546 /examples/multi_process/l2fwd_fork | |
parent | 76f89ef557ff345dfa606e797e1765404babce56 (diff) | |
parent | f239aed5e674965691846e8ce3f187dd47523689 (diff) |
Merge branch 'upstream' into HEAD
Change-Id: Ib9772cbbc33c14a44bd918056b22602ff6891a18
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'examples/multi_process/l2fwd_fork')
-rw-r--r-- | examples/multi_process/l2fwd_fork/Makefile | 2 | ||||
-rw-r--r-- | examples/multi_process/l2fwd_fork/flib.c | 1 | ||||
-rw-r--r-- | examples/multi_process/l2fwd_fork/flib.h | 2 | ||||
-rw-r--r-- | examples/multi_process/l2fwd_fork/main.c | 10 |
4 files changed, 9 insertions, 6 deletions
diff --git a/examples/multi_process/l2fwd_fork/Makefile b/examples/multi_process/l2fwd_fork/Makefile index ff257a35..11ae8ff4 100644 --- a/examples/multi_process/l2fwd_fork/Makefile +++ b/examples/multi_process/l2fwd_fork/Makefile @@ -33,7 +33,7 @@ ifeq ($(RTE_SDK),) $(error "Please define RTE_SDK environment variable") endif -# Default target, can be overriden by command line or environment +# Default target, can be overridden by command line or environment RTE_TARGET ?= x86_64-native-linuxapp-gcc include $(RTE_SDK)/mk/rte.vars.mk diff --git a/examples/multi_process/l2fwd_fork/flib.c b/examples/multi_process/l2fwd_fork/flib.c index 85bbc2d3..c22e983b 100644 --- a/examples/multi_process/l2fwd_fork/flib.c +++ b/examples/multi_process/l2fwd_fork/flib.c @@ -56,7 +56,6 @@ #include <rte_memcpy.h> #include <rte_memzone.h> #include <rte_eal.h> -#include <rte_per_lcore.h> #include <rte_launch.h> #include <rte_atomic.h> #include <rte_cycles.h> diff --git a/examples/multi_process/l2fwd_fork/flib.h b/examples/multi_process/l2fwd_fork/flib.h index 711e3b6d..1064c9bb 100644 --- a/examples/multi_process/l2fwd_fork/flib.h +++ b/examples/multi_process/l2fwd_fork/flib.h @@ -120,7 +120,7 @@ int flib_register_slave_exit_notify(unsigned slave_id, /** * Assign a lcore ID to non-slave thread. Non-slave thread refers to thread that * not created by function rte_eal_remote_launch or rte_eal_mp_remote_launch. - * These threads can either bind lcore or float among differnt lcores. + * These threads can either bind lcore or float among different lcores. * This lcore ID will be unique in multi-thread or multi-process DPDK running * environment, then it can benefit from using the cache mechanism provided in * mempool library. diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c index d922522f..f8a626ba 100644 --- a/examples/multi_process/l2fwd_fork/main.c +++ b/examples/multi_process/l2fwd_fork/main.c @@ -53,7 +53,6 @@ #include <rte_memcpy.h> #include <rte_memzone.h> #include <rte_eal.h> -#include <rte_per_lcore.h> #include <rte_launch.h> #include <rte_atomic.h> #include <rte_spinlock.h> @@ -937,7 +936,6 @@ main(int argc, char **argv) unsigned rx_lcore_id; unsigned nb_ports_in_mask = 0; unsigned i; - int flags = 0; uint64_t prev_tsc, diff_tsc, cur_tsc, timer_tsc; /* Save cpu_affinity first, restore it in case it's floating process option */ @@ -987,7 +985,6 @@ main(int argc, char **argv) if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) continue; char buf_name[RTE_MEMPOOL_NAMESIZE]; - flags = MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET; snprintf(buf_name, RTE_MEMPOOL_NAMESIZE, MBUF_NAME, portid); l2fwd_pktmbuf_pool[portid] = rte_pktmbuf_pool_create(buf_name, NB_MBUF, 32, @@ -1082,6 +1079,13 @@ main(int argc, char **argv) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", ret, (unsigned) portid); + ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, + &nb_txd); + if (ret < 0) + rte_exit(EXIT_FAILURE, + "rte_eth_dev_adjust_nb_rx_tx_desc: err=%d, port=%u\n", + ret, (unsigned) portid); + rte_eth_macaddr_get(portid,&l2fwd_ports_eth_addr[portid]); /* init one RX queue */ |