net/bnxt: support thor controller
[dpdk.git] / drivers / net / bnxt / bnxt_rxq.c
index 5345d39..6919acb 100644 (file)
@@ -100,7 +100,8 @@ int bnxt_mq_rx_configure(struct bnxt *bp)
                }
        }
        nb_q_per_grp = bp->rx_cp_nr_rings / pools;
-       PMD_DRV_LOG(ERR, "pools = %u nb_q_per_grp = %u\n", pools, nb_q_per_grp);
+       PMD_DRV_LOG(DEBUG, "pools = %u nb_q_per_grp = %u\n",
+                   pools, nb_q_per_grp);
        start_grp_id = 0;
        end_grp_id = nb_q_per_grp;
 
@@ -287,7 +288,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
                               const struct rte_eth_rxconf *rx_conf,
                               struct rte_mempool *mp)
 {
-       struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
+       struct bnxt *bp = eth_dev->data->dev_private;
        uint64_t rx_offloads = eth_dev->data->dev_conf.rxmode.offloads;
        struct bnxt_rx_queue *rxq;
        int rc = 0;
@@ -333,14 +334,14 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
        rxq->queue_id = queue_idx;
        rxq->port_id = eth_dev->data->port_id;
        if (rx_offloads & DEV_RX_OFFLOAD_KEEP_CRC)
-               rxq->crc_len = ETHER_CRC_LEN;
+               rxq->crc_len = RTE_ETHER_CRC_LEN;
        else
                rxq->crc_len = 0;
 
        eth_dev->data->rx_queues[queue_idx] = rxq;
        /* Allocate RX ring hardware descriptors */
        if (bnxt_alloc_rings(bp, queue_idx, NULL, rxq, rxq->cp_ring,
-                       "rxr")) {
+                       rxq->nq_ring, "rxr")) {
                PMD_DRV_LOG(ERR,
                        "ring_dma_zone_reserve for rx_ring failed!\n");
                bnxt_rx_queue_release_op(rxq);
@@ -354,6 +355,11 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
                                                RTE_ETH_QUEUE_STATE_STARTED;
        eth_dev->data->rx_queue_state[queue_idx] = queue_state;
        rte_spinlock_init(&rxq->lock);
+
+#ifdef RTE_ARCH_X86
+       bnxt_rxq_vec_setup(rxq);
+#endif
+
 out:
        return rc;
 }
@@ -398,7 +404,7 @@ bnxt_rx_queue_intr_disable_op(struct rte_eth_dev *eth_dev, uint16_t queue_id)
 
 int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 {
-       struct bnxt *bp = (struct bnxt *)dev->data->dev_private;
+       struct bnxt *bp = dev->data->dev_private;
        struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf;
        struct bnxt_rx_queue *rxq = bp->rx_queues[rx_queue_id];
        struct bnxt_vnic_info *vnic = NULL;
@@ -418,15 +424,18 @@ int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
        if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) {
                vnic = rxq->vnic;
 
-               if (vnic->fw_grp_ids[rx_queue_id] != INVALID_HW_RING_ID)
-                       return 0;
+               if (BNXT_HAS_RING_GRPS(bp)) {
+                       if (vnic->fw_grp_ids[rx_queue_id] != INVALID_HW_RING_ID)
+                               return 0;
+
+                       vnic->fw_grp_ids[rx_queue_id] =
+                                       bp->grp_info[rx_queue_id].fw_grp_id;
+               }
 
                PMD_DRV_LOG(DEBUG,
                            "vnic = %p fw_grp_id = %d\n",
                            vnic, bp->grp_info[rx_queue_id].fw_grp_id);
 
-               vnic->fw_grp_ids[rx_queue_id] =
-                                       bp->grp_info[rx_queue_id].fw_grp_id;
                rc = bnxt_vnic_rss_configure(bp, vnic);
        }
 
@@ -438,7 +447,7 @@ int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 
 int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 {
-       struct bnxt *bp = (struct bnxt *)dev->data->dev_private;
+       struct bnxt *bp = dev->data->dev_private;
        struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf;
        struct bnxt_vnic_info *vnic = NULL;
        struct bnxt_rx_queue *rxq = NULL;
@@ -463,7 +472,8 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 
        if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) {
                vnic = rxq->vnic;
-               vnic->fw_grp_ids[rx_queue_id] = INVALID_HW_RING_ID;
+               if (BNXT_HAS_RING_GRPS(bp))
+                       vnic->fw_grp_ids[rx_queue_id] = INVALID_HW_RING_ID;
                rc = bnxt_vnic_rss_configure(bp, vnic);
        }