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 77F4645AA7; Fri, 4 Oct 2024 04:49:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00FCB4067C; Fri, 4 Oct 2024 04:49:16 +0200 (CEST) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id 8DED4402DD for ; Fri, 4 Oct 2024 04:49:14 +0200 (CEST) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-20b58f2e1f4so11038585ad.2 for ; Thu, 03 Oct 2024 19:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728010153; x=1728614953; 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=btoRr4PxX0eMip2roJyEacxg6wngukpCRMtO82oaDyI=; b=VdyFEkWQqsLa5GoYyFG+BTEMgxKlTFiRy33In0wnbw0ww3GKF9aiDNsd2b9XMD8Wje T/wQcGQIM7gZvUmqymIpXAzKXULWwytc0cdAVw5RCW4nUY+SFkDAcosSNhE9gkG6IuIP 1eu7TDnZXiFH84e6pv6ZKyBJCUTpOWVaKE8UYVR2ryyRijvrlLEKQmEYYod3Q72cuYep la6QDQCYwJZKIxNn+0Q1QKGbru3gxQOiO0nPXHDatUv2ASzwlyBMo8/EqgDtazATt5aX bz3PLh5ULCWciNZOdy1rzDyFB/C7J7zDSnDxrA/gvXf9uPA2A+kTZJ2biLwAsEftGUx3 TDTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728010153; x=1728614953; 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=btoRr4PxX0eMip2roJyEacxg6wngukpCRMtO82oaDyI=; b=muklAoK/Xt5fFnM8b3qJ3yEBEjBLityUYzB34/6zzN7hM6DmfyNa5vwudkVbYw436h cRczjjt3fVIHMsJWUJjnI9B/0oA4wEbGsMM6Iu/+mWuwHagoT/DrXaiHkSRvE0iIxAj6 1pagPElXRw40m89QB8p5+GbGuqLse5GOJQFoJiriFNdDM6kSPNBnYAmWg9fpOKlmUr4k 3bY+zu9ndya02ZksN5GwmnUqtuPSa9CCqXTyIHYvl+31SE2Q69dotPl4FlNDXLZy7Ou4 knfeiDf61xpbLYevIyhDpD8ZpiLeJSNTeXdqENHqpOMxgWyilgWVR2ag71tBLpg6kl27 7S7g== X-Gm-Message-State: AOJu0YypMvFkDoSEIRMpjZXqYQUYsv7VHmmmlG7df+FqJ7M9MS9HsdC0 nm91Z9TAiLdtGasue+2h9YeWAcynqi4RstQzJEC0veZDgfapxZeTYHO1AwSeuImw2tZWfEHwvnB d9sE= X-Google-Smtp-Source: AGHT+IEcyeUyoi4n6BLhJ2vc9vHwZ6/yYhxzwlBPNRhqLahp6fVDNpa0SCOlo7r5hPAI9VYy6ksyQQ== X-Received: by 2002:a17:902:da8b:b0:208:d856:dbb7 with SMTP id d9443c01a7336-20bff194df7mr16170555ad.39.1728010153445; Thu, 03 Oct 2024 19:49:13 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20bef706defsm15488565ad.255.2024.10.03.19.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 19:49:13 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Fidaullah Noonari , Stephen Hemminger Subject: [PATCH v3] app/proc-info: add rte_eal_cleanup() to avoid memory leak Date: Thu, 3 Oct 2024 19:48:29 -0700 Message-ID: <20241004024903.209976-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20220904122845.141893-1-fidaullah.noonari@emumba.com> References: <20220904122845.141893-1-fidaullah.noonari@emumba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Fidaullah Noonari when app is launched with -m proc-info exit without rte_eal_cleanup() causing memory leakage. This commit resolves the memory leakage issue and closes app properly. Bugzilla id: 898 Signed-off-by: Fidaullah Noonari Acked-by: Stephen Hemminger --- v3 - handle eventdev_xstats as well rebase to 24.11 app/proc-info/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index b672aaefbe..4a558705cc 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -2166,11 +2166,11 @@ main(int argc, char **argv) if (mem_info) { meminfo_display(); - return 0; + goto cleanup; } if (eventdev_xstats() > 0) - return 0; + goto cleanup; nb_ports = rte_eth_dev_count_avail(); if (nb_ports == 0) @@ -2251,6 +2251,7 @@ main(int argc, char **argv) RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); +cleanup: ret = rte_eal_cleanup(); if (ret) printf("Error from rte_eal_cleanup(), %d\n", ret); -- 2.45.2