net/sfc: use mbuf raw free instead of mempool put directly
authorAndrew Rybchenko <arybchenko@solarflare.com>
Wed, 3 Oct 2018 09:03:49 +0000 (10:03 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 11 Oct 2018 16:53:49 +0000 (18:53 +0200)
mbuf raw free adds debug build checks to ensure that mbuf is
really OK to be returned to mempool.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
drivers/net/sfc/sfc_ef10_essb_rx.c
drivers/net/sfc/sfc_ef10_rx.c
drivers/net/sfc/sfc_rx.c

index 81c8f7f..e5fc850 100644 (file)
@@ -324,7 +324,7 @@ sfc_ef10_essb_rx_get_pending(struct sfc_ef10_essb_rxq *rxq,
 
                        /* Buffers to be discarded have 0 in packet type */
                        if (unlikely(m->packet_type == 0)) {
-                               rte_mempool_put(rxq->refill_mb_pool, m);
+                               rte_mbuf_raw_free(m);
                                goto next_buf;
                        }
 
@@ -687,7 +687,7 @@ sfc_ef10_essb_rx_qpurge(struct sfc_dp_rxq *dp_rxq)
                m = sfc_ef10_essb_mbuf_by_index(rxq, rxd->first_mbuf,
                                rxq->block_size - rxq->left_in_completed);
                while (rxq->left_in_completed > 0) {
-                       rte_mempool_put(rxq->refill_mb_pool, m);
+                       rte_mbuf_raw_free(m);
                        m = sfc_ef10_essb_next_mbuf(rxq, m);
                        rxq->left_in_completed--;
                }
index 5c0152d..946d96c 100644 (file)
@@ -238,7 +238,7 @@ sfc_ef10_rx_process_event(struct sfc_ef10_rxq *rxq, efx_qword_t rx_ev,
                rxq->completed += ready;
                while (ready-- > 0) {
                        rxd = &rxq->sw_ring[completed++ & ptr_mask];
-                       rte_mempool_put(rxq->refill_mb_pool, rxd->mbuf);
+                       rte_mbuf_raw_free(rxd->mbuf);
                }
                return 0;
        }
@@ -648,7 +648,7 @@ sfc_ef10_rx_qpurge(struct sfc_dp_rxq *dp_rxq)
 
        for (i = rxq->completed; i != rxq->added; ++i) {
                rxd = &rxq->sw_ring[i & rxq->ptr_mask];
-               rte_mempool_put(rxq->refill_mb_pool, rxd->mbuf);
+               rte_mbuf_raw_free(rxd->mbuf);
                rxd->mbuf = NULL;
        }
 
index 58c57ac..0385fca 100644 (file)
@@ -296,7 +296,7 @@ sfc_efx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 
 discard:
                discard_next = ((desc_flags & EFX_PKT_CONT) != 0);
-               rte_mempool_put(rxq->refill_mb_pool, m);
+               rte_mbuf_raw_free(m);
                rxd->mbuf = NULL;
        }
 
@@ -498,7 +498,7 @@ sfc_efx_rx_qpurge(struct sfc_dp_rxq *dp_rxq)
 
        for (i = rxq->completed; i != rxq->added; ++i) {
                rxd = &rxq->sw_desc[i & rxq->ptr_mask];
-               rte_mempool_put(rxq->refill_mb_pool, rxd->mbuf);
+               rte_mbuf_raw_free(rxd->mbuf);
                rxd->mbuf = NULL;
                /* Packed stream relies on 0 in inactive SW desc.
                 * Rx queue stop is not performance critical, so