Skip to contentSkip to conversation

net/ice: fix initialization of RSS look-up table

PATCH Applied Zhang,Alvin 3 participants 3 messages Jan 8, 2021 – Jan 12, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ice: fix initialization of RSS look-up table

From: Alvin Zhang <[email protected]>

RSS look-up table initialization is done incorrectly due to divide-by-zero error.
Add a check to rx-queue count.

Fixes 50370662b727 ("net/ice: support device and queue ops")
---
 drivers/net/ice/ice_ethdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/ice/ice_ethdev.c +6 -4
index 9a5d6a5..9cef73e 100644
@@ -3268,10 +3268,12 @@ static int ice_init_rss(struct ice_pf *pf)
 	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;
+	if (dev->data->nb_rx_queues) {
+		ret = ice_init_rss(pf);
+		if (ret) {
+			PMD_DRV_LOG(ERR, "Failed to enable rss for PF");
+			return ret;
+		}
 	}
 
 	return 0;
Signature · 1 line
1.8.3.1
Tested-by on v1 1/1
#1 lore raw

Regards,
Xie Wei

Quoted 46 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Zhang,Alvin
Sent: Friday, January 8, 2021 3:29 PM
To: Zhang, Qi Z <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] net/ice: fix initialization of RSS look-up table

From: Alvin Zhang <[email protected]>

RSS look-up table initialization is done incorrectly due to divide-by-zero error. Add a check to rx-queue count.

Fixes 50370662b727 ("net/ice: support device and queue ops")
---
 drivers/net/ice/ice_ethdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/ice/ice_ethdev.c +6 -4
index 9a5d6a5..9cef73e 100644
@@ -3268,10 +3268,12 @@ static int ice_init_rss(struct ice_pf *pf)
 	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;
+	if (dev->data->nb_rx_queues) {
+		ret = ice_init_rss(pf);
+		if (ret) {
+			PMD_DRV_LOG(ERR, "Failed to enable rss for PF");
+			return ret;
+		}
 	}

return 0;
--
1.8.3.1

Acked-by Applied
#2 lore raw
Quoted 10 lines

-----Original Message-----
From: Xie, WeiX <[email protected]>
Sent: Tuesday, January 12, 2021 10:25 AM
To: Zhang, AlvinX <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [PATCH] net/ice: fix initialization of RSS look-up table

Quoted 24 lines

Regards,
Xie Wei

Quoted 18 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Zhang,Alvin
Sent: Friday, January 8, 2021 3:29 PM
To: Zhang, Qi Z <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] net/ice: fix initialization of RSS look-up table

From: Alvin Zhang <[email protected]>

RSS look-up table initialization is done incorrectly due to divide-by-zero error. Add a check to rx-queue count.

Fixes 50370662b727 ("net/ice: support device and queue ops")

Applied to dpdk-next-net-intel.

Thanks
Qi