net/bnxt: remove VLAN pop action for egress flows
[dpdk.git] / drivers / net / bnxt / bnxt_rxq.c
index 457ebed..793a47d 100644 (file)
@@ -168,10 +168,8 @@ out:
        if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) {
                struct rte_eth_rss_conf *rss = &dev_conf->rx_adv_conf.rss_conf;
 
-               if (bp->flags & BNXT_FLAG_UPDATE_HASH) {
-                       rss = &bp->rss_conf;
+               if (bp->flags & BNXT_FLAG_UPDATE_HASH)
                        bp->flags &= ~BNXT_FLAG_UPDATE_HASH;
-               }
 
                for (i = 0; i < bp->nr_vnics; i++) {
                        vnic = &bp->vnic_info[i];
@@ -199,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;
 
@@ -212,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;
                        }
                }
        }
@@ -223,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;
                        }
                }
        }
@@ -307,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;
@@ -328,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);