X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fl2fwd%2Fmain.c;h=8feb50e0f542e0f162e5d0783e7724b687052b91;hb=25829b55b463f7bb0b69af0e63b19121a16d2a63;hp=911e40c66e0ed5301d133fd529a6def34f49c81d;hpb=9a212dc06c7aaf09b146d9c3dcfd584d741634c1;p=dpdk.git diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 911e40c66e..8feb50e0f5 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -170,11 +169,11 @@ l2fwd_mac_updating(struct rte_mbuf *m, unsigned dest_portid) eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */ - tmp = ð->d_addr.addr_bytes[0]; + tmp = ð->dst_addr.addr_bytes[0]; *((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dest_portid << 40); /* src addr */ - rte_ether_addr_copy(&l2fwd_ports_eth_addr[dest_portid], ð->s_addr); + rte_ether_addr_copy(&l2fwd_ports_eth_addr[dest_portid], ð->src_addr); } /* Simple forward. 8< */ @@ -879,14 +878,9 @@ main(int argc, char **argv) "rte_eth_promiscuous_enable:err=%s, port=%u\n", rte_strerror(-ret), portid); - printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - portid, - l2fwd_ports_eth_addr[portid].addr_bytes[0], - l2fwd_ports_eth_addr[portid].addr_bytes[1], - l2fwd_ports_eth_addr[portid].addr_bytes[2], - l2fwd_ports_eth_addr[portid].addr_bytes[3], - l2fwd_ports_eth_addr[portid].addr_bytes[4], - l2fwd_ports_eth_addr[portid].addr_bytes[5]); + printf("Port %u, MAC address: " RTE_ETHER_ADDR_PRT_FMT "\n\n", + portid, + RTE_ETHER_ADDR_BYTES(&l2fwd_ports_eth_addr[portid])); /* initialize port stats */ memset(&port_statistics, 0, sizeof(port_statistics));