net/ixgbe: fix RSS RETA be reset after port start

Message ID 20210329071957.31321-1-murphyx.yang@intel.com (mailing list archive)
State Superseded, archived
Headers
Series net/ixgbe: fix RSS RETA be reset after port start |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Murphy Yang March 29, 2021, 7:19 a.m. UTC
  If one calls ‘rte_eth_dev_rss_reta_update’ with ixgbe before starting
the device (but after setting everything else), then RSS RETA
configuration be zero after starting the device.

This patch gives a notification if the port not started.

Bugzilla ID: 664
Fixes: 249358424eab ("ixgbe: RSS RETA configuration")

Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Comments

Wang, Haiyue March 29, 2021, 8:01 a.m. UTC | #1
> -----Original Message-----
> From: Yang, MurphyX <murphyx.yang@intel.com>
> Sent: Monday, March 29, 2021 15:20
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>; Guo, Jia
> <jia.guo@intel.com>; Yang, SteveX <stevex.yang@intel.com>; Zhang, RobinX <robinx.zhang@intel.com>;
> Yang, MurphyX <murphyx.yang@intel.com>
> Subject: [PATCH] net/ixgbe: fix RSS RETA be reset after port start
> 
> If one calls ‘rte_eth_dev_rss_reta_update’ with ixgbe before starting
> the device (but after setting everything else), then RSS RETA
> configuration be zero after starting the device.
> 
> This patch gives a notification if the port not started.
> 
> Bugzilla ID: 664
> Fixes: 249358424eab ("ixgbe: RSS RETA configuration")
> 
> Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 8a9a21e7c2..41068fe646 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -5015,11 +5015,19 @@ ixgbe_dev_rss_reta_update(struct rte_eth_dev *dev,
>  	uint32_t reta, r;
>  	uint16_t idx, shift;
>  	struct ixgbe_adapter *adapter = dev->data->dev_private;
> +	struct rte_eth_dev_data *dev_data = dev->data;
>  	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>  	uint32_t reta_reg;
> 
>  	PMD_INIT_FUNC_TRACE();
> 
> +	if (!dev_data->dev_started) {
> +		PMD_DRV_LOG(ERR,
> +			"port %d must be started before configuration",
> +			 dev_data->port_id);
> +		return -EBUSY;

-EIO is better ? Since no started, no busy at all. ;-)

> --
> 2.17.1
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 8a9a21e7c2..41068fe646 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -5015,11 +5015,19 @@  ixgbe_dev_rss_reta_update(struct rte_eth_dev *dev,
 	uint32_t reta, r;
 	uint16_t idx, shift;
 	struct ixgbe_adapter *adapter = dev->data->dev_private;
+	struct rte_eth_dev_data *dev_data = dev->data;
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t reta_reg;
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!dev_data->dev_started) {
+		PMD_DRV_LOG(ERR,
+			"port %d must be started before configuration",
+			 dev_data->port_id);
+		return -EBUSY;
+	}
+
 	if (!ixgbe_rss_update_sp(hw->mac.type)) {
 		PMD_DRV_LOG(ERR, "RSS reta update is not supported on this "
 			"NIC.");