New upstream version 16.11.7
[deb_dpdk.git] / drivers / net / bnxt / bnxt_rxq.c
index cddf17d..b7b170b 100644 (file)
@@ -221,7 +221,8 @@ static void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq __rte_unused)
        if (rxq) {
                sw_ring = rxq->rx_ring->rx_buf_ring;
                if (sw_ring) {
-                       for (i = 0; i < rxq->nb_rx_desc; i++) {
+                       for (i = 0;
+                            i < rxq->rx_ring->rx_ring_struct->ring_size; i++) {
                                if (sw_ring[i].mbuf) {
                                        rte_pktmbuf_free_seg(sw_ring[i].mbuf);
                                        sw_ring[i].mbuf = NULL;
@@ -256,6 +257,8 @@ void bnxt_rx_queue_release_op(void *rx_queue)
                bnxt_free_ring(rxq->cp_ring->cp_ring_struct);
 
                bnxt_free_rxq_stats(rxq);
+               rte_memzone_free(rxq->mz);
+               rxq->mz = NULL;
 
                rte_free(rxq);
        }
@@ -306,7 +309,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 
        eth_dev->data->rx_queues[queue_idx] = rxq;
        /* Allocate RX ring hardware descriptors */
-       if (bnxt_alloc_rings(bp, queue_idx, NULL, rxq->rx_ring, rxq->cp_ring,
+       if (bnxt_alloc_rings(bp, queue_idx, NULL, rxq, rxq->cp_ring,
                        "rxr")) {
                RTE_LOG(ERR, PMD, "ring_dma_zone_reserve for rx_ring failed!");
                bnxt_rx_queue_release_op(rxq);