net/bnxt: add Truflow flush-timer to alloc table scope
[dpdk.git] / drivers / net / hns3 / hns3_rss.c
index 737d5f1..a6cab29 100644 (file)
@@ -261,6 +261,9 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
        uint8_t *key = rss_conf->rss_key;
        int ret;
 
+       if (hw->rss_dis_flag)
+               return -EINVAL;
+
        rte_spinlock_lock(&hw->lock);
        ret = hns3_set_rss_tuple_by_rss_hf(hw, tuple, rss_hf);
        if (ret)
@@ -325,8 +328,10 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
        rss_conf->rss_hf = rss_cfg->conf.types;
 
        /* Get the RSS Key required by the user */
-       if (rss_conf->rss_key)
+       if (rss_conf->rss_key && rss_conf->rss_key_len >= HNS3_RSS_KEY_SIZE) {
                memcpy(rss_conf->rss_key, rss_cfg->key, HNS3_RSS_KEY_SIZE);
+               rss_conf->rss_key_len = HNS3_RSS_KEY_SIZE;
+       }
        rte_spinlock_unlock(&hw->lock);
 
        return 0;