From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 84CD129CB for ; Thu, 25 Feb 2016 11:57:36 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 25 Feb 2016 02:57:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,498,1449561600"; d="scan'208";a="54521901" Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by fmsmga004.fm.intel.com with ESMTP; 25 Feb 2016 02:57:34 -0800 Received: from irsmsx156.ger.corp.intel.com (10.108.20.68) by IRSMSX109.ger.corp.intel.com (163.33.3.23) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 25 Feb 2016 10:57:33 +0000 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.237]) by IRSMSX156.ger.corp.intel.com ([169.254.3.132]) with mapi id 14.03.0248.002; Thu, 25 Feb 2016 10:57:33 +0000 From: "Ananyev, Konstantin" To: "Tan, Jianfeng" , "dev@dpdk.org" Thread-Topic: [PATCH v2 12/12] examples/l3fwd: add option to parse ptype Thread-Index: AQHRT5LIaPUSmkxXbEueg+ZMmP7c+p78ptxwgEAsBgCAAALPgA== Date: Thu, 25 Feb 2016 10:57:32 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836B0B278@irsmsx105.ger.corp.intel.com> References: <1451544799-70776-1-git-send-email-jianfeng.tan@intel.com> <1452836759-63540-1-git-send-email-jianfeng.tan@intel.com> <1452836759-63540-13-git-send-email-jianfeng.tan@intel.com> <2601191342CEEE43887BDE71AB97725836AE6144@irsmsx105.ger.corp.intel.com> <56CEDA3C.6010402@intel.com> In-Reply-To: <56CEDA3C.6010402@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWQ3MjkzMmEtZjhlZi00MzA1LWJmMGItMjdiNmE5NDJhMTI2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ik9xOG5MbW13bVBURzEzZFV2K3ZZMEwwVDZuV250b3h2TmRQcXErWTdWZE09In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 12/12] examples/l3fwd: add option to parse ptype 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, 25 Feb 2016 10:57:37 -0000 Hi Jianfeng, > -----Original Message----- > From: Tan, Jianfeng > Sent: Thursday, February 25, 2016 10:41 AM > To: Ananyev, Konstantin; dev@dpdk.org > Cc: Zhang, Helin > Subject: Re: [PATCH v2 12/12] examples/l3fwd: add option to parse ptype >=20 > Hi Konstantin, >=20 > On 1/15/2016 10:47 PM, Ananyev, Konstantin wrote: > > Hi Jianfeng, > > > >> -----Original Message----- > >> From: Tan, Jianfeng > >> Sent: Friday, January 15, 2016 5:46 AM > >> To: dev@dpdk.org > >> Cc: Zhang, Helin; Ananyev, Konstantin; Tan, Jianfeng > >> Subject: [PATCH v2 12/12] examples/l3fwd: add option to parse ptype > >> > >> As a example to use ptype info, l3fwd needs firstly to use > >> rte_eth_dev_get_ptype_info() API to check if device and/or PMD driver = will > >> parse and fill the needed packet type. If not, use the newly added opt= ion, > >> --parse-ptype, to analyze it in the callback softly. > >> > >> Signed-off-by: Jianfeng Tan > >> --- > >> examples/l3fwd/main.c | 91 +++++++++++++++++++++++++++++++++++++++++= ++++++++++ > >> 1 file changed, 91 insertions(+) > >> > ... > >> +static inline void > >> +parse_packet_type(struct rte_mbuf *m) > >> +{ > >> + struct ether_hdr *eth_hdr; > >> + uint32_t packet_type =3D 0; > >> + uint16_t ethertype; > >> + > >> + eth_hdr =3D rte_pktmbuf_mtod(m, struct ether_hdr *); > >> + ethertype =3D rte_be_to_cpu_16(eth_hdr->ether_type); > >> + switch (ethertype) { > >> + case ETHER_TYPE_IPv4: > >> + packet_type |=3D RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; > >> + break; > >> + case ETHER_TYPE_IPv6: > >> + packet_type |=3D RTE_PTYPE_L3_IPV6_EXT_UNKNOWN; > >> + break; > > That's enough for LPM, for EM, don't we need to be sure there are no ex= tensions > > in the IP header? > > > > Konstantin >=20 > Yes, EM needs to differentiate RTE_PTYPE_L3_IPV4/RTE_PTYPE_L3_IPV4_EXT, > RTE_PTYPE_L3_IPV6/RTE_PTYPE_L3_IPV6_EXT: > a. for soft ptype parser here, I'll add the code to do it. >=20 > b. for hardware ptype parser, things become complex: > those NICs which can differentiate: > e1000 > fmf10k > ixgbe > those NICs which cannot differentiate: > cxgbe (ipv4, ipv6) > enic (ipv4, ipv6) > i40e (ipv4_ext_unknown, ipv6_ext_unknown) Yep, I am aware about that difference between i40e and rest of Intel PMDs = :( > mlx4 (ipv4, ipv6) > mlx5 (ipv4, ipv6) > nfp (ipv4, ipv6, ipv6_ext) > vmxnet3 (ipv4, ipv4_ext) >=20 > As a result, l3fwd can only work perfectly on those NICs which can > differentiate. Well, we can do a SW parsing for that NICs, but I presume it might slowdown things quite a bit.=20 >=20 > SO if we really do the strict checking? Ok, but then we probably need to put into SA guide that l3fwd EM not supposed to work with IP with extentions. Konstantin >=20 > Thanks, > Jianfeng