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 2F2D843C60 for ; Thu, 7 Mar 2024 02:33:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A68342DD7; Thu, 7 Mar 2024 02:33:04 +0100 (CET) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mails.dpdk.org (Postfix) with ESMTP id E20A240E5A for ; Thu, 7 Mar 2024 02:33:02 +0100 (CET) Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-33e1207bba1so190013f8f.1 for ; Wed, 06 Mar 2024 17:33:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709775182; x=1710379982; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eCZoGXTEFY6nFNrlkVGX1pKAl/i1a8zJUiQDtxapXKU=; b=ia8kyYKUslbtj6PPYGZX8UGG9V5TrOTYoNwsIvy4SdlQBwsgvfwdbU60PrGR4vWP15 ZPEqVC8fiWgP2td4B4ZmVcbPBxOK57Q4gycKjB0sC8a7ahR69rnPkN8t4lzWiCYoooaS xalj68h7hN586jKVyNiBh7m/OP8Jqvzvpki+qUlGhEaimLM0k+NKng+GcbWQUo4akGKg I9nbXB8UcGYrpcnskjwZ7Pcs874wwGZmojz2U9ifaZ3luPzikMa4MiODlZvjHnf8J/Fc 4u8lhtdQa8iY6YC20kArV/c09n+VNS9PtQPawbuwWAzKLtCWqZIOn+uSJ2cU4zZBqJKL YTdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709775182; x=1710379982; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eCZoGXTEFY6nFNrlkVGX1pKAl/i1a8zJUiQDtxapXKU=; b=mDNMVilaQvnzZ3iWExbY0/j0ti2R76qCM5b8+BkpnBeaxAticNUr4a1Uyeg6y4OikM mu3WoFZVTTniNm3lr0dJ+ZS6hSrBgjZIOAmyqvUHnFs2MkWmrWnd1q/pcTIwveRUfcUC Mynshoj1NwCHgnI7XqtH0T8AhzrSQ9m0YrTmKnhxCOsU0DhHg3dzPRl8OJ/+npS14Z2O y9xFpixENd80lK4ILWH7v8f+bslo2X/ZTb2Z3ICwGwdSeF9AH10KPDDr7betDVXzTVmQ SpDTpm9RV95q1uSTltdJgxd1FBnZhGgPbBOvNwmPz0vrc8fNbA0oFrWngBRUDs6MuqgI xxHA== X-Forwarded-Encrypted: i=1; AJvYcCUhOMSXld4j3PuU6Ka2ZjixyF7s7TN8qXGzDCX50tGaC8ADQx1hT/SqwptoiVSQMYLOkIXJTng2YIGlSJMiLJk= X-Gm-Message-State: AOJu0YxaEUycl3usENTmPp46/MjLXWX5jrUeKP843Mg2LRNJZnD0o4o8 Apo6zkTVgXqFJWMAx0YPJF3Z7A4z6mho/Tv58QGIguJXfwzDM9MlMy+wE+a9 X-Google-Smtp-Source: AGHT+IFtSm6TclV+NB48h+y+zrZaPIIA+ry3+GTsZyY5ERbBN0DCZXhjS6HilqrQyiriyLGjaxHQHw== X-Received: by 2002:a05:6000:124f:b0:33b:5725:e516 with SMTP id j15-20020a056000124f00b0033b5725e516mr10455414wrx.51.1709775182548; Wed, 06 Mar 2024 17:33:02 -0800 (PST) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id b11-20020a5d634b000000b0033d6fe3f6absm18651511wrw.62.2024.03.06.17.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 17:33:02 -0800 (PST) From: luca.boccassi@gmail.com To: Qi Zhang Cc: Wenjun Wu , dpdk stable Subject: patch 'net/ice: fix memory leaks' has been queued to stable release 22.11.5 Date: Thu, 7 Mar 2024 01:30:30 +0000 Message-Id: <20240307013159.1735343-13-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307013159.1735343-1-luca.boccassi@gmail.com> References: <20240307013159.1735343-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 22.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/09/24. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/65973f73eec77e58a1acb055d8dc8edf192f7926 Thanks. Luca Boccassi --- >From 65973f73eec77e58a1acb055d8dc8edf192f7926 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Sun, 7 Jan 2024 06:50:53 -0500 Subject: [PATCH] net/ice: fix memory leaks [ upstream commit 546ee62dd441730daae181e336f30b315c5fb16f ] Free memory for AQ buffer at icd_move_recfg_lan_txq Free memory for profile list at ice_tm_conf_uninit Fixes: 8c481c3bb65b ("net/ice: support queue and queue group bandwidth limit") Signed-off-by: Qi Zhang Acked-by: Wenjun Wu --- drivers/net/ice/ice_tm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c index 34a0bfcff8..c24642c867 100644 --- a/drivers/net/ice/ice_tm.c +++ b/drivers/net/ice/ice_tm.c @@ -58,8 +58,15 @@ void ice_tm_conf_uninit(struct rte_eth_dev *dev) { struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); + struct ice_tm_shaper_profile *shaper_profile; struct ice_tm_node *tm_node; + /* clear profile */ + while ((shaper_profile = TAILQ_FIRST(&pf->tm_conf.shaper_profile_list))) { + TAILQ_REMOVE(&pf->tm_conf.shaper_profile_list, shaper_profile, node); + rte_free(shaper_profile); + } + /* clear node configuration */ while ((tm_node = TAILQ_FIRST(&pf->tm_conf.queue_list))) { TAILQ_REMOVE(&pf->tm_conf.queue_list, tm_node, node); @@ -648,6 +655,8 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, uint16_t buf_size = ice_struct_size(buf, txqs, 1); buf = (struct ice_aqc_move_txqs_data *)ice_malloc(hw, sizeof(*buf)); + if (buf == NULL) + return -ENOMEM; queue_parent_node = queue_sched_node->parent; buf->src_teid = queue_parent_node->info.node_teid; @@ -659,6 +668,7 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, NULL, buf, buf_size, &txqs_moved, NULL); if (ret || txqs_moved == 0) { PMD_DRV_LOG(ERR, "move lan queue %u failed", queue_id); + rte_free(buf); return ICE_ERR_PARAM; } @@ -668,12 +678,14 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, } else { PMD_DRV_LOG(ERR, "invalid children number %d for queue %u", queue_parent_node->num_children, queue_id); + rte_free(buf); return ICE_ERR_PARAM; } dst_node->children[dst_node->num_children++] = queue_sched_node; queue_sched_node->parent = dst_node; ice_sched_query_elem(hw, queue_sched_node->info.node_teid, &queue_sched_node->info); + rte_free(buf); return ret; } -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-07 01:05:36.213235791 +0000 +++ 0013-net-ice-fix-memory-leaks.patch 2024-03-07 01:05:34.678937470 +0000 @@ -1 +1 @@ -From 546ee62dd441730daae181e336f30b315c5fb16f Mon Sep 17 00:00:00 2001 +From 65973f73eec77e58a1acb055d8dc8edf192f7926 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 546ee62dd441730daae181e336f30b315c5fb16f ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index b570798f07..c00ecb6a97 100644 +index 34a0bfcff8..c24642c867 100644 @@ -22 +23 @@ -@@ -59,8 +59,15 @@ void +@@ -58,8 +58,15 @@ void @@ -38 +39 @@ -@@ -636,6 +643,8 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, +@@ -648,6 +655,8 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, @@ -47 +48 @@ -@@ -647,6 +656,7 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, +@@ -659,6 +668,7 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, @@ -55 +56 @@ -@@ -656,12 +666,14 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev, +@@ -668,12 +678,14 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev,