From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 005877F6D for ; Thu, 16 Jul 2015 01:57:43 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 15 Jul 2015 16:57:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,484,1432623600"; d="scan'208";a="748169108" Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88]) by fmsmga001.fm.intel.com with ESMTP; 15 Jul 2015 16:57:42 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by KMSMSX153.gar.corp.intel.com (172.21.73.88) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 16 Jul 2015 07:57:40 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.129]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.246]) with mapi id 14.03.0224.002; Thu, 16 Jul 2015 07:57:39 +0800 From: "Zhang, Helin" To: Thomas Monjalon Thread-Topic: [PATCH] mbuf: fix tunnel flags check Thread-Index: AQHQv1k/jdyLUUInG06u/yHXb/Aqc53dNRCQ Date: Wed, 15 Jul 2015 23:57:39 +0000 Message-ID: References: <1437004212-31646-1-git-send-email-thomas.monjalon@6wind.com> In-Reply-To: <1437004212-31646-1-git-send-email-thomas.monjalon@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] mbuf: fix tunnel flags check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2015 23:57:44 -0000 > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Wednesday, July 15, 2015 4:50 PM > To: Zhang, Helin > Cc: olivier.matz@6wind.com; dev@dpdk.org > Subject: [PATCH] mbuf: fix tunnel flags check >=20 > A packet is tunnelled if the tunnel type is identified or if it has an in= ner part. >=20 > Fix also a typo in RTE_PTYPE_INNER_L3_MASK. >=20 > Fixes: f295a00a2b44 ("mbuf: add definitions of unified packet types") >=20 > Signed-off-by: Thomas Monjalon > --- > app/test-pmd/rxonly.c | 2 +- > lib/librte_mbuf/rte_mbuf.h | 7 +++++-- > 2 files changed, 6 insertions(+), 3 deletions(-) >=20 > diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c index > 41871d3..ee7fd8d 100644 > --- a/app/test-pmd/rxonly.c > +++ b/app/test-pmd/rxonly.c > @@ -288,7 +288,7 @@ pkt_burst_receive(struct fwd_stream *fs) > } >=20 > /* inner L3 packet type */ > - ptype =3D mb->packet_type & > RTE_PTYPE_INNER_INNER_L3_MASK; > + ptype =3D mb->packet_type & RTE_PTYPE_INNER_L3_MASK; > switch (ptype) { > case RTE_PTYPE_INNER_L3_IPV4: > printf(" - Inner L3 type: IPV4"); > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h inde= x > 115c560..dbd9095 100644 > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -595,7 +595,7 @@ extern "C" { > /** > * Mask of inner layer 3 packet types. > */ > -#define RTE_PTYPE_INNER_INNER_L3_MASK 0x00f00000 > +#define RTE_PTYPE_INNER_L3_MASK 0x00f00000 > /** > * TCP (Transmission Control Protocol) packet type. > * It is used for inner packet only. > @@ -689,7 +689,10 @@ extern "C" { > #define RTE_ETH_IS_IPV6_HDR(ptype) ((ptype) & RTE_PTYPE_L3_IPV6) >=20 > /* Check if it is a tunneling packet */ -#define RTE_ETH_IS_TUNNEL_PKT(p= type) > ((ptype) & RTE_PTYPE_TUNNEL_MASK) > +#define RTE_ETH_IS_TUNNEL_PKT(ptype) ((ptype) & > (RTE_PTYPE_TUNNEL_MASK | \ > + > RTE_PTYPE_INNER_L2_MASK | \ > + > RTE_PTYPE_INNER_L3_MASK | \ > + > +RTE_PTYPE_INNER_L4_MASK)) > #endif /* RTE_NEXT_ABI */ Could you help to explain more of why here? My understanding is that if an inner one can be recognized, there must be a= tunnel type there. Regards, Helin >=20 > /** > -- > 2.4.2