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 1643EA0577; Tue, 7 Apr 2020 04:07:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF98B2BE9; Tue, 7 Apr 2020 04:07:24 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id BA76E2BE2; Tue, 7 Apr 2020 04:07:22 +0200 (CEST) IronPort-SDR: x7v7/i65KlzTMLQpRP9yFPArEILcL82iC1DpaQs3V1sRep3ueblReOMM80+pG/z3hFNCqoK0JY nv/eP1wpNcQw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2020 19:07:21 -0700 IronPort-SDR: yWslIMi+aENI0bhGVVh66dKMV4RZ58qIl0SGMK5wLs0zTuaEf48u3WDbBilyIUFvuRSDmH87W2 P2j4BEObMmAA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,353,1580803200"; d="scan'208";a="269271780" Received: from intel.sh.intel.com ([10.239.255.136]) by orsmga002.jf.intel.com with ESMTP; 06 Apr 2020 19:07:19 -0700 From: Junyu Jiang To: dev@dpdk.org Cc: Qi Zhang , Qiming Yang , Junyu Jiang , stable@dpdk.org Date: Tue, 7 Apr 2020 01:48:17 +0000 Message-Id: <20200407014817.25163-1-junyux.jiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200319074825.16035-1-junyux.jiang@intel.com> References: <20200319074825.16035-1-junyux.jiang@intel.com> Subject: [dpdk-dev] [PATCH v5] net/ice: fix RSS advanced rule invalid issue 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch moved the RSS initialization from dev start to dev configure to fix RSS advanced rule invalid after running port stop and port start. Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS") Cc: stable@dpdk.org Signed-off-by: Junyu Jiang --- drivers/net/ice/ice_ethdev.c | 50 +++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 85ef83e92..90a91c9c1 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2446,24 +2446,6 @@ ice_dev_uninit(struct rte_eth_dev *dev) return 0; } -static int -ice_dev_configure(struct rte_eth_dev *dev) -{ - struct ice_adapter *ad = - ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); - - /* Initialize to TRUE. If any of Rx queues doesn't meet the - * bulk allocation or vector Rx preconditions we will reset it. - */ - ad->rx_bulk_alloc_allowed = true; - ad->tx_simple_allowed = true; - - if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) - dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH; - - return 0; -} - static int ice_init_rss(struct ice_pf *pf) { struct ice_hw *hw = ICE_PF_TO_HW(pf); @@ -2594,6 +2576,32 @@ static int ice_init_rss(struct ice_pf *pf) return 0; } +static int +ice_dev_configure(struct rte_eth_dev *dev) +{ + struct ice_adapter *ad = + ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); + struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); + int ret; + + /* Initialize to TRUE. If any of Rx queues doesn't meet the + * bulk allocation or vector Rx preconditions we will reset it. + */ + ad->rx_bulk_alloc_allowed = true; + ad->tx_simple_allowed = true; + + if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) + dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH; + + ret = ice_init_rss(pf); + if (ret) { + PMD_DRV_LOG(ERR, "Failed to enable rss for PF"); + return ret; + } + + return 0; +} + static void __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_t msix_vect, int base_queue, int nb_queue) @@ -2797,12 +2805,6 @@ ice_dev_start(struct rte_eth_dev *dev) } } - ret = ice_init_rss(pf); - if (ret) { - PMD_DRV_LOG(ERR, "Failed to enable rss for PF"); - goto rx_err; - } - ice_set_rx_function(dev); ice_set_tx_function(dev); -- 2.17.1