[dpdk-dev] [dpdk-stable] [PATCH v3 1/5] net/tap: fix mbuf double free when writev fails

Stephen Hemminger stephen at networkplumber.org
Thu Apr 9 16:51:24 CEST 2020


On Thu, 9 Apr 2020 08:03:23 +0000
wangyunjian <wangyunjian at huawei.com> wrote:

> error = tap_write_mbufs(txq, num_mbufs, mbuf,
>                      &num_packets, &num_tx_bytes);
> if (error == -1) {
>     txq->stats.errs++;
>     /* free tso mbufs */
>     for (j = 0; j < ret; j++)
>         rte_pktmbuf_free(mbuf[j]);
>     break;
> }

There is a free bulk, and normally each buf counts against errors.

        if (error == -1) {
		txq->stats.errs += num_packets;
		rte_pktmbuf_free_bulk(mbuf, num_packets);
		break;
	}



More information about the dev mailing list