X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Fbnxt_rxq.c;h=793a47d112b694c49cb79d58c52b5ecef9d74f6c;hb=5ad753cec8095fe66d3f66a591546e1d13a8abe7;hp=e42308a97fde50c12518d4a8cf071931d9976a3a;hpb=39395b9d41aff5488db4924df94098abbe4d4e8c;p=dpdk.git diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c index e42308a97f..793a47d112 100644 --- a/drivers/net/bnxt/bnxt_rxq.c +++ b/drivers/net/bnxt/bnxt_rxq.c @@ -197,7 +197,7 @@ err_out: void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq) { - struct bnxt_sw_rx_bd *sw_ring; + struct rte_mbuf **sw_ring; struct bnxt_tpa_info *tpa_info; uint16_t i; @@ -210,9 +210,10 @@ void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq) if (sw_ring) { 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; + if (sw_ring[i]) { + if (sw_ring[i] != &rxq->fake_mbuf) + rte_pktmbuf_free_seg(sw_ring[i]); + sw_ring[i] = NULL; } } } @@ -221,9 +222,9 @@ void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq) if (sw_ring) { for (i = 0; i < rxq->rx_ring->ag_ring_struct->ring_size; i++) { - if (sw_ring[i].mbuf) { - rte_pktmbuf_free_seg(sw_ring[i].mbuf); - sw_ring[i].mbuf = NULL; + if (sw_ring[i]) { + rte_pktmbuf_free_seg(sw_ring[i]); + sw_ring[i] = NULL; } } } @@ -305,7 +306,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev, return -EINVAL; } - if (!nb_desc || nb_desc > MAX_RX_DESC_CNT) { + if (nb_desc < BNXT_MIN_RING_DESC || nb_desc > MAX_RX_DESC_CNT) { PMD_DRV_LOG(ERR, "nb_desc %d is invalid\n", nb_desc); rc = -EINVAL; goto out; @@ -326,7 +327,8 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev, rxq->bp = bp; rxq->mb_pool = mp; rxq->nb_rx_desc = nb_desc; - rxq->rx_free_thresh = rx_conf->rx_free_thresh; + rxq->rx_free_thresh = + RTE_MIN(rte_align32pow2(nb_desc) / 4, RTE_BNXT_MAX_RX_BURST); PMD_DRV_LOG(DEBUG, "RX Buf MTU %d\n", eth_dev->data->mtu);