From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: Re: supported packet types Date: Tue, 21 Jun 2016 10:58:43 +0200 Message-ID: <576901C3.2040906@6wind.com> References: <57237A88.6030807@6wind.com> <2601191342CEEE43887BDE71AB97725836B43013@irsmsx105.ger.corp.intel.com> <57592168.2020702@6wind.com> <2601191342CEEE43887BDE71AB97725836B718E1@irsmsx105.ger.corp.intel.com> <57625A03.1090209@6wind.com> <2601191342CEEE43887BDE71AB97725836B7222E@irsmsx105.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" , "Tan, Jianfeng" , Adrien Mazarguil To: "Ananyev, Konstantin" Return-path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id CD97FADF8 for ; Tue, 21 Jun 2016 10:58:50 +0200 (CEST) In-Reply-To: <2601191342CEEE43887BDE71AB97725836B7222E@irsmsx105.ger.corp.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Konstantin, On 06/16/2016 01:29 PM, Ananyev, Konstantin wrote: >>>> I suggest instead to set the ptype >>>> in an opportunistic fashion instead: >>>> - if the driver/hw knows the ptype, set it >>>> - else, set it to unknown >>> >>> That's what PMD does now... and I don't think it can do much more - >>> only interpret information provided by the HW in a proper way. >>> Probably I misunderstood you here... >> >> My suggestion was to remove get_supported_ptypes an set the ptype in >> mbuf when the pmd recognize a type. >> >> But we could also keep get_supported_ptypes() for ptypes that will >> always be recognized, allowing a PMD to set any other ptype if it >> is recognized. This is probably what we have today in some PMDs, I >> think it just requires some clarification. > > Yes, +1 to the second option. What about the following API comment? ''' Retrieve the supported packet types of an Ethernet device. When a packet type is announced as supported, it *must* be recognized by the PMD. For instance, if RTE_PTYPE_L2_ETHER, RTE_PTYPE_L2_ETHER_VLAN and RTE_PTYPE_L3_IPV4 are announced, the PMD must return the following packet types for these packets: - Ether/IPv4 -> RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4 - Ether/Vlan/IPv4 -> RTE_PTYPE_L2_ETHER_VLAN | RTE_PTYPE_L3_IPV4 - Ether/ -> RTE_PTYPE_L2_ETHER - Ether/Vlan/ -> RTE_PTYPE_L2_ETHER_VLAN When a packet is received by a PMD, the most precise type must be returned among the ones supported. However a PMD is allowed to set packet type that is not in the supported list, at the condition that it is more precise. Therefore, a PMD announcing no supported packet types can still set a matching packet type in a received packet. ''' If it's fine I'll submit it as a patch. Regards, Olivier