From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 139F11AEF4; Mon, 9 Oct 2017 03:00:15 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2017 18:00:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,497,1500966000"; d="scan'208";a="1228499019" Received: from dpdk100g.sh.intel.com ([10.67.111.105]) by fmsmga002.fm.intel.com with ESMTP; 08 Oct 2017 18:00:13 -0700 From: Qi Zhang To: jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, Qi Zhang , stable@dpdk.org Date: Mon, 9 Oct 2017 04:53:45 -0400 Message-Id: <20171009085345.46357-1-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.9.5 Subject: [dpdk-dev] [PATCH] net/i40e: fix unexpected mbuf free in vPMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 01:00:16 -0000 The patch reset tx queue sw_ring's mbuf to NULL after it is free in i40_tx_free_bufs, this prevent same mbuf be free again in i40e_dev_tx_queue_release. This fix follow the same implemenation of non-vPMD. Fixes: b4669bb95038 ("i40e: add vector Tx") Cc: stable@dpdk.org Signed-off-by: Qi Zhang --- drivers/net/i40e/i40e_rxtx_vec_common.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h index 39a6da0..ed51b4d 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_common.h +++ b/drivers/net/i40e/i40e_rxtx_vec_common.h @@ -124,11 +124,13 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) */ txep = &txq->sw_ring[txq->tx_next_dd - (n - 1)]; m = rte_pktmbuf_prefree_seg(txep[0].mbuf); + txep[0].mbuf = NULL; if (likely(m != NULL)) { free[0] = m; nb_free = 1; for (i = 1; i < n; i++) { m = rte_pktmbuf_prefree_seg(txep[i].mbuf); + txep[i].mbuf = NULL; if (likely(m != NULL)) { if (likely(m->pool == free[0]->pool)) { free[nb_free++] = m; @@ -145,6 +147,7 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) } else { for (i = 1; i < n; i++) { m = rte_pktmbuf_prefree_seg(txep[i].mbuf); + txep[i].mbuf = NULL; if (m != NULL) rte_mempool_put(m->pool, m); } -- 2.9.5