examples/ipsec-secgw: replace strncpy with strlcpy
[dpdk.git] / drivers / net / bnxt / bnxt_rxq.c
index 1b7fc7a..e939c9a 100644 (file)
@@ -267,6 +267,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);
        }
@@ -280,6 +282,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
                               struct rte_mempool *mp)
 {
        struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
+       uint64_t rx_offloads = eth_dev->data->dev_conf.rxmode.offloads;
        struct bnxt_rx_queue *rxq;
        int rc = 0;
 
@@ -322,12 +325,12 @@ 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;
-       rxq->crc_len = (uint8_t)((eth_dev->data->dev_conf.rxmode.hw_strip_crc) ?
-                               0 : ETHER_CRC_LEN);
+       rxq->crc_len = rx_offloads & DEV_RX_OFFLOAD_CRC_STRIP ?
+               0 : ETHER_CRC_LEN;
 
        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")) {
                PMD_DRV_LOG(ERR,
                        "ring_dma_zone_reserve for rx_ring failed!\n");
@@ -335,6 +338,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
                rc = -ENOMEM;
                goto out;
        }
+       rte_atomic64_init(&rxq->rx_mbuf_alloc_fail);
 
 out:
        return rc;