[10/13] app/flow-perf: add random mark id values

Message ID 20200830111544.4190-11-wisamm@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series app/flow-perf: add support for new items/actions |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Wisam Jaddo Aug. 30, 2020, 11:15 a.m. UTC
  Instead of having single id value, use up to 256
values, thus we make sure that all flows will not
use same mark action.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
 app/test-flow-perf/actions_gen.c | 6 ++++--
 app/test-flow-perf/config.h      | 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)
  

Patch

diff --git a/app/test-flow-perf/actions_gen.c b/app/test-flow-perf/actions_gen.c
index 10ddef4deb..278c0a3004 100644
--- a/app/test-flow-perf/actions_gen.c
+++ b/app/test-flow-perf/actions_gen.c
@@ -54,12 +54,14 @@  struct action_rss_data {
 static void
 add_mark(struct rte_flow_action *actions,
 	uint8_t actions_counter,
-	__rte_unused struct additional_para para)
+	struct additional_para para)
 {
 	static struct rte_flow_action_mark mark_action;
+	uint32_t counter = para.counter;
 
 	do {
-		mark_action.id = MARK_ID;
+		/* Random values from 1 to 256 */
+		mark_action.id = (counter % 255) + 1;
 	} while (0);
 
 	actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_MARK;
diff --git a/app/test-flow-perf/config.h b/app/test-flow-perf/config.h
index 439f3264b4..ee1a4a3724 100644
--- a/app/test-flow-perf/config.h
+++ b/app/test-flow-perf/config.h
@@ -23,7 +23,6 @@ 
 #define META_DATA 1
 #define TAG_INDEX 0
 #define PORT_ID_DST 1
-#define MARK_ID 1
 #define TEID_VALUE 1
 
 /* Flow items/acctions max size */