mbuf: flatten struct vlan_macip
[dpdk.git] / app / test-pmd / csumonly.c
index dc2068f..28b66f5 100644 (file)
@@ -263,7 +263,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
                pkt_ol_flags = mb->ol_flags;
                ol_flags = (uint16_t) (pkt_ol_flags & (~PKT_TX_L4_MASK));
 
-               eth_hdr = (struct ether_hdr *) mb->pkt.data;
+               eth_hdr = (struct ether_hdr *) mb->data;
                eth_type = rte_be_to_cpu_16(eth_hdr->ether_type);
                if (eth_type == ETHER_TYPE_VLAN) {
                        /* Only allow single VLAN label here */
@@ -313,6 +313,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
                                ol_flags |= PKT_TX_IP_CKSUM;
                        }
                        else {
+                               ol_flags |= PKT_TX_IPV4;
                                /* SW checksum calculation */
                                ipv4_hdr->src_addr++;
                                ipv4_hdr->hdr_checksum = get_ipv4_cksum(ipv4_hdr);
@@ -373,6 +374,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
                                        unsigned char *) + l2_len);
                        l3_len = sizeof(struct ipv6_hdr) ;
                        l4_proto = ipv6_hdr->proto;
+                       ol_flags |= PKT_TX_IPV6;
 
                        if (l4_proto == IPPROTO_UDP) {
                                udp_hdr = (struct udp_hdr*) (rte_pktmbuf_mtod(mb,
@@ -430,8 +432,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
                }
 
                /* Combine the packet header write. VLAN is not consider here */
-               mb->pkt.vlan_macip.f.l2_len = l2_len;
-               mb->pkt.vlan_macip.f.l3_len = l3_len;
+               mb->l2_len = l2_len;
+               mb->l3_len = l3_len;
                mb->ol_flags = ol_flags;
        }
        nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_rx);