From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 511BD4CE4 for ; Fri, 26 Feb 2016 15:21:09 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 26 Feb 2016 06:21:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,498,1449561600"; d="scan'208";a="895485326" Received: from shwdeisgchi083.ccr.corp.intel.com (HELO [10.239.67.193]) ([10.239.67.193]) by orsmga001.jf.intel.com with ESMTP; 26 Feb 2016 06:21:06 -0800 To: "Ananyev, Konstantin" , "dev@dpdk.org" References: <1451544799-70776-1-git-send-email-jianfeng.tan@intel.com> <1456445371-147264-1-git-send-email-jianfeng.tan@intel.com> <1456445371-147264-13-git-send-email-jianfeng.tan@intel.com> <2601191342CEEE43887BDE71AB97725836B0BB05@irsmsx105.ger.corp.intel.com> From: "Tan, Jianfeng" Message-ID: <56D05F51.5020806@intel.com> Date: Fri, 26 Feb 2016 22:21:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <2601191342CEEE43887BDE71AB97725836B0BB05@irsmsx105.ger.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 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: Fri, 26 Feb 2016 14:21:09 -0000 Hi Konstantin, On 2/26/2016 9:14 PM, Ananyev, Konstantin wrote: > Hi Jianfeng, > >> +static int ... >> + if (hdr_len == sizeof(struct ipv4_hdr) && >> + (hdr->next_proto_id == 6 || >> + hdr->next_proto_id == 17)) > Use IPPORTO_UDP, IPPORTO_TCP instead of hardcoded values. Yes, will fix it. >> + packet_type |= RTE_PTYPE_L3_IPV4; >> + } > Actually it is a good point: > for EM case should l3fwd process only TCP/UDP packets? > If yes, then it needs to check not only L3, but also L4 type too > Which means that for EM and LPM check_packet_type_ok() should also be different. > Or we can leave it as it is - in that case EM even for non UDP/TCP packet would still > do route lookup using first 4B of L3 payload. I'd like to follow the first approach, (if nobody strongly objects to it), because it's EM's real intention to use 5 tuples. > If you choose first approach, then there is another thing to consider - > there are 2 patches in flight for l3fwd: > http://dpdk.org/dev/patchwork/patch/10800/ > http://dpdk.org/dev/patchwork/patch/10782/ > > Which makes LPM/EM choice for l3fwd a runtime decision. > So APP_LOOKUP_METHOD macro would not be available after it. > Probably need to take that into account for your changes. > Might be exclude l3fwd from this patch series, then rebase it > on these patches and submit as a separate one? Thanks for reminding me of this. And that sounds a good idea to me. This commit will be excluded and submitted as a separate one. >> +#elif (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) >> + packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; >> +#endif >> + break; >> + case ETHER_TYPE_IPv6: >> +#if (APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH) >> + { >> + struct ipv6_hdr *hdr; >> + >> + hdr = (struct ipv6_hdr *)((uint8_t *)eth_hdr + >> + sizeof(struct ether_hdr)); >> + if (hdr->proto == 6 || hdr->proto == 17) >> + packet_type |= RTE_PTYPE_L3_IPV4; > s/ RTE_PTYPE_L3_IPV4/RTE_PTYPE_L3_IPV6/ > ? Oops, nice catch. Will fix it. Thanks, Jianfeng > Apart from that the series looks good to me. > Konstantin >