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 878779589 for ; Thu, 7 Jan 2016 02:20:15 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 06 Jan 2016 17:20:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,531,1444719600"; d="scan'208";a="629211876" Received: from shwdeisgchi083.ccr.corp.intel.com (HELO [10.239.67.119]) ([10.239.67.119]) by FMSMGA003.fm.intel.com with ESMTP; 06 Jan 2016 17:20:13 -0800 To: "Ananyev, Konstantin" , "dev@dpdk.org" 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> From: "Tan, Jianfeng" Message-ID: <568DBD4D.3000207@intel.com> Date: Thu, 7 Jan 2016 09:20:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <2601191342CEEE43887BDE71AB97725836AE18CF@irsmsx105.ger.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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 01:20:15 -0000 Hi Konstantin, 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 = 0, ptype_l3_ipv6 = 0; >>>> + >>>> + ret = rte_eth_dev_get_ptype_info(portid, RTE_PTYPE_L3_MASK, >>> ptypes); >>>> + for (i = 0; i < ret; ++i) { >>>> + if (ptypes[i] & RTE_PTYPE_L3_IPV4) >>>> + ptype_l3_ipv4 = 1; >>>> + if (ptypes[i] & RTE_PTYPE_L3_IPV6) >>>> + ptype_l3_ipv6 = 1; >>>> + } >>>> + >>>> + if (ptype_l3_ipv4 == 0) >>>> + printf("port %d cannot parse RTE_PTYPE_L3_IPV4\n", portid); >>>> + >>>> + if (ptype_l3_ipv6 == 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; 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. Thanks, Jianfeng > > Konstantin