patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Zhang,Alvin" <alvinx.zhang@intel.com>
To: qi.z.zhang@intel.com
Cc: dev@dpdk.org, Alvin Zhang <alvinx.zhang@intel.com>, stable@dpdk.org
Subject: [dpdk-stable] [PATCH] net/ice: fix initialization of RSS look-up table
Date: Fri,  8 Jan 2021 15:29:10 +0800	[thread overview]
Message-ID: <20210108072910.11184-1-alvinx.zhang@intel.com> (raw)

From: Alvin Zhang <alvinx.zhang@intel.com>

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")
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 9a5d6a5..9cef73e 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -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


             reply	other threads:[~2021-01-08  7:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08  7:29 Zhang,Alvin [this message]
2021-01-12  2:25 ` [dpdk-stable] [dpdk-dev] " Xie, WeiX
2021-01-12  4:56   ` Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210108072910.11184-1-alvinx.zhang@intel.com \
    --to=alvinx.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).