From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id B8FA45A32 for ; Thu, 16 Jul 2015 02:38:03 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 15 Jul 2015 17:38:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,484,1432623600"; d="scan'208";a="607061390" Received: from kmsmsx154.gar.corp.intel.com ([172.21.73.14]) by orsmga003.jf.intel.com with ESMTP; 15 Jul 2015 17:38:01 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by KMSMSX154.gar.corp.intel.com (172.21.73.14) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 16 Jul 2015 08:37:00 +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 08:36:57 +0800 From: "Zhang, Helin" To: Thomas Monjalon Thread-Topic: [PATCH] mbuf: fix tunnel flags check Thread-Index: AQHQv1k/jdyLUUInG06u/yHXb/Aqc53dNRCQ//9+iYCAAIp9cA== Date: Thu, 16 Jul 2015 00:36:56 +0000 Message-ID: References: <1437004212-31646-1-git-send-email-thomas.monjalon@6wind.com> <28177519.UZIomONHXn@xps13> In-Reply-To: <28177519.UZIomONHXn@xps13> 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: Thu, 16 Jul 2015 00:38:04 -0000 > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Wednesday, July 15, 2015 5:13 PM > To: Zhang, Helin > Cc: olivier.matz@6wind.com; dev@dpdk.org > Subject: Re: [PATCH] mbuf: fix tunnel flags check >=20 > 2015-07-15 23:57, Zhang, Helin: > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > > A packet is tunnelled if the tunnel type is identified or if it has a= n inner part. > > > > > > Fix also a typo in RTE_PTYPE_INNER_L3_MASK. > > > > > > Fixes: f295a00a2b44 ("mbuf: add definitions of unified packet > > > types") > > > > > > Signed-off-by: Thomas Monjalon > |...] > > > /* Check if it is a tunneling packet */ -#define > > > RTE_ETH_IS_TUNNEL_PKT(ptype) ((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)) > > > > 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. >=20 > Not always. > It was my comment in mlx4 patch: > http://dpdk.org/ml/archives/dev/2015-July/021702.html > Currently we can know that mlx4 has detected a tunnel but don't know whic= h > one. I'd suggest to do more in mlx4 driver, rather than adding more checks in th= is macro. If it can detect the inner l2/l3 type, the driver should tell it is a tunne= led packet. If it cannot know which tunnel it is, I'd suggest to add one more tunnel ty= pe of RTE_PTYPE_TUNNEL_UNKNOWN. Two reasons: - PMD should tell enough info to high level caller or application. It shoul= d be clear enough. - Adding more checks in those macro results in more cpu cycles for other NI= Cs to check the packet types. Regards, Helin