patch 'net/cpfl: fix parsing protocol ID mask field' has been queued to stable release 23.11.3
Xueming Li
xuemingl at nvidia.com
Mon Nov 11 07:27:42 CET 2024
Hi,
FYI, your patch has been queued to stable release 23.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 11/30/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=f2cb061aa1b15f690a56ead9334aab21480c7cf6
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From f2cb061aa1b15f690a56ead9334aab21480c7cf6 Mon Sep 17 00:00:00 2001
From: Praveen Shetty <praveen.shetty at intel.com>
Date: Fri, 23 Aug 2024 11:14:50 +0000
Subject: [PATCH] net/cpfl: fix parsing protocol ID mask field
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 8125fea74b860a71605dfe94dc03ef73c912813e ]
CPFL parser was incorrectly parsing the mask value of the next_proto_id
field from recipe.json file as a string instead of unsigned integer.
Fixes: 41f20298ee8c ("net/cpfl: parse flow offloading hint from JSON")
Signed-off-by: Praveen Shetty <praveen.shetty at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/net/cpfl/cpfl_flow_parser.c | 34 +++++++++++++++++++----------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/drivers/net/cpfl/cpfl_flow_parser.c b/drivers/net/cpfl/cpfl_flow_parser.c
index 303e979015..a67c773d18 100644
--- a/drivers/net/cpfl/cpfl_flow_parser.c
+++ b/drivers/net/cpfl/cpfl_flow_parser.c
@@ -198,6 +198,8 @@ cpfl_flow_js_pattern_key_proto_field(json_t *ob_fields,
for (i = 0; i < len; i++) {
json_t *object;
const char *name, *mask;
+ uint32_t mask_32b = 0;
+ int ret;
object = json_array_get(ob_fields, i);
name = cpfl_json_t_to_string(object, "name");
@@ -213,20 +215,28 @@ cpfl_flow_js_pattern_key_proto_field(json_t *ob_fields,
if (js_field->type == RTE_FLOW_ITEM_TYPE_ETH ||
js_field->type == RTE_FLOW_ITEM_TYPE_IPV4) {
- mask = cpfl_json_t_to_string(object, "mask");
- if (!mask) {
- PMD_DRV_LOG(ERR, "Can not parse string 'mask'.");
- goto err;
- }
- if (strlen(mask) > CPFL_JS_STR_SIZE - 1) {
- PMD_DRV_LOG(ERR, "The 'mask' is too long.");
- goto err;
+ /* Added a check for parsing mask value of the next_proto_id field. */
+ if (strcmp(name, "next_proto_id") == 0) {
+ ret = cpfl_json_t_to_uint32(object, "mask", &mask_32b);
+ if (ret < 0) {
+ PMD_DRV_LOG(ERR, "Cannot parse uint32 'mask'.");
+ goto err;
+ }
+ js_field->fields[i].mask_32b = mask_32b;
+ } else {
+ mask = cpfl_json_t_to_string(object, "mask");
+ if (!mask) {
+ PMD_DRV_LOG(ERR, "Can not parse string 'mask'.");
+ goto err;
+ }
+ if (rte_strscpy(js_field->fields[i].mask,
+ mask, CPFL_JS_STR_SIZE) < 0) {
+ PMD_DRV_LOG(ERR, "The 'mask' is too long.");
+ goto err;
+ }
}
- strncpy(js_field->fields[i].mask, mask, CPFL_JS_STR_SIZE - 1);
- } else {
- uint32_t mask_32b;
- int ret;
+ } else {
ret = cpfl_json_t_to_uint32(object, "mask", &mask_32b);
if (ret < 0) {
PMD_DRV_LOG(ERR, "Can not parse uint32 'mask'.");
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-11-11 14:23:07.841481184 +0800
+++ 0056-net-cpfl-fix-parsing-protocol-ID-mask-field.patch 2024-11-11 14:23:05.132192839 +0800
@@ -1 +1 @@
-From 8125fea74b860a71605dfe94dc03ef73c912813e Mon Sep 17 00:00:00 2001
+From f2cb061aa1b15f690a56ead9334aab21480c7cf6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 8125fea74b860a71605dfe94dc03ef73c912813e ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list