From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A7377A00E6 for ; Fri, 9 Aug 2019 10:24:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 84B20231E; Fri, 9 Aug 2019 10:24:49 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 33B7D1B19 for ; Fri, 9 Aug 2019 10:24:46 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Aug 2019 01:24:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,364,1559545200"; d="scan'208";a="169252814" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by orsmga008.jf.intel.com with ESMTP; 09 Aug 2019 01:24:43 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.164]) by IRSMSX151.ger.corp.intel.com ([169.254.4.214]) with mapi id 14.03.0439.000; Fri, 9 Aug 2019 09:24:43 +0100 From: "Ananyev, Konstantin" To: Jerin Jacob Kollanukkaran , "Pavan Nikhilesh Bhagavatula" , "stephen@networkplumber.org" , "arybchenko@solarflare.com" , "hemant.agrawal@nxp.com" , "thomas@monjalon.net" , "Yigit, Ferruh" , "Richardson, Bruce" , Neil Horman , "Mcnamara, John" , "Kovacevic, Marko" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [patch v3] doc: announce API change in ethdev offload flags Thread-Index: AQHVTceV2pPltlQueEKmYkOKhhENaqbw9/aQ///8DYCAABJmkP//89kAgAARl1D///iRgAANnyBQABWezgAAC2ncUA== Date: Fri, 9 Aug 2019 08:24:42 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772580168A640E9@irsmsx105.ger.corp.intel.com> References: <20190808081752.516-1-pbhagavatula@marvell.com> <20190808085859.796-1-pbhagavatula@marvell.com> <2601191342CEEE43887BDE71AB9772580168A63989@irsmsx105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB9772580168A639E4@irsmsx105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB9772580168A63A1B@irsmsx105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB9772580168A63C89@irsmsx105.ger.corp.intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDliZGVkYjEtY2U2MS00NDhhLWE5NTctOGI1ZWJhZDcwOTM3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWVppNEJablVIMnJMTTZySnJadG5rdHpsXC9XSVwvQ0ZoSnV3R1RkUWdBMzRtVjhNT09aSFBpbVd1UGo2WUxvV0J5In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [patch v3] doc: announce API change in ethdev offload flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Jerin, > > > > > Since application has two knobs rte_eth_dev_get_supported_ptypes(= ) > > > > > and DEV_RX_OFFLOAD_PTYPE. We may not need to new ol_flags for > > this > > > > change. Right? > > > > > i.e if application sets the DEV_RX_OFFLOAD_PTYPE, The application > > > > > will get the parsed ptypes by the driver(=3D > > > > rte_eth_dev_get_supported_ptypes()). > > > > > So there is no scope ambiguity. Right? > > > > > > > > I still think there is: > > > > Imagine user has 2 eth devices, one does support > > > > DEV_RX_OFFLOAD_PTYPE, second doesn't. Now he has a mix of packets > > > > from both devices, that you want t process. > > > > How would he figure out for which of them ptype values are valid, > > > > and for each are not? > > > > Trace back from what port he has received them? > > > > Not very convenient, and not always possible. > > > > > > I thought so. But in that case, application can always set > > > DEV_RX_OFFLOAD_PTYPE Flags for all the ethdev ports. Right? Rather > > > having any complicated ol_flags or port based parsing. If limit the > > _contract_ to following, we are good. Right? > > > # when DEV_RX_OFFLOAD_PTYPE is set, mbuf.packet_type will be valid > > and > > > mbuf.packet_type will have parsed packet type > > > > Yes sure in principle user can calculate smallest common subset of RX > > offloads supported by all devs in the system and use only them. > > Then he can use some global value for ol_flags that will be setup at > > initialization time, instead of checking ol_flags for every mbuf. > > Though inside DPDK we don't use that method for other offloads (cksum, > > vlan, rss). > > Why we should do different here? >=20 > I agree. We don't need to. >=20 > > Again how to deal with hot-plugged devices with such approach? > > > > > > > > or the negative offload(This contract is pretty clear, I don't think > > > any ambiguity at all) # when DEV_RX_OFFLOAD_NO_PTYPE(something > > > similar) is set, mbuf.packet_type will be invalid. > > > > > > > I think we need either to introduce new ol_flag value (as we usuall= y > > > > do for other RX offloads), or force PMD to always set ptype value. > > > > > > Setting new ol_flag value may effect performance for existing driver= s > > > which don't planning to use this offload > > > > If the driver doesn't support DEV_RX_OFFLOAD_PTYPE, it wouldn't need to > > set anything (neither ol_flags, neither packet_type). >=20 > Yes >=20 > > > > > and it complicates the > > > application to have additional check based on ol_flag. If you see any > > > corner case with above section, > > > > > > How about just setting as ptype as 0 incase it is not parsed by drive= r. > > > > As I said above - ok by me. > > AFAIK, this is current behavior, so no changes in PMD will be required. > > > > > Actual lookup is the costly one, writing 0 to pytpe is not costly as > > > there are plenty of writes in Rx and it will be write merged(No CPU > > > stall) > > > > Yes packet_type is at first 64B, so shouldn't cause any extra overhead. > > > > > > > > I did not get the complete picture of > > > "rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t > > ptype_mask); instead of DEV_RX_OFFLOAD_PTYPE? scheme", Does it help? > > > > I thought about it as just a different way to disable(/limit) requested= by user > > PTYPE support. > > If let say user is not interested in ptype information at all, he can a= sk PMD to > > just always set ptype value to 0: > > rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN); > > > > if he is interested just in L2/L3 layer info, he can ask PMD to provide= ptype > > information only for L2/L3: > > rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_L2_MASK | > > RTE_PTYPE_L3_MASK); > > > > Or to enable all supported by PMD ptypes: > > rte_eth_dev_set_supported_ptypes(port, UINT32_MAX) >=20 >=20 > The API looks good to me. We need to document the rte_eth_dev_set_suppor= ted_ptypes() > must be called when device is in stop state to allow PMD do slow path co= nfiguration. >=20 > To summarize: > Two options to control PTYPE lookup: > Option 1: > - If DEV_RX_OFFLOAD_PTYPE set, PMD returns mbuf->packet_type with rte_eth= _dev_get_supported_ptypes() > - If DEV_RX_OFFLOAD_PTYPE is not set, PMD still can return mbuf->packet_= type with rte_eth_dev_get_supported_ptypes() > But if PMD can do some optimization, it can avoid ptype lookup and return= mbuf->packet_type as zero. >=20 > Option 2: > - Introduce rte_eth_dev_set_supported_ptypes(port, needed_ptypes). Yes. >=20 > I think, rte_eth_dev_set_supported_ptypes() is better option As Konstanta= in suggested to > have selective control of ptype parsing by PMD at the cost of adding new = API. >=20 > I think, we can avoid breaking exiting application by, If rte_eth_dev_set= _supported_ptypes() is not called, > PMD must return mbuf->packet_type with rte_eth_dev_get_supported_ptypes()= . > If rte_eth_dev_set_supported_ptypes() and successful, PMD must return > mbuf->packet_type with rte_eth_dev_set_supported_ptypes() +1 >=20 > If there no objection to this API, We can send updated deprecation notice= . >=20 None from me. Konstantin