From: Alvin Zhang <alvinx.zhang@intel.com> The command here does not create a queue region, but only sets the lookup table, so the descriptions in the doc is not exact. Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com> Fixes: feaae285b342 ("net/i40e: support hash configuration in RSS flow") Cc: stable@dpdk.org --- V2: Divide the patch into three patch series and delete some two unused functions --- doc/guides/nics/i40e.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst index 4e5c4679b..64f20e7da 100644 --- a/doc/guides/nics/i40e.rst +++ b/doc/guides/nics/i40e.rst @@ -562,9 +562,9 @@ Generic flow API - ``RSS Flow`` RSS Flow supports to set hash input set, hash function, enable hash - and configure queue region. + and configure queues. For example: - Configure queue region as queue 0, 1, 2, 3. + Configure queues as queue 0, 1, 2, 3. .. code-block:: console -- 2.21.0.windows.1
From: Alvin Zhang <alvinx.zhang@intel.com> 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 <alvinx.zhang@intel.com> 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 f54769c29..20340084b 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -4426,7 +4426,6 @@ i40e_set_rss_lut(struct i40e_vsi *vsi, uint8_t *lut, uint16_t lut_size) { struct i40e_pf *pf; struct i40e_hw *hw; - int ret; if (!vsi || !lut) return -EINVAL; @@ -4435,12 +4434,16 @@ i40e_set_rss_lut(struct i40e_vsi *vsi, uint8_t *lut, uint16_t lut_size) 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 @@ i40e_set_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t key_len) 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 @@ i40e_set_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t key_len) 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 @@ i40e_set_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t key_len) I40E_WRITE_FLUSH(hw); } - return ret; + return 0; } static int -- 2.21.0.windows.1
From: Alvin Zhang <alvinx.zhang@intel.com> The command here does not create a queue region, but only sets the lookup table, so the descriptions in the doc is not exact. Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com> Fixes: feaae285b342 ("net/i40e: support hash configuration in RSS flow") Cc: stable@dpdk.org --- V2: Divide the patch into three patch series and delete some two unused functions --- doc/guides/nics/i40e.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst index 4e5c467..64f20e7 100644 --- a/doc/guides/nics/i40e.rst +++ b/doc/guides/nics/i40e.rst @@ -562,9 +562,9 @@ Generic flow API - ``RSS Flow`` RSS Flow supports to set hash input set, hash function, enable hash - and configure queue region. + and configure queues. For example: - Configure queue region as queue 0, 1, 2, 3. + Configure queues as queue 0, 1, 2, 3. .. code-block:: console -- 1.8.3.1
From: Alvin Zhang <alvinx.zhang@intel.com> 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 <alvinx.zhang@intel.com> 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
From: Alvin Zhang <alvinx.zhang@intel.com> The command here does not create a queue region, but only sets the lookup table, so the descriptions in the doc is not exact. Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com> Fixes: feaae285b342 ("net/i40e: support hash configuration in RSS flow") Cc: stable@dpdk.org --- V2: Divide the patch into three patch series and delete some two unused functions --- doc/guides/nics/i40e.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst index 4e5c467..64f20e7 100644 --- a/doc/guides/nics/i40e.rst +++ b/doc/guides/nics/i40e.rst @@ -562,9 +562,9 @@ Generic flow API - ``RSS Flow`` RSS Flow supports to set hash input set, hash function, enable hash - and configure queue region. + and configure queues. For example: - Configure queue region as queue 0, 1, 2, 3. + Configure queues as queue 0, 1, 2, 3. .. code-block:: console -- 1.8.3.1
From: Alvin Zhang <alvinx.zhang@intel.com> 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 <alvinx.zhang@intel.com> 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
> -----Original Message-----
> From: Zhang,Alvin <alvinx.zhang@intel.com>
> Sent: Friday, January 8, 2021 1:36 PM
> To: Guo, Jia <jia.guo@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Zhang,
> Qi Z <qi.z.zhang@intel.com>; Su, Simei <simei.su@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>
> Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH v4 2/3] net/i40e: fix return value
>
> From: Alvin Zhang <alvinx.zhang@intel.com>
>
> 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 <alvinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
> -----Original Message----- > From: Zhang,Alvin <alvinx.zhang@intel.com> > Sent: Friday, January 8, 2021 1:36 PM > To: Guo, Jia <jia.guo@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Zhang, > Qi Z <qi.z.zhang@intel.com>; Su, Simei <simei.su@intel.com>; Yang, Qiming > <qiming.yang@intel.com> > Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>; stable@dpdk.org > Subject: [PATCH v4 1/3] doc: fix testpmd command for i40e RSS flow > > From: Alvin Zhang <alvinx.zhang@intel.com> > > The command here does not create a queue region, but only sets the lookup > table, so the descriptions in the doc is not exact. > > Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com> > > Fixes: feaae285b342 ("net/i40e: support hash configuration in RSS flow") > Cc: stable@dpdk.org Fix line should be before "Signed-off:", please follow the format. Acked-by: Qi Zhang <qi.z.zhang@intel.com> Applied to dpdk-next-net-intel. Thanks Qi