New upstream version 16.11.5
[deb_dpdk.git] / drivers / net / thunderx / nicvf_rxtx.c
index fc43b74..275adb3 100644 (file)
@@ -252,7 +252,7 @@ nicvf_xmit_pkts_multiseg(void *tx_queue, struct rte_mbuf **tx_pkts,
 
        /* Inform HW to xmit the packets */
        nicvf_addr_write(sq->sq_door, used_desc);
-       return nb_pkts;
+       return i;
 }
 
 static const uint32_t ptype_table[16][16] __rte_cache_aligned = {
@@ -469,11 +469,10 @@ nicvf_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
                rxq->head = cqe_head;
                nicvf_addr_write(rxq->cq_door, to_process);
                rxq->recv_buffers += to_process;
-               if (rxq->recv_buffers > rxq->rx_free_thresh) {
-                       rxq->recv_buffers -= nicvf_fill_rbdr(rxq,
-                                               rxq->rx_free_thresh);
-                       NICVF_RX_ASSERT(rxq->recv_buffers >= 0);
-               }
+       }
+       if (rxq->recv_buffers > rxq->rx_free_thresh) {
+               rxq->recv_buffers -= nicvf_fill_rbdr(rxq, rxq->rx_free_thresh);
+               NICVF_RX_ASSERT(rxq->recv_buffers >= 0);
        }
 
        return to_process;
@@ -563,11 +562,10 @@ nicvf_recv_pkts_multiseg(void *rx_queue, struct rte_mbuf **rx_pkts,
                rxq->head = cqe_head;
                nicvf_addr_write(rxq->cq_door, to_process);
                rxq->recv_buffers += buffers_consumed;
-               if (rxq->recv_buffers > rxq->rx_free_thresh) {
-                       rxq->recv_buffers -=
-                               nicvf_fill_rbdr(rxq, rxq->rx_free_thresh);
-                       NICVF_RX_ASSERT(rxq->recv_buffers >= 0);
-               }
+       }
+       if (rxq->recv_buffers > rxq->rx_free_thresh) {
+               rxq->recv_buffers -= nicvf_fill_rbdr(rxq, rxq->rx_free_thresh);
+               NICVF_RX_ASSERT(rxq->recv_buffers >= 0);
        }
 
        return to_process;