X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fipv4_multicast%2Fmain.c;h=a047197c7109e67e1385fcc71105e793fc1305ff;hb=6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1;hp=428ca4694ed511109f8bd9c45c44c0a65f5e7346;hpb=91dc9c13ba978fb8147240ed6fa20c41145bf0db;p=dpdk.git diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 428ca4694e..a047197c71 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -80,7 +80,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr ports_eth_addr[MAX_PORTS]; +static struct rte_ether_addr ports_eth_addr[MAX_PORTS]; /* mask of enabled ports */ static uint32_t enabled_port_mask = 0; @@ -254,18 +254,10 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) /* prepend new header */ hdr->next = pkt; - /* update header's fields */ hdr->pkt_len = (uint16_t)(hdr->data_len + pkt->pkt_len); hdr->nb_segs = pkt->nb_segs + 1; - /* 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; - __rte_mbuf_sanity_check(hdr, 1); return hdr; } @@ -275,14 +267,15 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) * and put it into the outgoing queue for the given port. */ static inline void -mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, +mcast_send_pkt(struct rte_mbuf *pkt, struct rte_ether_addr *dest_addr, struct lcore_queue_conf *qconf, uint16_t port) { - struct ether_hdr *ethdr; + struct rte_ether_hdr *ethdr; uint16_t len; /* Construct Ethernet header. */ - ethdr = (struct ether_hdr *)rte_pktmbuf_prepend(pkt, (uint16_t)sizeof(*ethdr)); + ethdr = (struct rte_ether_hdr *) + rte_pktmbuf_prepend(pkt, (uint16_t)sizeof(*ethdr)); RTE_ASSERT(ethdr != NULL); ether_addr_copy(dest_addr, ðdr->d_addr); @@ -310,11 +303,12 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf) uint16_t port; union { uint64_t as_int; - struct ether_addr as_addr; + struct rte_ether_addr as_addr; } dst_eth_addr; /* Remove the Ethernet header from the input packet */ - iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr)); + iphdr = (struct ipv4_hdr *) + rte_pktmbuf_adj(m, (uint16_t)sizeof(struct rte_ether_hdr)); RTE_ASSERT(iphdr != NULL); dest_addr = rte_be_to_cpu_32(iphdr->dst_addr); @@ -543,7 +537,7 @@ parse_args(int argc, char **argv) } static void -print_ethaddr(const char *name, struct ether_addr *eth_addr) +print_ethaddr(const char *name, struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);