From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ABABDA04DD for ; Wed, 18 Nov 2020 17:37:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A057E4C90; Wed, 18 Nov 2020 17:37:08 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id 1A6804C90 for ; Wed, 18 Nov 2020 17:37:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605717425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6eihJSig6YgosKHUntwBg5TsdU4xM29iLGhHdzSaZgU=; b=KuyENl0FOd/8cGcFdB3UfwtUvZkODnvMr/K8yB173rCvjnnVD7eBnSyqihvJ9UxoI/TIn6 HMtG4NWFxu0bw8gV58bo+ceQDE6cIfTkbhYIsnn74SHlCrsS92chY/oBfE1fLv943ruQAB +mLHkHn6MO18gCuOPTYLgmGObdlZQZk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-377-IS8muXMeMAKzxg6b6_oN3w-1; Wed, 18 Nov 2020 11:37:01 -0500 X-MC-Unique: IS8muXMeMAKzxg6b6_oN3w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9EFE78B83F0; Wed, 18 Nov 2020 16:36:33 +0000 (UTC) Received: from rh.redhat.com (ovpn-113-249.ams2.redhat.com [10.36.113.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F2AC5C1DC; Wed, 18 Nov 2020 16:36:32 +0000 (UTC) From: Kevin Traynor To: Yunjian Wang Cc: Long Li , dpdk stable Date: Wed, 18 Nov 2020 16:34:55 +0000 Message-Id: <20201118163558.1101823-9-ktraynor@redhat.com> In-Reply-To: <20201118163558.1101823-1-ktraynor@redhat.com> References: <20201118163558.1101823-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-stable] patch 'net/netvsc: fix Tx queue leak in error path' has been queued to LTS release 18.11.11 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/3e74baf061d8f906e13295c0f7c11dc6133c3ef2 Thanks. Kevin. --- >From 3e74baf061d8f906e13295c0f7c11dc6133c3ef2 Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Wed, 7 Oct 2020 10:06:25 +0800 Subject: [PATCH] net/netvsc: fix Tx queue leak in error path [ upstream commit f3013acfc17b8920b97223421976f3b3bb32489a ] In hn_dev_tx_queue_setup() allocated memory for txq, we don't free it when error happens and it will lead to memory leak. We can check for tx_free_thresh at the beginning of the function to fix it, before calling txq = rte_zmalloc_socket(). Fixes: cc0251813277 ("net/netvsc: split send buffers from Tx descriptors") Signed-off-by: Yunjian Wang Acked-by: Long Li --- drivers/net/netvsc/hn_rxtx.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index a70bac53d3..63b0f83f3a 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -253,14 +253,4 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev, PMD_INIT_FUNC_TRACE(); - txq = rte_zmalloc_socket("HN_TXQ", sizeof(*txq), RTE_CACHE_LINE_SIZE, - socket_id); - if (!txq) - return -ENOMEM; - - txq->hv = hv; - txq->chan = hv->channels[queue_idx]; - txq->port_id = dev->data->port_id; - txq->queue_id = queue_idx; - tx_free_thresh = tx_conf->tx_free_thresh; if (tx_free_thresh == 0) @@ -277,4 +267,13 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev, } + txq = rte_zmalloc_socket("HN_TXQ", sizeof(*txq), RTE_CACHE_LINE_SIZE, + socket_id); + if (!txq) + return -ENOMEM; + + txq->hv = hv; + txq->chan = hv->channels[queue_idx]; + txq->port_id = dev->data->port_id; + txq->queue_id = queue_idx; txq->free_thresh = tx_free_thresh; -- 2.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-18 16:33:38.158466889 +0000 +++ 0009-net-netvsc-fix-Tx-queue-leak-in-error-path.patch 2020-11-18 16:33:37.907215048 +0000 @@ -1 +1 @@ -From f3013acfc17b8920b97223421976f3b3bb32489a Mon Sep 17 00:00:00 2001 +From 3e74baf061d8f906e13295c0f7c11dc6133c3ef2 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f3013acfc17b8920b97223421976f3b3bb32489a ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 65f1abae51..5d59db513c 100644 +index a70bac53d3..63b0f83f3a 100644