Commit 02c0dda8 authored by Yuanhan Liu's avatar Yuanhan Liu Committed by Daniele Di Proietto

netdev-dpdk: fix mbuf leaks

mbufs could be chained (by the "next" field of rte_mbuf struct), when
an mbuf is not big enough to hold a big packet, say when TSO is enabled.

rte_pktmbuf_free_seg() frees the head mbuf only, leading mbuf leaks.
This patch fix it by invoking the right API rte_pktmbuf_free(), to
free all mbufs in the chain.
Signed-off-by: default avatarYuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: default avatarDaniele Di Proietto <diproiettod@vmware.com>
parent 3b18b0d6
......@@ -190,6 +190,7 @@ William Fulton
YAMAMOTO Takashi yamamoto@midokura.com
Yasuhito Takamiya yasuhito@gmail.com
Yu Zhiguo yuzg@cn.fujitsu.com
Yuanhan Liu yuanhan.liu@linux.intel.com
ZhengLingyun konghuarukhr@163.com
Zoltán Balogh zoltan.balogh@ericsson.com
Zoltan Kiss zoltan.kiss@citrix.com
......
......@@ -270,7 +270,7 @@ free_dpdk_buf(struct dp_packet *p)
{
struct rte_mbuf *pkt = (struct rte_mbuf *) p;
rte_pktmbuf_free_seg(pkt);
rte_pktmbuf_free(pkt);
}
static void
......@@ -902,7 +902,7 @@ dpdk_queue_flush__(struct netdev_dpdk *dev, int qid)
int i;
for (i = nb_tx; i < txq->count; i++) {
rte_pktmbuf_free_seg(txq->burst_pkts[i]);
rte_pktmbuf_free(txq->burst_pkts[i]);
}
rte_spinlock_lock(&dev->stats_lock);
dev->stats.tx_dropped += txq->count-nb_tx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment