net/qede: fix VF RSS configuration
authorHarish Patil <harish.patil@qlogic.com>
Fri, 24 Mar 2017 07:40:58 +0000 (00:40 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 4 Apr 2017 17:02:57 +0000 (19:02 +0200)
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")
Cc: stable@dpdk.org
Signed-off-by: Harish Patil <harish.patil@qlogic.com>
drivers/net/qede/qede_ethdev.c
drivers/net/qede/qede_ethdev.h
drivers/net/qede/qede_rxtx.c

index 798783b..e096f63 100644 (file)
@@ -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);
index 3c8ead8..56703da 100644 (file)
@@ -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);
index e72a693..8e634d4 100644 (file)
@@ -1700,6 +1700,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);