eal: remove sys/queue.h from public headers
[dpdk.git] / drivers / net / bnxt / bnxt_txr.c
index 54eaab3..4782433 100644 (file)
@@ -9,6 +9,7 @@
 #include <rte_malloc.h>
 
 #include "bnxt.h"
+#include "bnxt_hwrm.h"
 #include "bnxt_ring.h"
 #include "bnxt_txq.h"
 #include "bnxt_txr.h"
@@ -460,7 +461,7 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
                cons = RING_CMPL(ring_mask, raw_cons);
                txcmp = (struct tx_cmpl *)&cpr->cp_desc_ring[cons];
 
-               if (!CMP_VALID(txcmp, raw_cons, cp_ring_struct))
+               if (!bnxt_cpr_cmp_valid(txcmp, raw_cons, ring_mask + 1))
                        break;
 
                opaque = rte_le_to_cpu_32(txcmp->opaque);
@@ -474,8 +475,6 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
                raw_cons = NEXT_RAW_CMP(raw_cons);
        } while (nb_tx_pkts < ring_mask);
 
-       cpr->valid = !!(raw_cons & cp_ring_struct->ring_size);
-
        if (nb_tx_pkts) {
                if (txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
                        bnxt_tx_cmp_fast(txq, nb_tx_pkts);
@@ -549,6 +548,11 @@ int bnxt_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
        if (rc)
                return rc;
 
+       bnxt_free_hwrm_tx_ring(bp, tx_queue_id);
+       rc = bnxt_alloc_hwrm_tx_ring(bp, tx_queue_id);
+       if (rc)
+               return rc;
+
        dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
        txq->tx_started = true;
        PMD_DRV_LOG(DEBUG, "Tx queue started\n");