X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fbnxt%2Fbnxt_txq.c;h=53524346d1539695ef2e5a131b2e56afa4777c71;hb=7b2423cd2e84c61d3052147cea7643d15d49d1e9;hp=99dddddfc50ff8be2f15d32f5d9d428cbfa672ee;hpb=2bb1d5db4358b6634bce3e1edaafdcab537db1d7;p=dpdk.git diff --git a/drivers/net/bnxt/bnxt_txq.c b/drivers/net/bnxt/bnxt_txq.c index 99dddddfc5..53524346d1 100644 --- a/drivers/net/bnxt/bnxt_txq.c +++ b/drivers/net/bnxt/bnxt_txq.c @@ -108,8 +108,15 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev, struct bnxt_tx_queue *txq; int rc = 0; + if (queue_idx >= bp->max_tx_rings) { + PMD_DRV_LOG(ERR, + "Cannot create Tx ring %d. Only %d rings available\n", + queue_idx, bp->max_tx_rings); + return -ENOSPC; + } + if (!nb_desc || nb_desc > MAX_TX_DESC_CNT) { - RTE_LOG(ERR, PMD, "nb_desc %d is invalid", nb_desc); + PMD_DRV_LOG(ERR, "nb_desc %d is invalid", nb_desc); rc = -EINVAL; goto out; } @@ -124,7 +131,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev, txq = rte_zmalloc_socket("bnxt_tx_queue", sizeof(struct bnxt_tx_queue), RTE_CACHE_LINE_SIZE, socket_id); if (!txq) { - RTE_LOG(ERR, PMD, "bnxt_tx_queue allocation failed!"); + PMD_DRV_LOG(ERR, "bnxt_tx_queue allocation failed!"); rc = -ENOMEM; goto out; } @@ -142,14 +149,14 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev, /* Allocate TX ring hardware descriptors */ if (bnxt_alloc_rings(bp, queue_idx, txq->tx_ring, NULL, txq->cp_ring, "txr")) { - RTE_LOG(ERR, PMD, "ring_dma_zone_reserve for tx_ring failed!"); + PMD_DRV_LOG(ERR, "ring_dma_zone_reserve for tx_ring failed!"); bnxt_tx_queue_release_op(txq); rc = -ENOMEM; goto out; } if (bnxt_init_one_tx_ring(txq)) { - RTE_LOG(ERR, PMD, "bnxt_init_one_tx_ring failed!"); + PMD_DRV_LOG(ERR, "bnxt_init_one_tx_ring failed!"); bnxt_tx_queue_release_op(txq); rc = -ENOMEM; goto out;