summaryrefslogtreecommitdiffstats
path: root/drivers/net/enic/enic_rxtx.c
diff options
context:
space:
mode:
authorRicardo Salveti <ricardo.salveti@linaro.org>2016-07-18 15:30:53 -0300
committerRicardo Salveti <ricardo.salveti@linaro.org>2016-07-18 15:31:22 -0300
commit5d4e5dcd8a186778b3d78e27c81550d07a288fd2 (patch)
treeb84800fce31e7233445a7997c19df409c2a364ea /drivers/net/enic/enic_rxtx.c
parenta41e6ff15809d40e0f9bbc9576bf8f7f80fbec1d (diff)
Imported Upstream version 16.07-rc3
Change-Id: I321148bfa234858ba1986d109470b7aa280cd429 Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Diffstat (limited to 'drivers/net/enic/enic_rxtx.c')
-rw-r--r--drivers/net/enic/enic_rxtx.c10
1 files changed, 8 insertions, 2 deletions
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);