From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D632695AC for ; Thu, 7 Jan 2016 10:44:43 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP; 07 Jan 2016 01:44:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,532,1444719600"; d="scan'208";a="876286509" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by fmsmga001.fm.intel.com with ESMTP; 07 Jan 2016 01:44:43 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.104]) by IRSMSX153.ger.corp.intel.com ([169.254.9.170]) with mapi id 14.03.0248.002; Thu, 7 Jan 2016 09:44:38 +0000 From: "Ananyev, Konstantin" To: "Tan, Jianfeng" , "dev@dpdk.org" Thread-Topic: [PATCH 12/12] examples/l3fwd: add option to parse ptype Thread-Index: AQHRQ9KvyEachG7b/02o97KzXN+Oyp7rscFggACMggCAAOoeQIACIxeAgACLQHA= Date: Thu, 7 Jan 2016 09:44:38 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836AE2F0C@irsmsx105.ger.corp.intel.com> References: <1451544799-70776-1-git-send-email-jianfeng.tan@intel.com> <1451544799-70776-13-git-send-email-jianfeng.tan@intel.com> <2601191342CEEE43887BDE71AB97725836AE1333@irsmsx105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB97725836AE18CF@irsmsx105.ger.corp.intel.com> <568DBD4D.3000207@intel.com> In-Reply-To: <568DBD4D.3000207@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 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, 07 Jan 2016 09:44:44 -0000 Hi Jianfeng, > -----Original Message----- > From: Tan, Jianfeng > Sent: Thursday, January 07, 2016 1:20 AM > To: Ananyev, Konstantin; dev@dpdk.org > Cc: Zhang, Helin > Subject: Re: [PATCH 12/12] examples/l3fwd: add option to parse ptype >=20 >=20 > Hi Konstantin, >=20 > On 1/6/2016 12:49 AM, Ananyev, Konstantin wrote: > > Hi Jianfeng, > > > >>>> +static int > >>>> +check_packet_type_ok(int portid) > >>>> +{ > >>>> + int i; > >>>> + int ret; > >>>> + uint32_t ptypes[RTE_PTYPE_L3_MAX_NUM]; > >>>> + int ptype_l3_ipv4 =3D 0, ptype_l3_ipv6 =3D 0; > >>>> + > >>>> + ret =3D rte_eth_dev_get_ptype_info(portid, RTE_PTYPE_L3_MASK, > >>> ptypes); > >>>> + for (i =3D 0; i < ret; ++i) { > >>>> + if (ptypes[i] & RTE_PTYPE_L3_IPV4) > >>>> + ptype_l3_ipv4 =3D 1; > >>>> + if (ptypes[i] & RTE_PTYPE_L3_IPV6) > >>>> + ptype_l3_ipv6 =3D 1; > >>>> + } > >>>> + > >>>> + if (ptype_l3_ipv4 =3D=3D 0) > >>>> + printf("port %d cannot parse RTE_PTYPE_L3_IPV4\n", portid); > >>>> + > >>>> + if (ptype_l3_ipv6 =3D=3D 0) > >>>> + printf("port %d cannot parse RTE_PTYPE_L3_IPV6\n", portid); > >>>> + > >>>> + if (ptype_l3_ipv4 || ptype_l3_ipv6) > >>>> + return 1; > > > > Forgot one thing: I think it should be: > > > > if (ptype_l3_ipv4 && ptype_l3_ipv6) > > return 1; > > return 0; > > > > or just: > > > > return ptype_l3_ipv4 && ptype_l3_ipv6; >=20 > My original thought is: PMDs, like vmxnet3, fills ptype_l3_ipv4, but not > ptype_l3_ipv6. > If we use "&&", then it would add rx callback to parse ptype whether > ipv4 or ipv6 traffic is comming. Yes, I think that's how it should be: If HW can't recognise either IPV4 or IPV6 packets, then SW parsing needs to= be done. l3fwd relies on PMD to recognise both IPV4 and IPV6 packets properly. If it can recognise only IPV4, then IPV6 traffic will not be forwarded corr= ectly, and visa-versa. =20 Konstantin >=20 > Thanks, > Jianfeng >=20 > > > > Konstantin