From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <hzhan75@shecgisg004.sh.intel.com>
Received: from mga09.intel.com (mga09.intel.com [134.134.136.24])
 by dpdk.org (Postfix) with ESMTP id 25A299A81
 for <dev@dpdk.org>; Fri, 27 Feb 2015 14:12:33 +0100 (CET)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP; 27 Feb 2015 05:08:07 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.09,659,1418112000"; d="scan'208";a="672647469"
Received: from shvmail01.sh.intel.com ([10.239.29.42])
 by fmsmga001.fm.intel.com with ESMTP; 27 Feb 2015 05:12:26 -0800
Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com
 [10.239.29.89])
 by shvmail01.sh.intel.com with ESMTP id t1RDCNW6030386;
 Fri, 27 Feb 2015 21:12:23 +0800
Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1])
 by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id
 t1RDCJse023311; Fri, 27 Feb 2015 21:12:21 +0800
Received: (from hzhan75@localhost)
 by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t1RDCJ7F023307;
 Fri, 27 Feb 2015 21:12:19 +0800
From: Helin Zhang <helin.zhang@intel.com>
To: dev@dpdk.org
Date: Fri, 27 Feb 2015 21:11:34 +0800
Message-Id: <1425042696-23162-17-git-send-email-helin.zhang@intel.com>
X-Mailer: git-send-email 1.7.4.1
In-Reply-To: <1425042696-23162-1-git-send-email-helin.zhang@intel.com>
References: <1424156374-21768-1-git-send-email-helin.zhang@intel.com>
 <1425042696-23162-1-git-send-email-helin.zhang@intel.com>
Subject: [dpdk-dev] [PATCH v4 16/18] examples/l3fwd-power: support of
	unified packet type
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 27 Feb 2015 13:12:35 -0000

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

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 examples/l3fwd-power/main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

v2 changes:
* Used redefined packet types and enlarged packet_type field in mbuf.

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index f6b55b9..964e5b9 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -638,7 +638,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid,
 
 	eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
 
-	if (m->ol_flags & PKT_RX_IPV4_HDR) {
+	if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
 		/* Handle IPv4 headers.*/
 		ipv4_hdr =
 			(struct ipv4_hdr *)(rte_pktmbuf_mtod(m, unsigned char*)
@@ -673,8 +673,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid,
 		ether_addr_copy(&ports_eth_addr[dst_port], &eth_hdr->s_addr);
 
 		send_single_packet(m, dst_port);
-	}
-	else {
+	} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
 		/* Handle IPv6 headers.*/
 #if (APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH)
 		struct ipv6_hdr *ipv6_hdr;
-- 
1.9.3