From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 58FA24C8E for ; Wed, 7 Mar 2018 13:08:59 +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 fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2018 04:08:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,435,1515484800"; d="scan'208";a="209562615" Received: from rhorton-mobl1.ger.corp.intel.com (HELO FC23.ir.intel.com) ([163.33.230.83]) by fmsmga006.fm.intel.com with ESMTP; 07 Mar 2018 04:08:57 -0800 From: Remy Horton To: dev@dpdk.org Cc: Wenzhuo Lu , Jingjing Wu , Qi Zhang , Beilei Xing , Shreyansh Jain , Thomas Monjalon Date: Wed, 7 Mar 2018 12:08:50 +0000 Message-Id: <20180307120851.5822-4-remy.horton@intel.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180307120851.5822-1-remy.horton@intel.com> References: <20180307120851.5822-1-remy.horton@intel.com> Subject: [dpdk-dev] [RFC PATCH v1 3/4] net/i40e: add TxRx tuning 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, 07 Mar 2018 12:08:59 -0000 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 --- drivers/net/i40e/i40e_ethdev.c | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 508b417..4bcd05e 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -3168,6 +3168,7 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct i40e_vsi *vsi = pf->main_vsi; struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); + struct rte_eth_dev_pref_queue_info *pref_q_info; dev_info->pci_dev = pci_dev; dev_info->max_rx_queues = vsi->nb_qps; @@ -3248,15 +3249,43 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_tx_queues += dev_info->vmdq_queue_num; } - if (I40E_PHY_TYPE_SUPPORT_40G(hw->phy.phy_types)) + pref_q_info = &dev_info->preferred_queue_values; + if (I40E_PHY_TYPE_SUPPORT_40G(hw->phy.phy_types)) { /* For XL710 */ dev_info->speed_capa = ETH_LINK_SPEED_40G; - else if (I40E_PHY_TYPE_SUPPORT_25G(hw->phy.phy_types)) + pref_q_info->nb_tx_queues = 2; + pref_q_info->nb_rx_queues = 2; + if (dev->data->nb_rx_queues == 1) + pref_q_info->rx_ring_size = 2048; + else + pref_q_info->rx_ring_size = 1024; + if (dev->data->nb_tx_queues == 1) + pref_q_info->tx_ring_size = 1024; + else + pref_q_info->tx_ring_size = 512; + + } else if (I40E_PHY_TYPE_SUPPORT_25G(hw->phy.phy_types)) { /* For XXV710 */ dev_info->speed_capa = ETH_LINK_SPEED_25G; - else + pref_q_info->nb_tx_queues = 1; + pref_q_info->nb_rx_queues = 1; + pref_q_info->rx_ring_size = 256; + pref_q_info->tx_ring_size = 256; + } else { /* For X710 */ dev_info->speed_capa = ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G; + pref_q_info->nb_tx_queues = 1; + pref_q_info->nb_rx_queues = 1; + if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_10G) { + pref_q_info->rx_ring_size = 512; + pref_q_info->tx_ring_size = 256; + } else { + pref_q_info->rx_ring_size = 256; + pref_q_info->tx_ring_size = 256; + } + } + pref_q_info->tx_burst_size = 32; + pref_q_info->rx_burst_size = 32; } static int -- 2.9.5