net/mvpp2: support forwarding bad packets
[dpdk.git] / drivers / net / hns3 / hns3_rss.c
index 2efd410..b5df374 100644 (file)
@@ -2,12 +2,9 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <stdbool.h>
 #include <rte_ethdev.h>
 #include <rte_io.h>
 #include <rte_malloc.h>
-#include <rte_memcpy.h>
-#include <rte_spinlock.h>
 
 #include "hns3_ethdev.h"
 #include "hns3_logs.h"
@@ -510,7 +507,7 @@ hns3_dev_rss_reta_update(struct rte_eth_dev *dev,
        struct hns3_rss_conf *rss_cfg = &hw->rss_info;
        uint16_t i, indir_size = HNS3_RSS_IND_TBL_SIZE; /* Table size is 512 */
        uint16_t indirection_tbl[HNS3_RSS_IND_TBL_SIZE];
-       uint16_t idx, shift, allow_rss_queues;
+       uint16_t idx, shift;
        int ret;
 
        if (reta_size != indir_size || reta_size > ETH_RSS_RETA_SIZE_512) {
@@ -522,16 +519,15 @@ hns3_dev_rss_reta_update(struct rte_eth_dev *dev,
        rte_spinlock_lock(&hw->lock);
        memcpy(indirection_tbl, rss_cfg->rss_indirection_tbl,
               sizeof(rss_cfg->rss_indirection_tbl));
-       allow_rss_queues = RTE_MIN(dev->data->nb_rx_queues, hw->rss_size_max);
        for (i = 0; i < reta_size; i++) {
                idx = i / RTE_RETA_GROUP_SIZE;
                shift = i % RTE_RETA_GROUP_SIZE;
-               if (reta_conf[idx].reta[shift] >= allow_rss_queues) {
+               if (reta_conf[idx].reta[shift] >= hw->alloc_rss_size) {
                        rte_spinlock_unlock(&hw->lock);
-                       hns3_err(hw, "Invalid queue id(%u) to be set in "
-                                "redirection table, max number of rss "
-                                "queues: %u", reta_conf[idx].reta[shift],
-                                allow_rss_queues);
+                       hns3_err(hw, "queue id(%u) set to redirection table "
+                                "exceeds queue number(%u) allocated to a TC",
+                                reta_conf[idx].reta[shift],
+                                hw->alloc_rss_size);
                        return -EINVAL;
                }
 
@@ -637,16 +633,11 @@ hns3_set_rss_tc_mode(struct hns3_hw *hw)
 static void
 hns3_rss_tuple_uninit(struct hns3_hw *hw)
 {
-       struct hns3_rss_input_tuple_cmd *req;
        struct hns3_cmd_desc desc;
        int ret;
 
        hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_INPUT_TUPLE, false);
 
-       req = (struct hns3_rss_input_tuple_cmd *)desc.data;
-
-       memset(req, 0, sizeof(struct hns3_rss_tuple_cfg));
-
        ret = hns3_cmd_send(hw, &desc, 1);
        if (ret) {
                hns3_err(hw, "RSS uninit tuple failed %d", ret);