dma/hisilicon: use common PCI device naming
[dpdk.git] / examples / flow_classify / flow_classify.c
index db71f5a..6185b34 100644 (file)
@@ -59,14 +59,6 @@ static struct{
 } parm_config;
 const char cb_port_delim[] = ":";
 
-/* Ethernet ports configured with default settings using struct. 8< */
-static const struct rte_eth_conf port_conf_default = {
-       .rxmode = {
-               .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-       },
-};
-/* >8 End of configuration of Ethernet ports. */
-
 /* Creation of flow classifier object. 8< */
 struct flow_classifier {
        struct rte_flow_classifier *cls;
@@ -200,7 +192,7 @@ static struct rte_flow_attr attr;
 static inline int
 port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 {
-       struct rte_eth_conf port_conf = port_conf_default;
+       struct rte_eth_conf port_conf;
        struct rte_ether_addr addr;
        const uint16_t rx_rings = 1, tx_rings = 1;
        int retval;
@@ -211,6 +203,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
        if (!rte_eth_dev_is_valid_port(port))
                return -1;
 
+       memset(&port_conf, 0, sizeof(struct rte_eth_conf));
+
        retval = rte_eth_dev_info_get(port, &dev_info);
        if (retval != 0) {
                printf("Error during getting device (port %u) info: %s\n",
@@ -218,9 +212,9 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
                return retval;
        }
 
-       if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+       if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)
                port_conf.txmode.offloads |=
-                       DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+                       RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
 
        /* Configure the Ethernet device. */
        retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
@@ -258,10 +252,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 
        printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
                           " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-                       port,
-                       addr.addr_bytes[0], addr.addr_bytes[1],
-                       addr.addr_bytes[2], addr.addr_bytes[3],
-                       addr.addr_bytes[4], addr.addr_bytes[5]);
+                       port, RTE_ETHER_ADDR_BYTES(&addr));
 
        /* Enable RX in promiscuous mode for the Ethernet device. */
        retval = rte_eth_promiscuous_enable(port);