ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
if (name && *name)
- rte_snprintf(ifr.ifr_name, IFNAMSIZ, name);
+ snprintf(ifr.ifr_name, IFNAMSIZ, "%s", name);
ret = ioctl(fd, TUNSETIFF, (void *) &ifr);
if (ret < 0) {
}
if (name)
- rte_snprintf(name, IFNAMSIZ, ifr.ifr_name);
+ snprintf(name, IFNAMSIZ, "%s", ifr.ifr_name);
return fd;
}
if ((1ULL << lcore_id) & input_cores_mask) {
/* Create new tap interface */
- rte_snprintf(tap_name, IFNAMSIZ, "tap_dpdk_%.2u", lcore_id);
+ snprintf(tap_name, IFNAMSIZ, "tap_dpdk_%.2u", lcore_id);
tap_fd = tap_create(tap_name);
if (tap_fd < 0)
FATAL_ERROR("Could not create tap interface \"%s\" (%d)",
}
else if ((1ULL << lcore_id) & output_cores_mask) {
/* Create new tap interface */
- rte_snprintf(tap_name, IFNAMSIZ, "tap_dpdk_%.2u", lcore_id);
+ snprintf(tap_name, IFNAMSIZ, "tap_dpdk_%.2u", lcore_id);
tap_fd = tap_create(tap_name);
if (tap_fd < 0)
FATAL_ERROR("Could not create tap interface \"%s\" (%d)",
if (m == NULL)
continue;
- ret = read(tap_fd, m->pkt.data, MAX_PACKET_SZ);
+ ret = read(tap_fd, rte_pktmbuf_mtod(m, void *),
+ MAX_PACKET_SZ);
lcore_stats[lcore_id].rx++;
if (unlikely(ret < 0)) {
FATAL_ERROR("Reading from %s interface failed",
tap_name);
}
- m->pkt.nb_segs = 1;
- m->pkt.next = NULL;
- m->pkt.pkt_len = (uint16_t)ret;
- m->pkt.data_len = (uint16_t)ret;
+ m->nb_segs = 1;
+ m->next = NULL;
+ m->pkt_len = (uint16_t)ret;
+ m->data_len = (uint16_t)ret;
ret = rte_eth_tx_burst(port_ids[lcore_id], 0, &m, 1);
if (unlikely(ret < 1)) {
rte_pktmbuf_free(m);
return -1;
}
- /* Scan PCI bus for recognised devices */
- ret = rte_eal_pci_probe();
- if (ret < 0)
- FATAL_ERROR("Could not probe PCI (%d)", ret);
-
/* Get number of ports found in scan */
nb_sys_ports = rte_eth_dev_count();
if (nb_sys_ports == 0)