From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 4CD9C1B4EB for ; Mon, 3 Dec 2018 09:45:37 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Dec 2018 00:45:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,309,1539673200"; d="scan'208";a="104359279" Received: from dpdk-xiaoyunl.sh.intel.com ([10.67.110.212]) by fmsmga007.fm.intel.com with ESMTP; 03 Dec 2018 00:45:36 -0800 From: Xiaoyun Li To: qi.z.zhang@intel.com Cc: dev@dpdk.org, Xiaoyun Li Date: Mon, 3 Dec 2018 16:26:32 +0800 Message-Id: <1543825592-85848-1-git-send-email-xiaoyun.li@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542936954-39421-1-git-send-email-xiaoyun.li@intel.com> References: <1542936954-39421-1-git-send-email-xiaoyun.li@intel.com> Subject: [dpdk-dev] [PATCH v3] net/i40e: adjust the RSS table 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: Mon, 03 Dec 2018 08:45:38 -0000 When starting the device, the RSS table is initialized. So the RSS update before device_start would be overwritten. This patch allows users to update the RSS reta table before device_start and adjusts the order to set entries sequentially. Signed-off-by: Xiaoyun Li --- v3: * Rename the variable and fix typo in commit log. v2: * Add support to update RSS table before device_start. * Simplify the codes with rte_bswap32. * Polish the commit log. --- drivers/net/i40e/i40e_ethdev.c | 21 ++++++++++++++------- drivers/net/i40e/i40e_ethdev.h | 3 +++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 552a7a5..65fd717 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2444,6 +2444,8 @@ i40e_dev_stop(struct rte_eth_dev *dev) pf->tm_conf.committed = false; hw->adapter_stopped = 1; + + pf->adapter->rss_reta_updated = 0; } static void @@ -4255,6 +4257,8 @@ i40e_dev_rss_reta_update(struct rte_eth_dev *dev, } ret = i40e_set_rss_lut(pf->main_vsi, lut, reta_size); + pf->adapter->rss_reta_updated = 1; + out: rte_free(lut); @@ -8492,13 +8496,16 @@ i40e_pf_config_rss(struct i40e_pf *pf) return -ENOTSUP; } - for (i = 0, j = 0; i < hw->func_caps.rss_table_size; i++, j++) { - if (j == num) - j = 0; - lut = (lut << 8) | (j & ((0x1 << - hw->func_caps.rss_table_entry_width) - 1)); - if ((i & 3) == 3) - I40E_WRITE_REG(hw, I40E_PFQF_HLUT(i >> 2), lut); + if (pf->adapter->rss_reta_updated == 0) { + for (i = 0, j = 0; i < hw->func_caps.rss_table_size; i++, j++) { + if (j == num) + j = 0; + lut = (lut << 8) | (j & ((0x1 << + hw->func_caps.rss_table_entry_width) - 1)); + if ((i & 3) == 3) + I40E_WRITE_REG(hw, I40E_PFQF_HLUT(i >> 2), + rte_bswap32(lut)); + } } rss_conf = pf->dev_data->dev_conf.rx_adv_conf.rss_conf; diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index 11ecfc3..930eb9a 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -1081,6 +1081,9 @@ struct i40e_adapter { /* For devargs */ uint8_t use_latest_vec; + + /* For RSS reta table update */ + uint8_t rss_reta_updated; }; /** -- 2.7.4