From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E95E6A0A01 for ; Thu, 7 Jan 2021 09:02:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E3184140EEA; Thu, 7 Jan 2021 09:02:42 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 6D851140EC0; Thu, 7 Jan 2021 09:02:41 +0100 (CET) IronPort-SDR: jQ34KJ3raGRU9nc+oaTpwBCyHya2Oul2TzqEzi3gjAK9eMV927u2ZCuF7WlI3FqtdTW2TRU7ND 0t2qJeiSKvhw== X-IronPort-AV: E=McAfee;i="6000,8403,9856"; a="177491570" X-IronPort-AV: E=Sophos;i="5.79,329,1602572400"; d="scan'208";a="177491570" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2021 00:02:40 -0800 IronPort-SDR: dYRb0fj1Wyaj187+5uMioZj//g4QK292vjSxoHVKtOtVrdrVE4YA3hmy1eIxAfYxGbbYyPt3Qh zGSCcsZPDEUw== X-IronPort-AV: E=Sophos;i="5.79,329,1602572400"; d="scan'208";a="398533068" Received: from shwdenpg235.ccr.corp.intel.com ([10.240.182.60]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2021 00:02:38 -0800 From: "Zhang,Alvin" To: jia.guo@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com, Simei.Su@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, Alvin Zhang , stable@dpdk.org Date: Thu, 7 Jan 2021 16:02:28 +0800 Message-Id: <20210107080230.7836-2-alvinx.zhang@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20210107080230.7836-1-alvinx.zhang@intel.com> References: <20201228071210.19596-1-alvinx.zhang@intel.com> <20210107080230.7836-1-alvinx.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v3 2/3] net/i40e: fix return value X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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" From: Alvin Zhang The api should return the system error status, but it returned the hardware error status, this is confused for the caller. This patch adds check on hardware execution status and returns -EIO in case of hardware execution failure. Signed-off-by: Alvin Zhang Fixes: 1d4b2b4966bb ("net/i40e: fix VF overwrite PF RSS LUT for X722") Fixes: d0a349409bd7 ("i40e: support AQ based RSS config") Cc: stable@dpdk.org --- drivers/net/i40e/i40e_ethdev.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index f54769c..2034008 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -4426,7 +4426,6 @@ static int i40e_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, { struct i40e_pf *pf; struct i40e_hw *hw; - int ret; if (!vsi || !lut) return -EINVAL; @@ -4435,12 +4434,16 @@ static int i40e_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, hw = I40E_VSI_TO_HW(vsi); if (pf->flags & I40E_FLAG_RSS_AQ_CAPABLE) { - ret = i40e_aq_set_rss_lut(hw, vsi->vsi_id, - vsi->type != I40E_VSI_SRIOV, - lut, lut_size); - if (ret) { - PMD_DRV_LOG(ERR, "Failed to set RSS lookup table"); - return ret; + enum i40e_status_code status; + + status = i40e_aq_set_rss_lut(hw, vsi->vsi_id, + vsi->type != I40E_VSI_SRIOV, + lut, lut_size); + if (status) { + PMD_DRV_LOG(ERR, + "Failed to update RSS lookup table, error status: %d", + status); + return -EIO; } } else { uint32_t *lut_dw = (uint32_t *)lut; @@ -7591,7 +7594,6 @@ struct i40e_vsi * uint16_t key_idx = (vsi->type == I40E_VSI_SRIOV) ? I40E_VFQF_HKEY_MAX_INDEX : I40E_PFQF_HKEY_MAX_INDEX; - int ret = 0; if (!key || key_len == 0) { PMD_DRV_LOG(DEBUG, "No key to be configured"); @@ -7604,11 +7606,16 @@ struct i40e_vsi * if (pf->flags & I40E_FLAG_RSS_AQ_CAPABLE) { struct i40e_aqc_get_set_rss_key_data *key_dw = - (struct i40e_aqc_get_set_rss_key_data *)key; + (struct i40e_aqc_get_set_rss_key_data *)key; + enum i40e_status_code status = + i40e_aq_set_rss_key(hw, vsi->vsi_id, key_dw); - ret = i40e_aq_set_rss_key(hw, vsi->vsi_id, key_dw); - if (ret) - PMD_INIT_LOG(ERR, "Failed to configure RSS key via AQ"); + if (status) { + PMD_DRV_LOG(ERR, + "Failed to configure RSS key via AQ, error status: %d", + status); + return -EIO; + } } else { uint32_t *hash_key = (uint32_t *)key; uint16_t i; @@ -7628,7 +7635,7 @@ struct i40e_vsi * I40E_WRITE_FLUSH(hw); } - return ret; + return 0; } static int -- 1.8.3.1