From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 5A7684C71 for ; Wed, 14 Mar 2018 15:43:37 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2018 07:43:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,470,1515484800"; d="scan'208";a="33807363" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.62]) ([10.237.221.62]) by FMSMGA003.fm.intel.com with ESMTP; 14 Mar 2018 07:43:34 -0700 To: Remy Horton , dev@dpdk.org Cc: Wenzhuo Lu , Jingjing Wu , Qi Zhang , Beilei Xing , Shreyansh Jain , Thomas Monjalon References: <20180307120851.5822-1-remy.horton@intel.com> <20180307120851.5822-2-remy.horton@intel.com> From: Ferruh Yigit Message-ID: <023fbd6c-7cac-6c8b-9a40-7a62e5d47bb7@intel.com> Date: Wed, 14 Mar 2018 14:43:33 +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: <20180307120851.5822-2-remy.horton@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit 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, 14 Mar 2018 14:43:37 -0000 On 3/7/2018 12:08 PM, Remy Horton wrote: > The optimal values of several transmission & reception related > parameters, such as burst sizes, descriptor ring sizes, and number > of queues, varies between different network interface devices. This > patch allows individual PMDs to specify preferred parameter values. > > Signed-off-by: Remy Horton > --- > lib/librte_ether/rte_ethdev.c | 18 ++++++++++++++++++ > lib/librte_ether/rte_ethdev.h | 15 +++++++++++++++ Can you please remove deprecation notice in this patch. > 2 files changed, 33 insertions(+) > > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index 0590f0c..1630407 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -1461,6 +1461,10 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, > return -EINVAL; > } > > + /* Use default specified by driver, if nb_rc_desc is zero */ > + if (nb_rx_desc == 0) > + nb_rx_desc = dev_info.preferred_queue_values.rx_ring_size; > + > if (nb_rx_desc > dev_info.rx_desc_lim.nb_max || > nb_rx_desc < dev_info.rx_desc_lim.nb_min || > nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) { > @@ -1584,6 +1588,10 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, > > rte_eth_dev_info_get(port_id, &dev_info); > > + /* Use default specified by driver, if nb_tx_desc is zero */ > + if (nb_tx_desc == 0) > + nb_tx_desc = dev_info.preferred_queue_values.tx_ring_size; > + > if (nb_tx_desc > dev_info.tx_desc_lim.nb_max || > nb_tx_desc < dev_info.tx_desc_lim.nb_min || > nb_tx_desc % dev_info.tx_desc_lim.nb_align != 0) { > @@ -2394,6 +2402,16 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) > dev_info->rx_desc_lim = lim; > dev_info->tx_desc_lim = lim; > > + /* Defaults for drivers that don't implement preferred > + * queue parameters. > + */ > + dev_info->preferred_queue_values.rx_burst_size = 0; > + dev_info->preferred_queue_values.tx_burst_size = 0; > + dev_info->preferred_queue_values.nb_rx_queues = 1; > + dev_info->preferred_queue_values.nb_tx_queues = 1; > + dev_info->preferred_queue_values.rx_ring_size = 1024; > + dev_info->preferred_queue_values.tx_ring_size = 1024; Not sure about having these defaults here. It is OK to have defaults in driver, in application or in config file, but I am not sure if putting them into device abstraction layer hides them. What about not providing any default in ethdev layer, and get zero as invalid when using them? > + > RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get); > (*dev->dev_ops->dev_infos_get)(dev, dev_info); > dev_info->driver_name = dev->device->driver->name; > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > index 0361533..67ce82d 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -988,6 +988,18 @@ struct rte_eth_conf { > > struct rte_pci_device; > > +/* > + * Preferred queue parameters. > + */ > +struct rte_eth_dev_pref_queue_info { > + uint16_t rx_burst_size; > + uint16_t tx_burst_size; > + uint16_t rx_ring_size; > + uint16_t tx_ring_size; > + uint16_t nb_rx_queues; > + uint16_t nb_tx_queues; > +}; > + > /** > * Ethernet device information > */ > @@ -1029,6 +1041,9 @@ struct rte_eth_dev_info { > /** Configured number of rx/tx queues */ > uint16_t nb_rx_queues; /**< Number of RX queues. */ > uint16_t nb_tx_queues; /**< Number of TX queues. */ > + > + /** Queue size recommendations */ Not only queue size. > + struct rte_eth_dev_pref_queue_info preferred_queue_values; Although these are queue related values, not per-queue but per-port, the variable name "preferred_queue_values" gives the impression that these are per queue. And "rx_burst_size" is not related to queue at all I think. What do you think renaming structure and variable name, "preferred_dev_config" perhaps? > }; > > /** >