diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2018-08-14 18:52:30 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2018-08-14 18:53:17 +0100 |
commit | b63264c8342e6a1b6971c79550d2af2024b6a4de (patch) | |
tree | 83114aac64286fe616506c0b3dfaec2ab86ef835 /examples/tep_termination | |
parent | ca33590b6af032bff57d9cc70455660466a654b2 (diff) |
New upstream version 18.08upstream/18.08
Change-Id: I32fdf5e5016556d9c0a6d88ddaf1fc468961790a
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'examples/tep_termination')
-rw-r--r-- | examples/tep_termination/Makefile | 5 | ||||
-rw-r--r-- | examples/tep_termination/main.c | 27 | ||||
-rw-r--r-- | examples/tep_termination/meson.build | 4 | ||||
-rw-r--r-- | examples/tep_termination/vxlan_setup.c | 4 |
4 files changed, 21 insertions, 19 deletions
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile index d2c357a1..8ec1a38e 100644 --- a/examples/tep_termination/Makefile +++ b/examples/tep_termination/Makefile @@ -25,6 +25,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +CFLAGS += -DALLOW_EXPERIMENTAL_API + build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) @@ -50,11 +52,12 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc include $(RTE_SDK)/mk/rte.vars.mk -ifneq ($(CONFIG_RTE_EXEC_ENV),"linuxapp") +ifneq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) $(error This application can only operate in a linuxapp environment, \ please change the definition of the RTE_TARGET environment variable) endif +CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += -D_GNU_SOURCE diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c index 27073913..7795d089 100644 --- a/examples/tep_termination/main.c +++ b/examples/tep_termination/main.c @@ -515,11 +515,10 @@ check_ports_num(unsigned max_nb_ports) } for (portid = 0; portid < nb_ports; portid++) { - if (ports[portid] >= max_nb_ports) { + if (!rte_eth_dev_is_valid_port(ports[portid])) { RTE_LOG(INFO, VHOST_PORT, - "\nSpecified port ID(%u) exceeds max " - " system port ID(%u)\n", - ports[portid], (max_nb_ports - 1)); + "\nSpecified port ID(%u) is not valid\n", + ports[portid]); ports[portid] = INVALID_PORT_ID; valid_nb_ports--; } @@ -1062,8 +1061,8 @@ static const struct vhost_device_ops virtio_net_device_ops = { * This is a thread will wake up after a period to print stats if the user has * enabled them. */ -static void -print_stats(void) +static void * +print_stats(__rte_unused void *arg) { struct virtio_net_data_ll *dev_ll; uint64_t tx_dropped, rx_dropped; @@ -1120,6 +1119,8 @@ print_stats(void) } printf("\n================================================\n"); } + + return NULL; } /** @@ -1135,7 +1136,6 @@ main(int argc, char *argv[]) uint16_t portid; uint16_t queue_id; static pthread_t tid; - char thread_name[RTE_MAX_THREAD_NAME_LEN]; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1157,7 +1157,7 @@ main(int argc, char *argv[]) nb_switching_cores = rte_lcore_count()-1; /* Get the number of physical ports. */ - nb_ports = rte_eth_dev_count(); + nb_ports = rte_eth_dev_count_avail(); /* * Update the global var NB_PORTS and global array PORTS @@ -1185,7 +1185,7 @@ main(int argc, char *argv[]) vpool_array[queue_id].pool = mbuf_pool; /* initialize all ports */ - for (portid = 0; portid < nb_ports; portid++) { + RTE_ETH_FOREACH_DEV(portid) { /* skip ports that are not enabled */ if ((enabled_port_mask & (1 << portid)) == 0) { RTE_LOG(INFO, VHOST_PORT, @@ -1206,13 +1206,10 @@ main(int argc, char *argv[]) /* Enable stats if the user option is set. */ if (enable_stats) { - ret = pthread_create(&tid, NULL, (void *)print_stats, NULL); - if (ret != 0) + ret = rte_ctrl_thread_create(&tid, "print-stats", NULL, + print_stats, NULL); + if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot create print-stats thread\n"); - snprintf(thread_name, RTE_MAX_THREAD_NAME_LEN, "print-stats"); - ret = rte_thread_setname(tid, thread_name); - if (ret != 0) - RTE_LOG(DEBUG, VHOST_CONFIG, "Cannot set print-stats name\n"); } /* Launch all data cores. */ diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build index 68c940aa..6d363624 100644 --- a/examples/tep_termination/meson.build +++ b/examples/tep_termination/meson.build @@ -6,7 +6,11 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' +if host_machine.system() != 'linux' + build = false +endif deps += ['hash', 'vhost'] +allow_experimental_apis = true sources = files( 'main.c', 'vxlan.c', 'vxlan_setup.c' ) diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c index ba7d92aa..b99ab97d 100644 --- a/examples/tep_termination/vxlan_setup.c +++ b/examples/tep_termination/vxlan_setup.c @@ -69,7 +69,6 @@ uint8_t tep_filter_type[] = {RTE_TUNNEL_FILTER_IMAC_TENID, static struct rte_eth_conf port_conf = { .rxmode = { .split_hdr_size = 0, - .ignore_offload_bitfield = 1, .offloads = DEV_RX_OFFLOAD_CRC_STRIP, }, .txmode = { @@ -131,9 +130,8 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool) rxconf = &dev_info.default_rxconf; txconf = &dev_info.default_txconf; - txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE; - if (port >= rte_eth_dev_count()) + if (!rte_eth_dev_is_valid_port(port)) return -1; rx_rings = nb_devices; |