X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fipv4_multicast%2Fmain.c;h=708d76e9af6dc3790b6ed68f0174da9a8bbf0e64;hb=ade188a51664a32eea120a995ce84661294cc8af;hp=d4253c0ec2a59fd9a8abffee464886a9d064ae65;hpb=1e6854467495523e4fba728b3e5611020523a2eb;p=dpdk.git diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index d4253c0ec2..708d76e9af 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -63,7 +63,6 @@ #include #include #include -#include #include #include #include @@ -225,7 +224,7 @@ bitcnt(uint32_t v) for (n = 0; v != 0; v &= v - 1, n++) ; - return (n); + return n; } /** @@ -278,13 +277,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 */ @@ -305,7 +304,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) hdr->ol_flags = pkt->ol_flags; __rte_mbuf_sanity_check(hdr, 1); - return (hdr); + return hdr; } /* @@ -321,7 +320,7 @@ mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, /* Construct Ethernet header. */ ethdr = (struct ether_hdr *)rte_pktmbuf_prepend(pkt, (uint16_t)sizeof(*ethdr)); - RTE_MBUF_ASSERT(ethdr != NULL); + RTE_ASSERT(ethdr != NULL); ether_addr_copy(dest_addr, ðdr->d_addr); ether_addr_copy(&ports_eth_addr[port], ðdr->s_addr); @@ -353,7 +352,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf) /* Remove the Ethernet header from the input packet */ iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr)); - RTE_MBUF_ASSERT(iphdr != NULL); + RTE_ASSERT(iphdr != NULL); dest_addr = rte_be_to_cpu_32(iphdr->dst_addr); @@ -509,7 +508,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 @@ -523,9 +522,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 */ @@ -642,7 +641,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; }