net/hns3: fix RSS configuration on empty RSS type
authorLijun Ou <oulijun@huawei.com>
Tue, 14 Jul 2020 06:16:09 +0000 (14:16 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 17 Jul 2020 16:21:21 +0000 (18:21 +0200)
According to the definition of RSS types of action attributes from
testpmd, the driver will not disable RSS but instead requests the
unspecified "best-effort" settings when upper application call
rte_flow_create API function to create flow using empty RSS types.

As a result, here use the default RSS types when RSS types is empty.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
drivers/net/hns3/hns3_flow.c

index 1e58ad7..7ec46ae 100644 (file)
@@ -1486,7 +1486,9 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,
        }
 
        /* Filter the unsupported flow types */
-       flow_types = rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT;
+       flow_types = conf->conf.types ?
+                    rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT :
+                    hw->rss_info.conf.types;
        if (flow_types != rss_flow_conf.types)
                hns3_warn(hw, "modified RSS types based on hardware support, "
                              "requested:%" PRIx64 " configured:%" PRIx64,
@@ -1494,9 +1496,6 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,
        /* Update the useful flow types */
        rss_flow_conf.types = flow_types;
 
-       if ((rss_flow_conf.types & ETH_RSS_PROTO_MASK) == 0)
-               return hns3_disable_rss(hw);
-
        rss_info = &hw->rss_info;
        if (!add) {
                if (hns3_action_rss_same(&rss_info->conf, &rss_flow_conf)) {