[dpdk-stable] patch 'app/testpmd: fix flow rule copy functions' has been queued to stable release 17.05.2

Yuanhan Liu yliu at fridaylinux.org
Mon Aug 21 11:30:52 CEST 2017


Hi,

FYI, your patch has been queued to stable release 17.05.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/24/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From f39999c13215f15a6de5156a8365b94e801ec71e Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan at mellanox.com>
Date: Mon, 24 Jul 2017 16:47:32 +0300
Subject: [PATCH] app/testpmd: fix flow rule copy functions

[ upstream commit 79bf388493b5c4be104c6c17fd98aa293dafa42d ]

The corrupted code checks only RAW flow item type special case for
returning its size but doesn't deal with any other flow item type
and returns 0 for all the others.

This bug leaves the flow descriptor empty for non RAW types.

The fix takes the correct size to any regular types from appropriate
array.

The same issue, with a similar fix, is in flow action size method which
deals only with RSS special type.

Fixes: 938a184a1870 ("app/testpmd: implement basic support for flow API")

Signed-off-by: Matan Azrad <matan at mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
---
 app/test-pmd/config.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 83a8f52..1c20661 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -979,8 +979,10 @@ static void
 flow_item_spec_size(const struct rte_flow_item *item,
 		    size_t *size, size_t *pad)
 {
-	if (!item->spec)
+	if (!item->spec) {
+		*size = 0;
 		goto empty;
+	}
 	switch (item->type) {
 		union {
 			const struct rte_flow_item_raw *raw;
@@ -992,10 +994,10 @@ flow_item_spec_size(const struct rte_flow_item *item,
 			spec.raw->length * sizeof(*spec.raw->pattern);
 		break;
 	default:
-empty:
-		*size = 0;
+		*size = flow_item[item->type].size;
 		break;
 	}
+empty:
 	*pad = RTE_ALIGN_CEIL(*size, sizeof(double)) - *size;
 }
 
@@ -1030,8 +1032,10 @@ static void
 flow_action_conf_size(const struct rte_flow_action *action,
 		      size_t *size, size_t *pad)
 {
-	if (!action->conf)
+	if (!action->conf) {
+		*size = 0;
 		goto empty;
+	}
 	switch (action->type) {
 		union {
 			const struct rte_flow_action_rss *rss;
@@ -1043,10 +1047,10 @@ flow_action_conf_size(const struct rte_flow_action *action,
 			conf.rss->num * sizeof(*conf.rss->queue);
 		break;
 	default:
-empty:
-		*size = 0;
+		*size = flow_action[action->type].size;
 		break;
 	}
+empty:
 	*pad = RTE_ALIGN_CEIL(*size, sizeof(double)) - *size;
 }
 
-- 
2.7.4



More information about the stable mailing list