ethdev: use constants for link state
[dpdk.git] / examples / ipv4_multicast / main.c
index 575e989..96b4157 100644 (file)
@@ -77,7 +77,7 @@
 #define        MCAST_CLONE_PORTS       2
 #define        MCAST_CLONE_SEGS        2
 
-#define        PKT_MBUF_DATA_SIZE      (2048 + RTE_PKTMBUF_HEADROOM)
+#define        PKT_MBUF_DATA_SIZE      RTE_MBUF_DEFAULT_BUF_SIZE
 #define        NB_PKT_MBUF     8192
 
 #define        HDR_MBUF_DATA_SIZE      (2 * RTE_PKTMBUF_HEADROOM)
@@ -225,7 +225,7 @@ bitcnt(uint32_t v)
        for (n = 0; v != 0; v &= v - 1, n++)
                ;
 
-       return (n);
+       return n;
 }
 
 /**
@@ -278,13 +278,13 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)
 
        /* Create new mbuf for the header. */
        if (unlikely ((hdr = rte_pktmbuf_alloc(header_pool)) == NULL))
-               return (NULL);
+               return NULL;
 
        /* If requested, then make a new clone packet. */
        if (use_clone != 0 &&
            unlikely ((pkt = rte_pktmbuf_clone(pkt, clone_pool)) == NULL)) {
                rte_pktmbuf_free(hdr);
-               return (NULL);
+               return NULL;
        }
 
        /* prepend new header */
@@ -298,13 +298,14 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)
        /* copy metadata from source packet*/
        hdr->port = pkt->port;
        hdr->vlan_tci = pkt->vlan_tci;
+       hdr->vlan_tci_outer = pkt->vlan_tci_outer;
        hdr->tx_offload = pkt->tx_offload;
        hdr->hash = pkt->hash;
 
        hdr->ol_flags = pkt->ol_flags;
 
        __rte_mbuf_sanity_check(hdr, 1);
-       return (hdr);
+       return hdr;
 }
 
 /*
@@ -508,7 +509,7 @@ parse_portmask(const char *portmask)
        if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0'))
                return 0;
 
-       return ((uint32_t)pm);
+       return (uint32_t)pm;
 }
 
 static int
@@ -522,9 +523,9 @@ parse_nqueue(const char *q_arg)
        n = strtoul(q_arg, &end, 0);
        if (errno != 0 || end == NULL || *end != '\0' ||
                        n == 0 || n >= MAX_RX_QUEUE_PER_LCORE)
-               return (-1);
+               return -1;
 
-       return (n);
+       return n;
 }
 
 /* Parse the argument given in the command line of the application */
@@ -641,7 +642,7 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
                                continue;
                        }
                        /* clear all_ports_up flag if any link down */
-                       if (link.link_status == 0) {
+                       if (link.link_status == ETH_LINK_DOWN) {
                                all_ports_up = 0;
                                break;
                        }