From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by dpdk.org (Postfix) with ESMTP id 0870B1B5F3 for ; Fri, 14 Dec 2018 02:26:27 +0100 (CET) Received: by mail-pl1-f195.google.com with SMTP id a14so1901322plm.12 for ; Thu, 13 Dec 2018 17:26:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nvJQagoLn/iJwkBl6QU937UalmyVw8ooczRh5C56e58=; b=B9CNJsgwxCPjAgA3vkImPoANXpzs6cr+tfnbDU/pRaqOwvs6qnl/lcj8FRW8xtUdH4 Ku2ga44KutL+4IwmrR0oJ70/njnV89GweAjaz88Ld/TYD3hQS1GcpfHNYlb7mXi88g6U 2heV2q26l5QU/ZEy1XbYFDSTnCykh9r71DdyCcMJDaQy2hdEVPQiYqSL+jQI676cQMfj CF4a34oS8kMORdZokNF23hMXrnxEqM4zBIYnKZ5zzDzKwaQwkQhYWPKPmEjttmpiH0jb uSB0Mcx42eQdfUBpSuPCHZfIiCOOMV7lZhlveZFmCVeHalrCDCb65ixelhEk/V7+gKDz aoLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nvJQagoLn/iJwkBl6QU937UalmyVw8ooczRh5C56e58=; b=sXF4TCvO+X6UxKBICz0ZEiRyJUSZS4b5YIQFm+F+XOjhBNHdsO6QpCC+/99OjuoJpI 9VXPutMM/mom1uUhpOFnZduSWxnNPbM9oqs8/pksFfvPzeoCbVc5EdrX1CAH9ZSgiqar xDHZqXDR/iE8oEdNyv7mDqTUbdXxfYQCKQtrxmOGBuvFjGvw/McxgG86EGOEqualyvya ihP/Oa5U3awqwiWB691Kh5z4xHgsJZiOj0pr96bggkj0G8kTrAlQlelIsByOC1RoJrZt u2jrkzymUrzL2LsUn5ehwkd3FpFsPTkc/N0WcxZikVXuWWcjplYFt6CJDz7laVKsEB2t mjAQ== X-Gm-Message-State: AA+aEWZ/Zo4fi7taZxPHM3nDPqS0xZDAV5+55csK0EPnGpITccIjjLLj 1KIzzeGElzcRF4J7dqZkuklkp0gJ9+0= X-Google-Smtp-Source: AFSGD/UkvJv40Xe7HYT5T4tKusfiSN1yfJqz1ID2Fu7RmxtYXQS0CzAWuQUlPAf61pl7wOKuoAPlcw== X-Received: by 2002:a17:902:28e9:: with SMTP id f96mr1018815plb.169.1544750786767; Thu, 13 Dec 2018 17:26:26 -0800 (PST) Received: from xeon-e3.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id i21sm3379085pgm.17.2018.12.13.17.26.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Dec 2018 17:26:25 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Stephen Hemminger Date: Thu, 13 Dec 2018 17:26:20 -0800 Message-Id: <20181214012621.15213-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181214012621.15213-1-stephen@networkplumber.org> References: <20181214012621.15213-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/3] net/netvsc: cleanup transmit descriptor pool 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: Fri, 14 Dec 2018 01:26:28 -0000 On device close or startup errors, the transmit descriptor pool was being left behind. Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_ethdev.c | 2 ++ drivers/net/netvsc/hn_rxtx.c | 11 +++++++++++ drivers/net/netvsc/hn_var.h | 1 + 3 files changed, 14 insertions(+) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index d7ac0c7320b0..de872212d3f3 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -796,6 +796,7 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev) failed: PMD_INIT_LOG(NOTICE, "device init failed"); + hn_tx_pool_uninit(eth_dev); hn_detach(hv); return err; } @@ -818,6 +819,7 @@ eth_hn_dev_uninit(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = NULL; hn_detach(hv); + hn_tx_pool_uninit(eth_dev); rte_vmbus_chan_close(hv->primary->chan); rte_free(hv->primary); rte_eth_dev_owner_delete(hv->owner.id); diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 622a83983e10..6197118b01ee 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -199,6 +199,17 @@ hn_tx_pool_init(struct rte_eth_dev *dev) return 0; } +void +hn_tx_pool_uninit(struct rte_eth_dev *dev) +{ + struct hn_data *hv = dev->data->dev_private; + + if (hv->tx_pool) { + rte_mempool_free(hv->tx_pool); + hv->tx_pool = NULL; + } +} + static void hn_reset_txagg(struct hn_tx_queue *txq) { txq->agg_szleft = txq->agg_szmax; diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h index cd173f6af942..7f3266c451fb 100644 --- a/drivers/net/netvsc/hn_var.h +++ b/drivers/net/netvsc/hn_var.h @@ -150,6 +150,7 @@ uint16_t hn_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts); int hn_tx_pool_init(struct rte_eth_dev *dev); +void hn_tx_pool_uninit(struct rte_eth_dev *dev); int hn_dev_link_update(struct rte_eth_dev *dev, int wait); int hn_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t nb_desc, unsigned int socket_id, -- 2.19.2