net: add rte prefix to ether defines
[dpdk.git] / examples / rxtx_callbacks / main.c
index 46dacc7..640a415 100644 (file)
@@ -19,8 +19,7 @@
 
 static const struct rte_eth_conf port_conf_default = {
        .rxmode = {
-               .max_rx_pkt_len = ETHER_MAX_LEN,
-               .ignore_offload_bitfield = 1,
+               .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
        },
 };
 
@@ -80,7 +79,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
        struct rte_eth_dev_info dev_info;
        struct rte_eth_txconf txconf;
 
-       if (port >= rte_eth_dev_count())
+       if (!rte_eth_dev_is_valid_port(port))
                return -1;
 
        rte_eth_dev_info_get(port, &dev_info);
@@ -104,7 +103,6 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
        }
 
        txconf = dev_info.default_txconf;
-       txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
        txconf.offloads = port_conf.txmode.offloads;
        for (q = 0; q < tx_rings; q++) {
                retval = rte_eth_tx_queue_setup(port, q, nb_txd,
@@ -117,7 +115,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
        if (retval < 0)
                return retval;
 
-       struct ether_addr addr;
+       struct rte_ether_addr addr;
 
        rte_eth_macaddr_get(port, &addr);
        printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8
@@ -188,7 +186,7 @@ main(int argc, char *argv[])
        argc -= ret;
        argv += ret;
 
-       nb_ports = rte_eth_dev_count();
+       nb_ports = rte_eth_dev_count_avail();
        if (nb_ports < 2 || (nb_ports & 1))
                rte_exit(EXIT_FAILURE, "Error: number of ports must be even\n");