From patchwork Mon Oct 9 08:53:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 29921 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 964CA1AEF6; Mon, 9 Oct 2017 03:00:17 +0200 (CEST) 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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); }