X-Git-Url: https://gerrit.fd.io/r/gitweb?p=deb_dpdk.git;a=blobdiff_plain;f=drivers%2Fnet%2Fenic%2Fenic_rxtx.c;fp=drivers%2Fnet%2Fenic%2Fenic_rxtx.c;h=845a8e6691ccc57cc3f4564aa7acf53e24229a3f;hp=2f4a08c58162a4d3e6482fd1fd1f586cdb5653ae;hb=5d4e5dcd8a186778b3d78e27c81550d07a288fd2;hpb=a41e6ff15809d40e0f9bbc9576bf8f7f80fbec1d diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c index 2f4a08c5..845a8e66 100644 --- a/drivers/net/enic/enic_rxtx.c +++ b/drivers/net/enic/enic_rxtx.c @@ -398,7 +398,14 @@ static inline void enic_free_wq_bufs(struct vnic_wq *wq, u16 completed_index) pool = ((struct rte_mbuf *)buf->mb)->pool; for (i = 0; i < nb_to_free; i++) { buf = &wq->bufs[tail_idx]; - m = (struct rte_mbuf *)(buf->mb); + m = __rte_pktmbuf_prefree_seg((struct rte_mbuf *)(buf->mb)); + buf->mb = NULL; + + if (unlikely(m == NULL)) { + tail_idx = enic_ring_incr(desc_count, tail_idx); + continue; + } + if (likely(m->pool == pool)) { RTE_ASSERT(nb_free < ENIC_MAX_WQ_DESCS); free[nb_free++] = m; @@ -409,7 +416,6 @@ static inline void enic_free_wq_bufs(struct vnic_wq *wq, u16 completed_index) pool = m->pool; } tail_idx = enic_ring_incr(desc_count, tail_idx); - buf->mb = NULL; } rte_mempool_put_bulk(pool, (void **)free, nb_free);