#include <netinet/in.h>
#include <net/if.h>
-#ifdef RTE_EXEC_ENV_LINUXAPP
+#ifdef RTE_EXEC_ENV_LINUX
#include <linux/if_tun.h>
#endif
#include <fcntl.h>
/* Options for configuring ethernet port */
static struct rte_eth_conf port_conf = {
- .rxmode = {
- .ignore_offload_bitfield = 1,
- .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
- },
.txmode = {
.mq_mode = ETH_MQ_TX_NONE,
},
" Lcore Port RX TX Dropped on TX\n"
"------- ------ ------------ ------------ ---------------\n");
RTE_LCORE_FOREACH(i) {
+ /* limit ourselves to application supported cores only */
+ if (i >= APP_MAX_LCORE)
+ break;
printf("%6u %7u %13"PRIu64" %13"PRIu64" %16"PRIu64"\n",
i, (unsigned)port_ids[i],
lcore_stats[i].rx, lcore_stats[i].tx,
}
}
-#ifdef RTE_EXEC_ENV_LINUXAPP
+#ifdef RTE_EXEC_ENV_LINUX
/*
* Create a tap network interface, or use existing one with same name.
* If name[0]='\0' then a name is automatically assigned and returned in name.
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
if (name && *name)
- snprintf(ifr.ifr_name, IFNAMSIZ, "%s", name);
+ strlcpy(ifr.ifr_name, name, IFNAMSIZ);
ret = ioctl(fd, TUNSETIFF, (void *) &ifr);
if (ret < 0) {
}
if (name)
- snprintf(name, IFNAMSIZ, "%s", ifr.ifr_name);
+ strlcpy(name, ifr.ifr_name, IFNAMSIZ);
return fd;
}
port, ret);
txq_conf = dev_info.default_txconf;
- txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
txq_conf.offloads = local_port_conf.txmode.offloads;
ret = rte_eth_tx_queue_setup(port, 0, nb_txd,
rte_eth_dev_socket_id(port),
}
/* Get number of ports found in scan */
- nb_sys_ports = rte_eth_dev_count();
+ nb_sys_ports = rte_eth_dev_count_avail();
if (nb_sys_ports == 0)
FATAL_ERROR("No supported Ethernet device found");
/* Find highest port set in portmask */