From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4CF41A0540 for ; Wed, 6 Jul 2022 22:36:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4726A40DF7; Wed, 6 Jul 2022 22:36:35 +0200 (CEST) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mails.dpdk.org (Postfix) with ESMTP id 0C21940A7F for ; Wed, 6 Jul 2022 22:36:34 +0200 (CEST) Received: by mail-wr1-f51.google.com with SMTP id q9so23598712wrd.8 for ; Wed, 06 Jul 2022 13:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7lFKwvtBX+m8pJ1ulZTz0jyQhIfEmK7r5V44ylrFgXc=; b=beCIEmCubAkVKGesl2TX3r2SNSoXu4TSgWyxFsRBwnVbpuSa/B6jjBrGL5gI+khvto r0jdBBcSPQLCiVMD6zbrB05OwMd1Eh1cfumK5g6egYVOh25ghGW8lx6Mz5vSagtDxLwe i/oNChOGW5SwJYYd4+r3ipJMp6KljkvmVdALUZkZFzQRkEy5jF1pal7vVnWyDgqKB6TH dh6gF3wa5PwxzR3a/nEhpiVr7+Bek7in26xqxviX6EVnyUMnIMR31pucdjOtI0RTpCEM t2Dyvhx2WjB+QhfNV7xVS+Xfo6YfE1H2OlRKDn+v7d7fxKVjplyGhhp/ncUwd6tmIA85 TX4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7lFKwvtBX+m8pJ1ulZTz0jyQhIfEmK7r5V44ylrFgXc=; b=UfAU2SgAAbQ6Z7zasuMtQW68cXQ4uQMUjD/QWlwMIDnBoyQBKY71QYBWTJAUQT+XqD lFjg9iqM/96j/l/ieRD7R4u/kFLxRpH5o71L4bh51cNTVJHI5tN4LIAJenIBK1EhL8xO dFTGFAM/7oCLl9W8ZPF4/QVp4QO+/gHR6Ce9BQ8m/qehOlpykJpRGfP0QSENYoDjIh6g Eul/1JrR1dCRJ/UrAMiydNCbmS2kT/ExFw8nFa3Df03er3ummOD+fOh2oCJjCANeMd+d bIqBgkl1fNKRBHaL9gZxx57HXvzMTEALtpKE0B3da5lxHqP383jZXoKGEvT67rtugAmE kLzA== X-Gm-Message-State: AJIora8lOVOnMT0VHrSOxs0DwNfRdEQ+4/zQiblqwQF7zikR/cf3ptFY ZcVhaiGnxQ4KVpCp2qiIh+AdqOsChVfb6w== X-Google-Smtp-Source: AGRyM1tL5LSwrrTNT+5l15n5Pg91j7cvx5T7PP1XsIXdo+UFrRZRFvLoME9zfxg5lvATqiDBlfmNhg== X-Received: by 2002:a05:6000:a13:b0:21a:3d94:c7aa with SMTP id co19-20020a0560000a1300b0021a3d94c7aamr39675282wrb.12.1657139793754; Wed, 06 Jul 2022 13:36:33 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id d3-20020a05600c34c300b003a2c67aa6c0sm851493wmq.23.2022.07.06.13.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 13:36:33 -0700 (PDT) From: luca.boccassi@gmail.com To: Kevin Laatz Cc: Bruce Richardson , dpdk stable Subject: patch 'dma/idxd: fix partial freeing in PCI close' has been queued to stable release 21.11.2 Date: Wed, 6 Jul 2022 21:35:02 +0100 Message-Id: <20220706203506.3422496-27-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220706203506.3422496-1-luca.boccassi@gmail.com> References: <20220628151938.2278711-26-ktraynor@redhat.com> <20220706203506.3422496-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 21.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/08/22. 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 This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/5b7a2b5672104ae8d70e4dd403c48bfbba8dd703 Thanks. Luca Boccassi --- >From 5b7a2b5672104ae8d70e4dd403c48bfbba8dd703 Mon Sep 17 00:00:00 2001 From: Kevin Laatz Date: Mon, 4 Jul 2022 16:27:50 +0100 Subject: [PATCH] dma/idxd: fix partial freeing in PCI close [ upstream commit 1a57c8d553a022a282cc466712bf7f4ce6de20a4 ] During PCI device close, any allocated memory needs to be free'd. Currently, one of the free's is being called on an incorrect idxd_dmadev struct member, namely 'batch_idx_ring'. At device creation, memory is allocated for both 'batch_comp_ring' and 'batch_idx_ring' simultaneously. Calling free only on 'batch_idx_ring' meant the first half of this memory was not being free'd, leading to the memleak. This patch fixes this memleak by calling free on 'batch_comp_ring' which will free the memory for both rings. Fixes: 9449330a8458 ("dma/idxd: create dmadev instances on PCI probe") Signed-off-by: Kevin Laatz Acked-by: Bruce Richardson --- drivers/dma/idxd/idxd_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/idxd/idxd_pci.c b/drivers/dma/idxd/idxd_pci.c index fb618d34b6..2c3b01cd2b 100644 --- a/drivers/dma/idxd/idxd_pci.c +++ b/drivers/dma/idxd/idxd_pci.c @@ -130,7 +130,7 @@ idxd_pci_dev_close(struct rte_dma_dev *dev) /* free device memory */ IDXD_PMD_DEBUG("Freeing device driver memory"); - rte_free(idxd->batch_idx_ring); + rte_free(idxd->batch_comp_ring); rte_free(idxd->desc_ring); /* if this is the last WQ on the device, disable the device and free -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-06 21:07:54.494889492 +0100 +++ 0027-dma-idxd-fix-partial-freeing-in-PCI-close.patch 2022-07-06 21:07:53.579519398 +0100 @@ -1 +1 @@ -From 1a57c8d553a022a282cc466712bf7f4ce6de20a4 Mon Sep 17 00:00:00 2001 +From 5b7a2b5672104ae8d70e4dd403c48bfbba8dd703 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 1a57c8d553a022a282cc466712bf7f4ce6de20a4 ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org