patch 'telemetry: fix autotest on Alpine' has been queued to stable release 22.11.3
Xueming Li
xuemingl at nvidia.com
Sun Jun 25 08:33:46 CEST 2023
Hi,
FYI, your patch has been queued to stable release 22.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=57dd0e53b1cba93311a851d7d9a07084998a16ab
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 57dd0e53b1cba93311a851d7d9a07084998a16ab Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Wed, 5 Apr 2023 17:03:22 +0100
Subject: [PATCH] telemetry: fix autotest on Alpine
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 6ffce64857216344f02ee88d92cb69ee241b3c7b ]
On Alpine linux, the telemetry_data_autotest was failing for the
test where we had dictionaries embedded in other dictionaries up
to three levels deep. Indications are that this issue is due to
excess data being stored on the stack, so replace stack-allocated
buffer data with dynamically allocated data in the case where we
are doing recursive processing of telemetry data structures into
json.
Bugzilla ID: 1177
Fixes: c933bb5177ca ("telemetry: support array values in data object")
Fixes: d2671e642a8e ("telemetry: support dict of dicts")
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
lib/telemetry/telemetry.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index 7b905355cd..9c3c346ff5 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -208,7 +208,11 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len)
break;
case RTE_TEL_CONTAINER:
{
- char temp[buf_len];
+ char *temp = malloc(buf_len);
+ if (temp == NULL)
+ break;
+ *temp = '\0'; /* ensure valid string */
+
const struct container *cont =
&v->value.container;
if (container_to_json(cont->data,
@@ -219,6 +223,7 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len)
v->name, temp);
if (!cont->keep)
rte_tel_data_free(cont->data);
+ free(temp);
break;
}
}
@@ -275,7 +280,11 @@ output_json(const char *cmd, const struct rte_tel_data *d, int s)
break;
case RTE_TEL_CONTAINER:
{
- char temp[buf_len];
+ char *temp = malloc(buf_len);
+ if (temp == NULL)
+ break;
+ *temp = '\0'; /* ensure valid string */
+
const struct container *cont =
&v->value.container;
if (container_to_json(cont->data,
@@ -286,6 +295,7 @@ output_json(const char *cmd, const struct rte_tel_data *d, int s)
v->name, temp);
if (!cont->keep)
rte_tel_data_free(cont->data);
+ free(temp);
}
}
}
@@ -311,7 +321,11 @@ output_json(const char *cmd, const struct rte_tel_data *d, int s)
buf_len, used,
d->data.array[i].u64val);
else if (d->type == RTE_TEL_ARRAY_CONTAINER) {
- char temp[buf_len];
+ char *temp = malloc(buf_len);
+ if (temp == NULL)
+ break;
+ *temp = '\0'; /* ensure valid string */
+
const struct container *rec_data =
&d->data.array[i].container;
if (container_to_json(rec_data->data,
@@ -321,6 +335,7 @@ output_json(const char *cmd, const struct rte_tel_data *d, int s)
buf_len, used, temp);
if (!rec_data->keep)
rte_tel_data_free(rec_data->data);
+ free(temp);
}
break;
}
--
2.25.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2023-06-25 14:31:58.806434800 +0800
+++ 0008-telemetry-fix-autotest-on-Alpine.patch 2023-06-25 14:31:58.285773900 +0800
@@ -1 +1 @@
-From 6ffce64857216344f02ee88d92cb69ee241b3c7b Mon Sep 17 00:00:00 2001
+From 57dd0e53b1cba93311a851d7d9a07084998a16ab Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 6ffce64857216344f02ee88d92cb69ee241b3c7b ]
@@ -17 +19,0 @@
-Cc: stable at dpdk.org
@@ -26 +28 @@
-index deba7f34a3..590720bfa6 100644
+index 7b905355cd..9c3c346ff5 100644
@@ -73,2 +75,2 @@
- d->data.array[i].uval);
- else if (d->type == TEL_ARRAY_CONTAINER) {
+ d->data.array[i].u64val);
+ else if (d->type == RTE_TEL_ARRAY_CONTAINER) {
More information about the stable
mailing list