From patchwork Fri Oct 6 14:08:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Melton X-Patchwork-Id: 29814 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 465BB1B1A5; Fri, 6 Oct 2017 16:08:58 +0200 (CEST) Received: from alln-iport-6.cisco.com (alln-iport-6.cisco.com [173.37.142.93]) by dpdk.org (Postfix) with ESMTP id 2862D1B1A4 for ; Fri, 6 Oct 2017 16:08:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1338; q=dns/txt; s=iport; t=1507298937; x=1508508537; h=from:to:cc:subject:date:message-id; bh=zu6RFCdP/dxvKqZBF3AHRKeyPhfW14n3byPSEjycGEY=; b=g3BfTPvhURdbB4XiLsJquwaL48k92ayScTixmnZTXXY2YAVA8z+8l/Wo rL59AUqBWgpahXKy63t072MZW65+s5RnENvyE5vwc/bcBKxPXLvwCrffh OpFPA80BOisObsH8y8CG6bI4BCWlRj1QkBWMO+AjgBM30UK6msak3g8Eg g=; X-IronPort-AV: E=Sophos;i="5.42,483,1500940800"; d="scan'208";a="12979379" Received: from alln-core-5.cisco.com ([173.36.13.138]) by alln-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Oct 2017 14:08:56 +0000 Received: from cpp-rtpbld-54.cisco.com (cpp-rtpbld-54.cisco.com [172.18.5.198]) by alln-core-5.cisco.com (8.14.5/8.14.5) with ESMTP id v96E8ugg019834; Fri, 6 Oct 2017 14:08:56 GMT Received: by cpp-rtpbld-54.cisco.com (Postfix, from userid 51544) id D3E70609F9; Fri, 6 Oct 2017 10:08:55 -0400 (EDT) From: Roger B Melton To: jingjing.wu@intel.com Cc: dev@dpdk.org, Roger B Melton Date: Fri, 6 Oct 2017 10:08:53 -0400 Message-Id: <20171006140853.27212-1-rmelton@cisco.com> X-Mailer: git-send-email 2.10.3.dirty Subject: [dpdk-dev] [PATCH v2] net/i40e: improve i40evf buffer cleanup in Tx vector mode 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" Signed-off-by: Roger B Melton --- v2 - Same content as v1, but properly signed-off. i40evf tx vector logic frees mbufs, but it does not remove the mbufs from software rings which leads to double frees. This change corrects that oversight. I've validated this fix within our application. drivers/net/i40e/i40e_rxtx_vec_common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h index 39a6da0..fdc6fce 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_common.h +++ b/drivers/net/i40e/i40e_rxtx_vec_common.h @@ -127,6 +127,7 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) if (likely(m != NULL)) { free[0] = m; nb_free = 1; + txep[0].mbuf = NULL; for (i = 1; i < n; i++) { m = rte_pktmbuf_prefree_seg(txep[i].mbuf); if (likely(m != NULL)) { @@ -139,14 +140,17 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) free[0] = m; nb_free = 1; } + txep[i].mbuf = NULL; } } rte_mempool_put_bulk(free[0]->pool, (void **)free, nb_free); } else { + txep[0].mbuf = NULL; for (i = 1; i < n; i++) { m = rte_pktmbuf_prefree_seg(txep[i].mbuf); if (m != NULL) rte_mempool_put(m->pool, m); + txep[i].mbuf = NULL; } }