DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rasesh.mody@cavium.com>
To: <dev@dpdk.org>, <ferruh.yigit@intel.com>
Cc: Harish Patil <harish.patil@qlogic.com>, <stable@dpdk.org>,
	<Dept-EngDPDKDev@cavium.com>
Subject: [dpdk-dev] [PATCH 2/3] net/qede: fix VF's RSS configuration failure
Date: Fri, 24 Mar 2017 00:40:58 -0700	[thread overview]
Message-ID: <1490341259-12320-2-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1490341259-12320-1-git-send-email-rasesh.mody@cavium.com>

From: Harish Patil <harish.patil@qlogic.com>

The newer SR-IOV PF drivers expects RX/TX queues to be created before
applying RSS configuration. This patch addresses this requirement by
deferring RSS configuration till the queues are created. Even though
this issue is only seen in SR-IOV context, the changes will be made
applicable to PF also to keep the behavior consistent between VF/PF.

Fixes: 7ab35bf6b97b ("net/qede: fix RSS")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/qede/qede_ethdev.c |   18 +++---------------
 drivers/net/qede/qede_ethdev.h |    2 +-
 drivers/net/qede/qede_rxtx.c   |    9 +++++++++
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 798783b..e096f63 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -798,7 +798,7 @@ static void qede_prandom_bytes(uint32_t *buff)
 		buff[i] = rand();
 }
 
-static int qede_config_rss(struct rte_eth_dev *eth_dev)
+int qede_config_rss(struct rte_eth_dev *eth_dev)
 {
 	struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
 	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
@@ -906,20 +906,8 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 	if (rc != 0)
 		return rc;
 
-	/* Do RSS configuration after vport-start */
-	switch (rxmode->mq_mode) {
-	case ETH_MQ_RX_RSS:
-		rc = qede_config_rss(eth_dev);
-		if (rc != 0) {
-			qdev->ops->vport_stop(edev, 0);
-			qede_dealloc_fp_resc(eth_dev);
-			return -EINVAL;
-		}
-	break;
-	case ETH_MQ_RX_NONE:
-		DP_INFO(edev, "RSS is disabled\n");
-	break;
-	default:
+	if (!(rxmode->mq_mode == ETH_MQ_RX_RSS ||
+	    rxmode->mq_mode == ETH_MQ_RX_NONE)) {
 		DP_ERR(edev, "Unsupported RSS mode\n");
 		qdev->ops->vport_stop(edev, 0);
 		qede_dealloc_fp_resc(eth_dev);
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 799a3ba..9a7e9c2 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -234,7 +234,7 @@ static uint16_t qede_fdir_construct_pkt(struct rte_eth_dev *eth_dev,
 					struct ecore_arfs_config_params *param);
 
 /* Non-static functions */
-void qede_init_rss_caps(uint8_t *rss_caps, uint64_t hf);
+int qede_config_rss(struct rte_eth_dev *eth_dev);
 
 int qed_fill_eth_dev_info(struct ecore_dev *edev,
 				 struct qed_dev_eth_info *info);
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 380d8fb..6c2837e 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -1702,6 +1702,15 @@ int qede_dev_start(struct rte_eth_dev *eth_dev)
 		return rc;
 	}
 
+	/* Newer SR-IOV PF driver expects RX/TX queues to be started before
+	 * enabling RSS. Hence RSS configuration is deferred upto this point.
+	 * Also, we would like to retain similar behavior in PF case, so we
+	 * don't do PF/VF specific check here.
+	 */
+	if (eth_dev->data->dev_conf.rxmode.mq_mode  == ETH_MQ_RX_RSS)
+		if (qede_config_rss(eth_dev))
+			return -1;
+
 	/* Bring-up the link */
 	qede_dev_set_link_state(eth_dev, true);
 
-- 
1.7.10.3

  reply	other threads:[~2017-03-24  7:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24  7:40 [dpdk-dev] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types Rasesh Mody
2017-03-24  7:40 ` Rasesh Mody [this message]
2017-03-24  7:40 ` [dpdk-dev] [PATCH 3/3] net/qede: prevent crash while changing MTU dynamically Rasesh Mody
2017-03-28 12:18 ` [dpdk-dev] [PATCH 1/3] net/qede: fix missing UDP protocol in RSS offload types Ferruh Yigit
2017-03-28 21:20   ` Mody, Rasesh
2017-03-30 14:27 ` Ferruh Yigit

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=1490341259-12320-2-git-send-email-rasesh.mody@cavium.com \
    --to=rasesh.mody@cavium.com \
    --cc=Dept-EngDPDKDev@cavium.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=harish.patil@qlogic.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).