From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1bFHYW-0000lM-DA; Tue, 21 Jun 2016 11:01:13 +0200 To: "Ananyev, Konstantin" 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> Cc: "dev@dpdk.org" , "Tan, Jianfeng" , Adrien Mazarguil From: Olivier Matz Message-ID: <576901C3.2040906@6wind.com> Date: Tue, 21 Jun 2016 10:58:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <2601191342CEEE43887BDE71AB97725836B7222E@irsmsx105.ger.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] supported packet types 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: Tue, 21 Jun 2016 08:58:50 -0000 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