From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 986525F17 for ; Wed, 21 Mar 2018 11:02:34 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2018 03:02:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,339,1517904000"; d="scan'208";a="213301358" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.63]) ([10.237.221.63]) by fmsmga006.fm.intel.com with ESMTP; 21 Mar 2018 03:02:30 -0700 To: Shreyansh Jain Cc: Bruce Richardson , "Horton, Remy" , "Ananyev, Konstantin" , "dev@dpdk.org" , "Lu, Wenzhuo" , "Wu, Jingjing" , "Zhang, Qi Z" , "Xing, Beilei" , Thomas Monjalon References: <20180307120851.5822-2-remy.horton@intel.com> <023fbd6c-7cac-6c8b-9a40-7a62e5d47bb7@intel.com> <30b8575d-4aeb-912d-6f74-c49ad7ce879a@intel.com> <591e1a23-8d27-0c59-fd39-0bde9e48e96f@intel.com> <2601191342CEEE43887BDE71AB9772589E28FD57@irsmsx105.ger.corp.intel.com> <2b3a2579-6bce-55f5-6e03-0974729cc95b@intel.com> <20180314213658.GA108@bricha3-MOBL.ger.corp.intel.com> <20180315143924.GA9172@bricha3-MOBL.ger.corp.intel.com> <97dc9f9d-041b-ef99-2ca6-1f557c4f6039@intel.com> <8af6d6ea-34d8-3b0d-cd34-c11ebb2a8207@intel.com> From: Ferruh Yigit Message-ID: <03627530-5bb6-3b82-5a30-137f71eee351@intel.com> Date: Wed, 21 Mar 2018 10:02:30 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC PATCH v1 1/4] ethdev: add support for PMD-tuned Tx/Rx parameters 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: , X-List-Received-Date: Wed, 21 Mar 2018 10:02:35 -0000 On 3/21/2018 6:51 AM, Shreyansh Jain wrote: > On Tue, Mar 20, 2018 at 8:24 PM, Ferruh Yigit wrote: >> On 3/16/2018 1:54 PM, Shreyansh Jain wrote: >>> On Thu, Mar 15, 2018 at 8:27 PM, Ferruh Yigit wrote: > > [...] > >>>> Hi Remy, Shreyansh, >>>> >>>> What do you think about using a variable name consistent with existing >>>> "default_[rt]xconf" in dev_info? >>> >>> It just turned out to be much more complex than I initially thought :) >>> Is this what the above conversation merging at (for Rx, as example): >>> >>> 1. 'default_rx_size_conf' is added in rte_eth_dev_info (and this >>> includes I/O params like burst size, besides configure time nb_queue, >>> nb_desc etc). Driver would return these values filled in when >>> info_get() is called. >>> >>> 2a. If an application needs the defaults, it would perform info_get() >>> and get the values. then, use the values in configuration APIs >>> (rx_queue_setup for nb_rx_desc, eth_dev_dev_configure for >>> nb_rx_queues). >>> For rx_burst calls, it would use the burst_size fields obtained from info_get(). >>> This is good enough for configuration and datapath (rx_burst). >>> >>> OR, another case >>> >>> 2b. Application wants to use default vaules provided by driver without >>> calling info_get. In which case, it would call >>> rx_queue_setup(nb_rx_desc=0..) or eth_dev_configure(nb_rx_queue=0, >>> nb_tx_queue=0). The implementation would query the value from >>> 'default_rx_size_conf' through info_get() and use those values. >>> Though, in this case, rte_eth_rx_burst(burst=0) might not work for >>> picking up the default within rte_ethdev.h. >> >> In Bruce's suggestion where ethdev keep defaults is changed. >> Initial suggestion was rte_eth_dev_info_get() filling default data, now defaults >> will be defined in functions like rte_eth_rx_queue_setup(). >> >> This is a little different from filling defaults in rte_eth_dev_info_get(): >> - Application can know where the defaults are coming from because dev_info >> fields are only modified by PMD. Application still prefer to use ethdev defaults. >> >> - The default values in ethdev library provided in function related to that >> data, instead of separate rte_eth_dev_info_get() function. > > It seems we both are on same page (almost) - just that I couldn't > articulate my comments properly earlier, maybe. > > rte_eth_dev_info_get is only a method to get defaults set by PMDs. > dev_info_get is not setting defaults by itself. I get this. > >> >> >> What application can do: >> - Application can call rte_eth_dev_info_get() and can learn if PMD provided >> defaults or not. >> - If PMD doesn't provided any default values application can prefer to use >> application defined values. This may be an option for the application looking >> for most optimized values. >> - Although PMD doesn't provide any defaults, application still can use defaults >> provided by ethdev by providing '0' as arguments. > > Yes, agree - and only comment I added previously in this case is that > this is not applicable for burst APIs. So, optimal [rt]x burst size > cannot be 'defaulted' to EAL layer. Other values like ring size, queue > count can be delegated to EAL for overwriting if passed as '0'. Yes you are right. > >> >> >> So how related ethdev functions will be updated: >> if argument != 0 >> use argument >> else >> dev_info_get() >> if dev_info->argument != 0 >> use dev_info->argument >> else >> use function_prov > > Perfect, but only for eth_dev_configure and eth_[rt]x_queue_setup functions - > and that is OK with me. > >> >>> >>> :Four observations: >>> A). For burst size (or any other I/O time value added in future), >>> values would have to be explicitly used by application - always. If >>> value reported by info_get() is '0' (see (B) below), application to >>> use its own judgement. No default override by lib_eal. >>> IMO, This is good enough assumption. >> >> This is no more true after Bruce's comment. >> If application provides any values it will overwrite everything else, >> application has the final word. >> But application may prefer to use provided default values. > > I am not sure what has changed with Bruce's comment - but I agree with > what you are stating. > >> >>> >>> B). '0' as an indicator for 'no-default-value-available-from-driver' >>> is still an open point. It is good enough for current proposed >>> parameters, but may be a valid numerical value in future. >>> IMO, this can be ignored for now. >> >> Agree that we can ignore it for now. >> >>> >>> C) Unlike the original proposal, this would add two separate members >>> to rte_eth_dev_info - one each for Rx and Tx. They both are still >>> expected to be populated through the info_get() implementation but not >>> by lib_eal. >>> IMO, doesn't matter. >> >> There won't be new members, which ones are you talking about? > > original proposal: (ignore change of names, please) > > rte_eth_dev_preferred_info { > rx_burst_size > tx_burst_size > rx_ring_size > tx_ring_size > ... > } > > And this is what I think last few comments intended: > > rte_eth_rxpreferred { > ... > rx_burst_size > rx_ring_size > ... > } > > rte_eth_txpreferred { > ... > tx_burst_size > tx_ring_size > ... > } > > both the above added rte_eth_dev_info{} > > This is what I meant when I stated "...this would add two separate > members to rte_eth_dev_info - one each for Rx and Tx..." Got it. I don't have any strong opinion on adding single struct or two (one for Rx and one for Tx). Since these will be public structs, do you think will there be any difference from ABI stability point of view? > > [...] > > - > Shreyansh >