From 66e10b8dbbc2e9554b3d95b835473421ab147a25 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Wed, 3 Oct 2018 10:03:49 +0100 Subject: [PATCH] net/sfc: use mbuf raw free instead of mempool put directly mbuf raw free adds debug build checks to ensure that mbuf is really OK to be returned to mempool. Signed-off-by: Andrew Rybchenko Reviewed-by: Ivan Malov --- drivers/net/sfc/sfc_ef10_essb_rx.c | 4 ++-- drivers/net/sfc/sfc_ef10_rx.c | 4 ++-- drivers/net/sfc/sfc_rx.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c index 81c8f7fbd2..e5fc8506b6 100644 --- a/drivers/net/sfc/sfc_ef10_essb_rx.c +++ b/drivers/net/sfc/sfc_ef10_essb_rx.c @@ -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--; } diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c index 5c0152d01f..946d96cacc 100644 --- a/drivers/net/sfc/sfc_ef10_rx.c +++ b/drivers/net/sfc/sfc_ef10_rx.c @@ -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; } diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index 58c57acfee..0385fca165 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -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 -- 2.20.1