[dpdk-dev] [PATCH 11/17] app/test: support of unified packet type

Helin Zhang helin.zhang at intel.com
Thu Jan 29 04:15:59 CET 2015


To unify packet types among all PMDs, bit masks and relevant macros
of packet type for ol_flags are replaced by unified packet type and
relevant macros.

Signed-off-by: Helin Zhang <helin.zhang at intel.com>
---
 app/test/packet_burst_generator.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index 4a89663..0a936ea 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -258,18 +258,16 @@ nomore_mbuf:
 			pkt->vlan_tci  = ETHER_TYPE_IPv4;
 			pkt->l3_len = sizeof(struct ipv4_hdr);
 
+			pkt->packet_type = RTE_PTYPE_L3_IPV4;
 			if (vlan_enabled)
-				pkt->ol_flags = PKT_RX_IPV4_HDR | PKT_RX_VLAN_PKT;
-			else
-				pkt->ol_flags = PKT_RX_IPV4_HDR;
+				pkt->ol_flags = PKT_RX_VLAN_PKT;
 		} else {
 			pkt->vlan_tci  = ETHER_TYPE_IPv6;
 			pkt->l3_len = sizeof(struct ipv6_hdr);
 
+			pkt->packet_type = RTE_PTYPE_L3_IPV6;
 			if (vlan_enabled)
-				pkt->ol_flags = PKT_RX_IPV6_HDR | PKT_RX_VLAN_PKT;
-			else
-				pkt->ol_flags = PKT_RX_IPV6_HDR;
+				pkt->ol_flags = PKT_RX_VLAN_PKT;
 		}
 
 		pkts_burst[nb_pkt] = pkt;
-- 
1.8.1.4



More information about the dev mailing list