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 58FE2A00BE for ; Tue, 19 May 2020 15:09:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3C0AC1D6BC; Tue, 19 May 2020 15:09:28 +0200 (CEST) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id 0352F1D6BB for ; Tue, 19 May 2020 15:09:27 +0200 (CEST) Received: by mail-wm1-f65.google.com with SMTP id n5so3518185wmd.0 for ; Tue, 19 May 2020 06:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/hgDRbiKgiyamW/mTRD4xccAzswq7nPiNALZDFPUb+I=; b=nwkfjgVfunVXWumTOq8+Z8m7esaTOJ+6b7NWiCgQh2/AlB+NnHVMZvZkAhR7FheUea ZS0v2KxlOgjllq6Bal8K3tThDvgyuqJu3s7w83AZzJy0vb/8rINpcqCbhTHzD2AtsDNV mLnroXbz2Zm9sT6VVFblBMeN7IbFuDIclLLcWkMf4401jYAbHPLXJBQRz88C87U+jczt GirjkFBCVIdj3QRLx2q6QjsAsdTljS2MrHgk7rNFmZ6hvKr96N0N4e/Js07AlbKghAnK iTo9eVkZ2l7Tvf70NtR5kH36YOkMxlcxaY/tG/IqMp304Ha/IjACTX7jL9iEqhxvBb18 QCWg== 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=/hgDRbiKgiyamW/mTRD4xccAzswq7nPiNALZDFPUb+I=; b=PrfTvIn21aMhNJqfrM6ufa6L5AA2y2bYrjCvi8SJu0EfGeZSpEcDTACYXOaXZk3XQi kZpW/P6qovm7AePvN7MD1sK32N9i9pi2mAGQRWegK1tiyEJD+9wy77tMK6q17Y+phh93 ue4/yi2BfG43Hhrm1lvRs624Qtl/dLdWT+fBmrdqGRI4TfH5+J6QgjZTLtrnJc3Xk7dZ vBDODRSJX3liDrKVglTU2ZhafZMce9eNU6omB84Ur5vBkk0j33JSbimFBctcs3qkaQUd +gsHMShUcxH04EOowaKHfk0s8fVHWMU7pM/Jm1Avgniof3XswKpkCtg/dH2R9NF09g8D 6uFg== X-Gm-Message-State: AOAM532EoiZoTjKOhf5vCkD5hd0/K1LKXP2vndtiwiw1Hy9KKIeePdUP pJ7V6LRFTCh4EQbCvzT0LIwSHXxhqkYEQyRj X-Google-Smtp-Source: ABdhPJy5sPUzOyEKHPVUgytMEaLgSEyJd+BJY1SumIvYxXkezDrbm4mtB2cS3zoAWRLHSef9q2KDHw== X-Received: by 2002:a1c:29c4:: with SMTP id p187mr5414443wmp.73.1589893766689; Tue, 19 May 2020 06:09:26 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id q2sm20350087wrx.60.2020.05.19.06.09.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:09:26 -0700 (PDT) From: luca.boccassi@gmail.com To: Itsuro Oda Cc: Xiaolong Ye , dpdk stable Date: Tue, 19 May 2020 14:03:25 +0100 Message-Id: <20200519130549.112823-70-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/vhost: fix potential memory leak on close' has been queued to stable release 19.11.3 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 stable release 19.11.3 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/21/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. Thanks. Luca Boccassi --- >From 4f5f084c7fd99f2db1c8cb88c4e97f6bd248e107 Mon Sep 17 00:00:00 2001 From: Itsuro Oda Date: Thu, 5 Mar 2020 11:54:50 +0900 Subject: [PATCH] net/vhost: fix potential memory leak on close [ upstream commit 770fabcd36ec11d64544e86ed7d2dda9f5c64daf ] If a vhost device is closed before eth_dev_configure is done to the device, internal resources allocated to the device would not be freed. This patch fixes it. Fixes: 3d01b759d267 ("net/vhost: delay driver setup") Signed-off-by: Itsuro Oda Reviewed-by: Xiaolong Ye --- drivers/net/vhost/rte_eth_vhost.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index c5e3fa229a..85f91f0b9d 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -1066,16 +1066,14 @@ eth_dev_close(struct rte_eth_dev *dev) eth_dev_stop(dev); - rte_vhost_driver_unregister(internal->iface_name); - list = find_internal_resource(internal->iface_name); - if (!list) - return; - - pthread_mutex_lock(&internal_list_lock); - TAILQ_REMOVE(&internal_list, list, next); - pthread_mutex_unlock(&internal_list_lock); - rte_free(list); + if (list) { + rte_vhost_driver_unregister(internal->iface_name); + pthread_mutex_lock(&internal_list_lock); + TAILQ_REMOVE(&internal_list, list, next); + pthread_mutex_unlock(&internal_list_lock); + rte_free(list); + } if (dev->data->rx_queues) for (i = 0; i < dev->data->nb_rx_queues; i++) -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:47.332697142 +0100 +++ 0070-net-vhost-fix-potential-memory-leak-on-close.patch 2020-05-19 14:04:44.232648662 +0100 @@ -1,14 +1,15 @@ -From 770fabcd36ec11d64544e86ed7d2dda9f5c64daf Mon Sep 17 00:00:00 2001 +From 4f5f084c7fd99f2db1c8cb88c4e97f6bd248e107 Mon Sep 17 00:00:00 2001 From: Itsuro Oda Date: Thu, 5 Mar 2020 11:54:50 +0900 Subject: [PATCH] net/vhost: fix potential memory leak on close +[ upstream commit 770fabcd36ec11d64544e86ed7d2dda9f5c64daf ] + If a vhost device is closed before eth_dev_configure is done to the device, internal resources allocated to the device would not be freed. This patch fixes it. Fixes: 3d01b759d267 ("net/vhost: delay driver setup") -Cc: stable@dpdk.org Signed-off-by: Itsuro Oda Reviewed-by: Xiaolong Ye @@ -17,10 +18,10 @@ 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c -index f44e6bbebe..808e670f13 100644 +index c5e3fa229a..85f91f0b9d 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c -@@ -1069,16 +1069,14 @@ eth_dev_close(struct rte_eth_dev *dev) +@@ -1066,16 +1066,14 @@ eth_dev_close(struct rte_eth_dev *dev) eth_dev_stop(dev);