/* Disable RSS */
hw->rss_info.conf.types = 0;
+ hw->rss_dis_flag = true;
return 0;
}
return -EINVAL;
}
+ if (rss_flow_conf.key_len &&
+ rss_flow_conf.key_len > RTE_DIM(rss_info->key)) {
+ hns3_err(hw,
+ "input hash key(%u) greater than supported len(%zu)",
+ rss_flow_conf.key_len, RTE_DIM(rss_info->key));
+ return -EINVAL;
+ }
+
/* Filter the unsupported flow types */
flow_types = rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT;
if (flow_types != rss_flow_conf.types)
return hns3_config_rss_filter(dev, &hw->rss_info, false);
}
+/* Restore the rss filter */
+int
+hns3_restore_rss_filter(struct rte_eth_dev *dev)
+{
+ struct hns3_adapter *hns = dev->data->dev_private;
+ struct hns3_hw *hw = &hns->hw;
+
+ if (hw->rss_info.conf.queue_num == 0)
+ return 0;
+
+ return hns3_config_rss_filter(dev, &hw->rss_info, true);
+}
+
static int
hns3_flow_parse_rss(struct rte_eth_dev *dev,
const struct hns3_rss_conf *conf, bool add)
}
ret = hns3_clear_rss_filter(dev);
- if (ret)
+ if (ret) {
+ rte_flow_error_set(error, ret, RTE_FLOW_ERROR_TYPE_HANDLE,
+ NULL, "Failed to flush rss filter");
return ret;
+ }
hns3_filterlist_flush(dev);