From patchwork Mon Apr 23 11:23:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Lucero X-Patchwork-Id: 38689 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 5E76D1DBA; Mon, 23 Apr 2018 13:24:52 +0200 (CEST) Received: from netronome.com (host-79-78-33-110.static.as9105.net [79.78.33.110]) by dpdk.org (Postfix) with ESMTP id 686041C0B; Mon, 23 Apr 2018 13:24:50 +0200 (CEST) Received: from netronome.com (localhost [127.0.0.1]) by netronome.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id w3NBNwS6022319; Mon, 23 Apr 2018 12:23:58 +0100 Received: (from alucero@localhost) by netronome.com (8.14.4/8.14.4/Submit) id w3NBNwWa022318; Mon, 23 Apr 2018 12:23:58 +0100 From: Alejandro Lucero To: dev@dpdk.org Cc: stable@dpdk.org Date: Mon, 23 Apr 2018 12:23:58 +0100 Message-Id: <1524482638-22281-1-git-send-email-alejandro.lucero@netronome.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] net/nfp: fix mbufs releasing when stop or close 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" PMDs have the responsabilty of releasing mbufs sent through xmit burst function. NFP PMD attaches those sent mbufs to the TX ring structure, and it is at the next time a specific ring descriptor is going to be used when the previous linked mbuf, already transmitted at that point, is released. Those mbufs belonging to a chained mbuf got its own link to a ring descriptor, and they are released independently of the mbuf head of that chain. The problem is how those mbufs are released when the PMD is stopped or closed. Instead of releasing those mbufs as the xmit functions does, this is independently of being in a mbuf chain, the code calls rte_pktmbuf_free which will release not just the mbuf head in that chain but all the chained mbufs. The loop will try to release those mbufs which have already been released again when chained mbufs exist. This patch fixes the problem using rte_pktmbuf_free_seg instead. Fixes: b812daadad0d ("nfp: add Rx and Tx") Signed-off-by: Alejandro Lucero --- drivers/net/nfp/nfp_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 2a4b006..a5875f2 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -263,7 +263,7 @@ enum nfp_qcp_ptr { for (i = 0; i < txq->tx_count; i++) { if (txq->txbufs[i].mbuf) { - rte_pktmbuf_free(txq->txbufs[i].mbuf); + rte_pktmbuf_free_seg(txq->txbufs[i].mbuf); txq->txbufs[i].mbuf = NULL; } }