net/iavf: workaround RSS cleanup failure handling
authorXuan Ding <xuan.ding@intel.com>
Mon, 18 Jan 2021 08:28:26 +0000 (08:28 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 19 Jan 2021 12:49:41 +0000 (13:49 +0100)
Allow to ignore error returned from virtual channel command
 VIRTCHNL_OP_SET_RSS_HENA with hena = 0 due to some legacy
kernel driver does not support this. Add warning message when
this happen.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_ethdev.c

index 871c3ed..cf6ea0b 100644 (file)
@@ -1250,11 +1250,15 @@ iavf_dev_rss_hash_update(struct rte_eth_dev *dev,
        if (rss_conf->rss_hf == 0)
                return 0;
 
-       /* Overwritten default RSS. */
+       /* Clear existing RSS. */
        ret = iavf_set_hena(adapter, 0);
+
+       /* It is a workaround, temporarily allow error to be returned
+        * due to possible lack of PF handling for hena = 0.
+        */
        if (ret)
-               PMD_DRV_LOG(ERR, "%s Remove rss vsi fail %d",
-                           __func__, ret);
+               PMD_DRV_LOG(WARNING, "fail to clean existing RSS,"
+                           "lack PF support");
 
        /* Set new RSS configuration. */
        ret = iavf_rss_hash_set(adapter, rss_conf->rss_hf, true);
@@ -2177,10 +2181,12 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
 
        /* Set hena = 0 to ask PF to cleanup all existing RSS. */
        ret = iavf_set_hena(adapter, 0);
-       if (ret) {
-               PMD_DRV_LOG(ERR, "fail to disable default PF RSS");
-               return ret;
-       }
+       if (ret)
+               /* It is a workaround, temporarily allow error to be returned
+                * due to possible lack of PF handling for hena = 0.
+                */
+               PMD_DRV_LOG(WARNING, "fail to disable default RSS,"
+                           "lack PF support");
 
        return 0;
 }