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 E6760431A0 for ; Thu, 19 Oct 2023 02:01:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF97440A7A; Thu, 19 Oct 2023 02:01:44 +0200 (CEST) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by mails.dpdk.org (Postfix) with ESMTP id DE2D64029E for ; Thu, 19 Oct 2023 02:01:43 +0200 (CEST) Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-507cee17b00so490460e87.2 for ; Wed, 18 Oct 2023 17:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697673703; x=1698278503; 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=sZsO4L3p3uO1COcthPUP8v0MM5DJGnnI2/ThTEam7zA=; b=Fuud7q0+ika/k/S6OPn0xLM/X7GzGycoRxjNAbPe2RmPzZU1MfaVxdolgjk3LGQpUj Kt1wfG84439X7/uiqiLUVKS3QIh2FGwx2sMW6UWE3aV92r8O6frtYP8V26AQ1aABTF6R 3EIA8Lw9QGW41PpGfDDOLQRZ7EesyahISSJ3qbP2MlC1+wcflZisRy6q0q5wgkqdLmDb Zz62bkqH7YpSxt22ePntOWyWPRcnrKOu3gK6bhc25hfEgS7bVAAi1zBgipQca51ZF6l4 RsJrE6yrhl3XXitrkG8MqwXUAxwCz+ZqF3zZAqn1gpaxwmtVxMqgEAbDigOpCS8FQ7gr B0xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697673703; x=1698278503; 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=sZsO4L3p3uO1COcthPUP8v0MM5DJGnnI2/ThTEam7zA=; b=lCY/hcQJyJzgQR+PMxMVFB4nPEyexsgsDX0kDs8VJLf5QVRW9hW7nbPc76fNEMILY/ aI4kFi6TP1Dm//4ndWEWo0sHeHxoj0Qef8bcUz0YXa9xRFDH5SGVa1NRePxxGuqRd6jF U4NO/J78CR0831PjNPCj2dtod120SGI9IfuTWQS0x9TwzbWLmvYXgyqcJQh48a7NluRG 15lhN3NK25uo7USGOyzD3bAEEffHoPQn0pCcncOiA+LCe4A9hWP0wcmpiAnEhMHqH8/B 3HvQmIKiRMggUh22mAQ+Rv7YdHNM4XCVwL1ZFZV45QYPwQqJmGDvAhCmaMNvVWjov63M sh/w== X-Gm-Message-State: AOJu0Yz34RuX/rPTnWTPfX+Or8jCJtTiFCa6MpBDcnkUJAkCBWeUXInD 1JYDMOtVHacZV6bj9upT7pRCIArryFZninf/ X-Google-Smtp-Source: AGHT+IEcx1LanA11QJNvjD2owBd7G8MICWAoZcv5zGjkr9RC/J3m68MK0kiNz1cEq+T0gwXAZDXPNQ== X-Received: by 2002:ac2:4244:0:b0:507:ce2f:8ef9 with SMTP id m4-20020ac24244000000b00507ce2f8ef9mr281806lfl.3.1697673703236; Wed, 18 Oct 2023 17:01:43 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id g15-20020adfe40f000000b0032d88e370basm3182207wrm.34.2023.10.18.17.01.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 17:01:42 -0700 (PDT) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: Chengwen Feng , dpdk stable Subject: patch 'app/procinfo: remove unnecessary rte_malloc' has been queued to stable release 20.11.10 Date: Thu, 19 Oct 2023 00:59:30 +0100 Message-Id: <20231018235930.3144-41-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231018235930.3144-1-luca.boccassi@gmail.com> References: <20231018235930.3144-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 20.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/21/23. 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/8488f58ebf4803eb153156c1100f86d9444a3825 Thanks. Luca Boccassi --- >From 8488f58ebf4803eb153156c1100f86d9444a3825 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 7 Aug 2023 13:43:10 -0700 Subject: [PATCH] app/procinfo: remove unnecessary rte_malloc [ upstream commit cfe29906c69bedb5f87dadcc02703ce46e80f37e ] Better to use malloc() which is faster than rte_malloc() and has more error checking, as is done already for statistics. Fixes: 077c546704da ("app/proc_info: add metrics displaying") Signed-off-by: Stephen Hemminger Acked-by: Chengwen Feng --- app/proc-info/main.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 40bfbefad8..befb90a2be 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -602,24 +601,23 @@ metrics_display(int port_id) return; } - metrics = rte_malloc("proc_info_metrics", - sizeof(struct rte_metric_value) * len, 0); + metrics = malloc(sizeof(struct rte_metric_value) * len); if (metrics == NULL) { printf("Cannot allocate memory for metrics\n"); return; } - names = rte_malloc(NULL, sizeof(struct rte_metric_name) * len, 0); + names = malloc(sizeof(struct rte_metric_name) * len); if (names == NULL) { printf("Cannot allocate memory for metrics names\n"); - rte_free(metrics); + free(metrics); return; } if (len != rte_metrics_get_names(names, len)) { printf("Cannot get metrics names\n"); - rte_free(metrics); - rte_free(names); + free(metrics); + free(names); return; } @@ -631,8 +629,8 @@ metrics_display(int port_id) ret = rte_metrics_get_values(port_id, metrics, len); if (ret < 0 || ret > len) { printf("Cannot get metrics values\n"); - rte_free(metrics); - rte_free(names); + free(metrics); + free(names); return; } @@ -641,8 +639,8 @@ metrics_display(int port_id) printf("%s: %"PRIu64"\n", names[i].name, metrics[i].value); printf("%s############################\n", nic_stats_border); - rte_free(metrics); - rte_free(names); + free(metrics); + free(names); } static void -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-10-19 00:28:58.297301521 +0100 +++ 0041-app-procinfo-remove-unnecessary-rte_malloc.patch 2023-10-19 00:28:56.313807058 +0100 @@ -1 +1 @@ -From cfe29906c69bedb5f87dadcc02703ce46e80f37e Mon Sep 17 00:00:00 2001 +From 8488f58ebf4803eb153156c1100f86d9444a3825 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit cfe29906c69bedb5f87dadcc02703ce46e80f37e ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index af4c1d8bcb..ce53bc30df 100644 +index 40bfbefad8..befb90a2be 100644 @@ -30 +31 @@ -@@ -909,24 +908,23 @@ metrics_display(int port_id) +@@ -602,24 +601,23 @@ metrics_display(int port_id) @@ -60 +61 @@ -@@ -938,8 +936,8 @@ metrics_display(int port_id) +@@ -631,8 +629,8 @@ metrics_display(int port_id) @@ -71 +72 @@ -@@ -948,8 +946,8 @@ metrics_display(int port_id) +@@ -641,8 +639,8 @@ metrics_display(int port_id) @@ -80 +80,0 @@ - #endif @@ -81,0 +82 @@ + static void