X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pmd%2Fmacfwd.c;h=d2ebb11054090a0ed7a3007407eb0b12f4c37603;hb=0a82b96e36746608eee9f1f71e2258d9c0099575;hp=2adce7019081b6fb8e2745cfe9e5fa2994ccb70a;hpb=3eecba267cd60fec245000b7d44f97130a7dd2ac;p=dpdk.git diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c index 2adce70190..d2ebb11054 100644 --- a/app/test-pmd/macfwd.c +++ b/app/test-pmd/macfwd.c @@ -49,7 +49,7 @@ pkt_burst_mac_forward(struct fwd_stream *fs) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct rte_port *txp; struct rte_mbuf *mb; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint32_t retry; uint16_t nb_rx; uint16_t nb_tx; @@ -91,14 +91,15 @@ pkt_burst_mac_forward(struct fwd_stream *fs) rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1], void *)); mb = pkts_burst[i]; - eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); - ether_addr_copy(&peer_eth_addrs[fs->peer_addr], + eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *); + rte_ether_addr_copy(&peer_eth_addrs[fs->peer_addr], ð_hdr->d_addr); - ether_addr_copy(&ports[fs->tx_port].eth_addr, + rte_ether_addr_copy(&ports[fs->tx_port].eth_addr, ð_hdr->s_addr); - mb->ol_flags = ol_flags; - mb->l2_len = sizeof(struct ether_hdr); - mb->l3_len = sizeof(struct ipv4_hdr); + mb->ol_flags &= IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF; + mb->ol_flags |= ol_flags; + mb->l2_len = sizeof(struct rte_ether_hdr); + mb->l3_len = sizeof(struct rte_ipv4_hdr); mb->vlan_tci = txp->tx_vlan_id; mb->vlan_tci_outer = txp->tx_vlan_id_outer; }