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 0B7B8A04B7 for ; Wed, 14 Oct 2020 11:17:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 034DB1D9A8; Wed, 14 Oct 2020 11:17:51 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id BCB741D9A8 for ; Wed, 14 Oct 2020 11:17:49 +0200 (CEST) IronPort-SDR: rRgCQhO5l8xxN4H12mQOIOid2N/v5vNuqIKMo6uIHLX0LNtLp2ge9cRCx44ih/VeXofgle9Tgb ry/qHw353GAQ== X-IronPort-AV: E=McAfee;i="6000,8403,9773"; a="166191639" X-IronPort-AV: E=Sophos;i="5.77,374,1596524400"; d="scan'208";a="166191639" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 02:17:47 -0700 IronPort-SDR: IeQRq3aUZUhBcMf1U4ZTRJlFQmHta+7Bhs2x4VtZkvThFYKHj0dTQm6rZzsONDGQ3NqdHSzcBl OTjP2gGovbWw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,374,1596524400"; d="scan'208";a="330398256" Received: from qat_cpm20_vlan01.sh.intel.com ([10.67.97.38]) by orsmga002.jf.intel.com with ESMTP; 14 Oct 2020 02:17:46 -0700 From: Junyu Jiang To: stable@dpdk.org Cc: Junyu Jiang Date: Wed, 14 Oct 2020 16:37:20 +0800 Message-Id: <20201014083720.69817-1-junyux.jiang@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-stable] [PATCH 18.11] net/avf: fix RSS RETA settings invalid X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" [ upstream commit 1feb8e3f4e5c69071e5c461132a8b1bad05609af ] This patch moved the RSS initialization from dev start to dev configure, to fix the issue that RSS redirection table can not be kept after restarting port. Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Signed-off-by: Junyu Jiang Acked-by: Qiming Yang --- drivers/net/avf/avf_ethdev.c | 76 ++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c index 13eec1b45..6033034b1 100644 --- a/drivers/net/avf/avf_ethdev.c +++ b/drivers/net/avf/avf_ethdev.c @@ -120,36 +120,6 @@ static const struct eth_dev_ops avf_eth_dev_ops = { .rx_queue_intr_disable = avf_dev_rx_queue_intr_disable, }; -static int -avf_dev_configure(struct rte_eth_dev *dev) -{ - struct avf_adapter *ad = - AVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); - struct avf_info *vf = AVF_DEV_PRIVATE_TO_VF(ad); - struct rte_eth_conf *dev_conf = &dev->data->dev_conf; - - ad->rx_bulk_alloc_allowed = true; -#ifdef RTE_LIBRTE_AVF_INC_VECTOR - /* Initialize to TRUE. If any of Rx queues doesn't meet the - * vector Rx/Tx preconditions, it will be reset. - */ - ad->rx_vec_allowed = true; - ad->tx_vec_allowed = true; -#else - ad->rx_vec_allowed = false; - ad->tx_vec_allowed = false; -#endif - - /* Vlan stripping setting */ - if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) { - if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP) - avf_enable_vlan_strip(ad); - else - avf_disable_vlan_strip(ad); - } - return 0; -} - static int avf_init_rss(struct avf_adapter *adapter) { @@ -206,6 +176,43 @@ avf_init_rss(struct avf_adapter *adapter) return 0; } +static int +avf_dev_configure(struct rte_eth_dev *dev) +{ + struct avf_adapter *ad = + AVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); + struct avf_info *vf = AVF_DEV_PRIVATE_TO_VF(ad); + struct rte_eth_conf *dev_conf = &dev->data->dev_conf; + + ad->rx_bulk_alloc_allowed = true; +#ifdef RTE_LIBRTE_AVF_INC_VECTOR + /* Initialize to TRUE. If any of Rx queues doesn't meet the + * vector Rx/Tx preconditions, it will be reset. + */ + ad->rx_vec_allowed = true; + ad->tx_vec_allowed = true; +#else + ad->rx_vec_allowed = false; + ad->tx_vec_allowed = false; +#endif + + /* Vlan stripping setting */ + if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) { + if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP) + avf_enable_vlan_strip(ad); + else + avf_disable_vlan_strip(ad); + } + + if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) { + if (avf_init_rss(ad) != 0) { + PMD_DRV_LOG(ERR, "configure rss failed"); + return -1; + } + } + return 0; +} + static int avf_init_rxq(struct rte_eth_dev *dev, struct avf_rx_queue *rxq) { @@ -425,14 +432,6 @@ avf_dev_start(struct rte_eth_dev *dev) PMD_DRV_LOG(ERR, "failed to do Queue init"); return -1; } - - if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) { - if (avf_init_rss(adapter) != 0) { - PMD_DRV_LOG(ERR, "configure rss failed"); - goto err_rss; - } - } - if (avf_configure_queues(adapter) != 0) { PMD_DRV_LOG(ERR, "configure queues failed"); goto err_queue; @@ -461,7 +460,6 @@ avf_dev_start(struct rte_eth_dev *dev) err_mac: avf_add_del_all_mac_addr(adapter, FALSE); err_queue: -err_rss: return -1; } -- 2.17.1