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 B8A5099A9 for ; Thu, 25 May 2017 11:52:07 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 May 2017 02:52:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,391,1491289200"; d="scan'208";a="91624645" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by orsmga002.jf.intel.com with ESMTP; 25 May 2017 02:52:06 -0700 From: Yuanhan Liu To: Alejandro Lucero Cc: Yuanhan Liu , dpdk stable Date: Thu, 25 May 2017 17:49:27 +0800 Message-Id: <1495705809-21416-115-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1495705809-21416-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1495705809-21416-1-git-send-email-yuanhan.liu@linux.intel.com> Subject: [dpdk-stable] patch 'net/nfp: fix releasing muti-segment mbufs' has been queued to stable release 17.02.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 May 2017 09:52:08 -0000 Hi, FYI, your patch has been queued to stable release 17.02.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/28/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 0aba984ea635cd555bf5b6165adf663c7105a723 Mon Sep 17 00:00:00 2001 From: Alejandro Lucero Date: Wed, 26 Apr 2017 11:27:07 +0100 Subject: [PATCH] net/nfp: fix releasing muti-segment mbufs [ upstream commit aaef1010af2dc14ca2e3b5be554169a486127700 ] If segments are used, just mbufs previously linked to head descriptor of a mbuf chain are released. Other Tx descriptor are used for the mbuf chain but they keep their linked mbufs without releasing them. It is not a fatal issue because sooner or later those descriptors will be head descriptors or just used for a single mbuf packet, then those linked mbufs will be released. However, this leads to apps needing bigger mbufs pools and some confusion about memory requirements. Indeed, because larger pools, some performance impact could also be expected due to cache misses. With this patch all Tx descriptors will release linked mbufs inside the xmit function, and rte_pktmbuf_seg_free is used instead of rte_pktmbuf_free. Fixes: 142854c62134 ("nfp: fix freeing multi-mbuf packets") Signed-off-by: Alejandro Lucero --- drivers/net/nfp/nfp_net.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index d1e6eac..04942b7 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -2120,18 +2120,20 @@ nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) */ pkt_size = pkt->pkt_len; - /* Releasing mbuf which was prefetched above */ - if (*lmbuf) - rte_pktmbuf_free(*lmbuf); - /* - * Linking mbuf with descriptor for being released - * next time descriptor is used - */ - *lmbuf = pkt; - while (pkt_size) { /* Copying TSO, VLAN and cksum info */ *txds = txd; + + /* Releasing mbuf used by this descriptor previously*/ + if (*lmbuf) + rte_pktmbuf_free_seg(*lmbuf); + + /* + * Linking mbuf with descriptor for being released + * next time descriptor is used + */ + *lmbuf = pkt; + dma_size = pkt->data_len; dma_addr = rte_mbuf_data_dma_addr(pkt); PMD_TX_LOG(DEBUG, "Working with mbuf at dma address:" @@ -2159,6 +2161,7 @@ nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) } /* Referencing next free TX descriptor */ txds = &txq->txds[txq->wr_p]; + lmbuf = &txq->txbufs[txq->wr_p].mbuf; issued_descs++; } i++; -- 1.9.0