net/virtio: fix incorrect cast of void *
[dpdk.git] / drivers / net / bnxt / bnxt_rxq.c
index 0c4e0f6..c4da474 100644 (file)
@@ -60,13 +60,14 @@ void bnxt_free_rxq_stats(struct bnxt_rx_queue *rxq)
 int bnxt_mq_rx_configure(struct bnxt *bp)
 {
        struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf;
+       const struct rte_eth_vmdq_rx_conf *conf =
+                   &dev_conf->rx_adv_conf.vmdq_rx_conf;
        unsigned int i, j, nb_q_per_grp = 1, ring_idx = 0;
        int start_grp_id, end_grp_id = 1, rc = 0;
        struct bnxt_vnic_info *vnic;
        struct bnxt_filter_info *filter;
        enum rte_eth_nb_pools pools = bp->rx_cp_nr_rings, max_pools = 0;
        struct bnxt_rx_queue *rxq;
-       bool rss_dflt_cr = false;
 
        bp->nr_vnics = 0;
 
@@ -102,9 +103,6 @@ int bnxt_mq_rx_configure(struct bnxt *bp)
        /* Multi-queue mode */
        if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_VMDQ_DCB_RSS) {
                /* VMDq ONLY, VMDq+RSS, VMDq+DCB, VMDq+DCB+RSS */
-               const struct rte_eth_vmdq_rx_conf *conf =
-                   &dev_conf->rx_adv_conf.vmdq_rx_conf;
-
 
                switch (dev_conf->rxmode.mq_mode) {
                case ETH_MQ_RX_VMDQ_RSS:
@@ -120,7 +118,7 @@ int bnxt_mq_rx_configure(struct bnxt *bp)
                                pools = max_pools;
                        break;
                case ETH_MQ_RX_RSS:
-                       pools = 1;
+                       pools = bp->rx_cp_nr_rings;
                        break;
                default:
                        RTE_LOG(ERR, PMD, "Unsupported mq_mod %d\n",
@@ -129,13 +127,6 @@ int bnxt_mq_rx_configure(struct bnxt *bp)
                        goto err_out;
                }
        }
-       /*
-        * If MQ RX w/o RSS no need for per VNIC filter.
-        */
-       if ((dev_conf->rxmode.mq_mode & ETH_MQ_RX_VMDQ_DCB) ||
-           (bp->rx_cp_nr_rings &&
-            !(dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS)))
-               rss_dflt_cr = true;
 
        nb_q_per_grp = bp->rx_cp_nr_rings / pools;
        start_grp_id = 0;
@@ -152,18 +143,25 @@ int bnxt_mq_rx_configure(struct bnxt *bp)
                STAILQ_INSERT_TAIL(&bp->ff_pool[i], vnic, next);
                bp->nr_vnics++;
 
-               for (j = 0, ring_idx = 0; j < nb_q_per_grp; j++, ring_idx++) {
+               for (j = 0; j < nb_q_per_grp; j++, ring_idx++) {
                        rxq = bp->eth_dev->data->rx_queues[ring_idx];
                        rxq->vnic = vnic;
                }
-               if (i == 0)
+               if (i == 0) {
+                       if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_VMDQ_DCB) {
+                               bp->eth_dev->data->promiscuous = 1;
+                               vnic->flags |= BNXT_VNIC_INFO_PROMISC;
+                       }
                        vnic->func_default = true;
+               }
                vnic->ff_pool_idx = i;
                vnic->start_grp_id = start_grp_id;
                vnic->end_grp_id = end_grp_id;
 
-               if (rss_dflt_cr && i) {
-                       vnic->rss_dflt_cr = true;
+               if (i) {
+                       if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_VMDQ_DCB ||
+                           !(dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS))
+                               vnic->rss_dflt_cr = true;
                        goto skip_filter_allocation;
                }
                filter = bnxt_alloc_filter(bp);
@@ -208,7 +206,7 @@ out:
 
                for (i = 0; i < bp->nr_vnics; i++) {
                        STAILQ_FOREACH(vnic, &bp->ff_pool[i], next) {
-                       vnic->hash_type |= hash_type;
+                       vnic->hash_type = hash_type;
 
                        /*
                         * Use the supplied key if the key length is