mbuf: remove build option to disable refcnt
[dpdk.git] / lib / librte_pmd_ixgbe / ixgbe_rxtx_vec.c
index 3a30fa7..1f46f0f 100644 (file)
@@ -402,10 +402,10 @@ reassemble_packets(struct igb_rx_queue *rxq, struct rte_mbuf **rx_bufs,
        struct rte_mbuf *pkts[RTE_IXGBE_VPMD_RX_BURST]; /*finished pkts*/
        struct rte_mbuf *start = rxq->pkt_first_seg;
        struct rte_mbuf *end =  rxq->pkt_last_seg;
-       unsigned pkt_idx = 0, buf_idx = 0;
+       unsigned pkt_idx, buf_idx;
 
 
-       while (buf_idx < nb_bufs) {
+       for (buf_idx = 0, pkt_idx = 0; buf_idx < nb_bufs; buf_idx++) {
                if (end != NULL) {
                        /* processing a split packet */
                        end->next = rx_bufs[buf_idx];
@@ -448,7 +448,6 @@ reassemble_packets(struct igb_rx_queue *rxq, struct rte_mbuf **rx_bufs,
                        rx_bufs[buf_idx]->data_len += rxq->crc_len;
                        rx_bufs[buf_idx]->pkt_len += rxq->crc_len;
                }
-               buf_idx++;
        }
 
        /* save the partial packet for next time */
@@ -489,7 +488,7 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
        unsigned i = 0;
        if (rxq->pkt_first_seg == NULL) {
                /* find the first split flag, and only reassemble then*/
-               while (!split_flags[i] && i < nb_bufs)
+               while (i < nb_bufs && !split_flags[i])
                        i++;
                if (i == nb_bufs)
                        return nb_bufs;
@@ -540,20 +539,12 @@ ixgbe_tx_free_bufs(struct igb_tx_queue *txq)
         */
        txep = &((struct igb_tx_entry_v *)txq->sw_ring)[txq->tx_next_dd -
                        (n - 1)];
-#ifdef RTE_MBUF_REFCNT
        m = __rte_pktmbuf_prefree_seg(txep[0].mbuf);
-#else
-       m = txep[0].mbuf;
-#endif
        if (likely(m != NULL)) {
                free[0] = m;
                nb_free = 1;
                for (i = 1; i < n; i++) {
-#ifdef RTE_MBUF_REFCNT
                        m = __rte_pktmbuf_prefree_seg(txep[i].mbuf);
-#else
-                       m = txep[i].mbuf;
-#endif
                        if (likely(m != NULL)) {
                                if (likely(m->pool == free[0]->pool))
                                        free[nb_free++] = m;