diff options
author | Ricardo Salveti <ricardo.salveti@linaro.org> | 2016-07-18 15:30:53 -0300 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-07-19 08:27:41 +0200 |
commit | 9ecc306d7eeeb3bb612b968250f203093a721781 (patch) | |
tree | 6533caba388d0f50d5119ac41fe7b8e479f47290 /drivers/net/enic/enic_rxtx.c | |
parent | 8be94df6e9f5f70516cb86d82dd04fefaa0fe8b3 (diff) |
Imported Upstream version 16.07-rc3
Change-Id: I321148bfa234858ba1986d109470b7aa280cd429
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'drivers/net/enic/enic_rxtx.c')
-rw-r--r-- | drivers/net/enic/enic_rxtx.c | 10 |
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); |