dpdk/0264-ethdev-fix-Rx-queue-telemetry-memory-leak-on-failure.patch
chenjiji09 b2f818b02e telemetry: support display as hexadecimal
Sync some patchs from upstreaming for telemetry and modifies
are as follow:
1. Support dispaly integer as hexadecimal.
2. Fix data truncation for some u64 accept as int.
3. Add JSON pretty print.

(cherry picked from commit 9e45664c52b35caa057da6a442599e03f4527817)
2023-04-27 11:52:07 +08:00

40 lines
1.2 KiB
Diff

From 8cd9ea525b1e9c2a966fdf3616d68c7037b3820a Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Sat, 8 Jan 2022 15:51:57 +0800
Subject: ethdev: fix Rx queue telemetry memory leak on failure
[ upstream commit 52b49ea06ffb2cfbef8fe9578149f1e2dba99e89 ]
In eth_dev_handle_port_info() allocated memory for rxq_state,
we should free it when error happens, otherwise it will lead
to memory leak.
Fixes: 58b43c1ddfd1 ("ethdev: add telemetry endpoint for device info")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/ethdev/rte_ethdev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index df5a627cbe..d466efffc7 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -6383,8 +6383,10 @@ eth_dev_handle_port_info(const char *cmd __rte_unused,
return -ENOMEM;
txq_state = rte_tel_data_alloc();
- if (!txq_state)
+ if (!txq_state) {
+ rte_tel_data_free(rxq_state);
return -ENOMEM;
+ }
rte_tel_data_start_dict(d);
rte_tel_data_add_dict_string(d, "name", eth_dev->data->name);
--
2.23.0