Skip to content

Commit 2aadac7

Browse files
aleks-kozyrevferruhy
authored andcommitted
app/testpmd: add jump to table index action
Add a new command line options to create the RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX action from the testpmd command line. flow queue 0 create 0 template_table 0 pattern_template 0 actions_template 0 postpone no pattern eth / end actions jump_to_table_index table 0x166f9ce00 index 5 / end Signed-off-by: Alexander Kozyrev <[email protected]> Acked-by: Ori Kam <[email protected]>
1 parent fddb398 commit 2aadac7

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

app/test-pmd/cmdline_flow.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,9 @@ enum index {
785785
ACTION_IPV6_EXT_PUSH_INDEX_VALUE,
786786
ACTION_NAT64,
787787
ACTION_NAT64_MODE,
788+
ACTION_JUMP_TO_TABLE_INDEX,
789+
ACTION_JUMP_TO_TABLE_INDEX_TABLE,
790+
ACTION_JUMP_TO_TABLE_INDEX_INDEX,
788791
};
789792

790793
/** Maximum size for pattern in struct rte_flow_item_raw. */
@@ -2328,6 +2331,7 @@ static const enum index next_action[] = {
23282331
ACTION_IPV6_EXT_REMOVE,
23292332
ACTION_IPV6_EXT_PUSH,
23302333
ACTION_NAT64,
2334+
ACTION_JUMP_TO_TABLE_INDEX,
23312335
ZERO,
23322336
};
23332337

@@ -2688,6 +2692,13 @@ static const enum index next_hash_encap_dest_subcmd[] = {
26882692
ZERO,
26892693
};
26902694

2695+
static const enum index action_jump_to_table_index[] = {
2696+
ACTION_JUMP_TO_TABLE_INDEX_TABLE,
2697+
ACTION_JUMP_TO_TABLE_INDEX_INDEX,
2698+
ACTION_NEXT,
2699+
ZERO,
2700+
};
2701+
26912702
static int parse_set_raw_encap_decap(struct context *, const struct token *,
26922703
const char *, unsigned int,
26932704
void *, unsigned int);
@@ -7608,6 +7619,29 @@ static const struct token token_list[] = {
76087619
.args = ARGS(ARGS_ENTRY(struct rte_flow_action_nat64, type)),
76097620
.call = parse_vc_conf,
76107621
},
7622+
[ACTION_JUMP_TO_TABLE_INDEX] = {
7623+
.name = "jump_to_table_index",
7624+
.help = "Jump to table index",
7625+
.priv = PRIV_ACTION(JUMP_TO_TABLE_INDEX,
7626+
sizeof(struct rte_flow_action_jump_to_table_index)),
7627+
.next = NEXT(action_jump_to_table_index),
7628+
.call = parse_vc,
7629+
},
7630+
[ACTION_JUMP_TO_TABLE_INDEX_TABLE] = {
7631+
.name = "table",
7632+
.help = "table to redirect traffic to",
7633+
.next = NEXT(action_jump_to_table_index, NEXT_ENTRY(COMMON_UNSIGNED)),
7634+
.args = ARGS(ARGS_ENTRY(struct rte_flow_action_jump_to_table_index, table)),
7635+
.call = parse_vc_conf,
7636+
},
7637+
[ACTION_JUMP_TO_TABLE_INDEX_INDEX] = {
7638+
.name = "index",
7639+
.help = "rule index to redirect traffic to",
7640+
.next = NEXT(action_jump_to_table_index, NEXT_ENTRY(COMMON_UNSIGNED)),
7641+
.args = ARGS(ARGS_ENTRY(struct rte_flow_action_jump_to_table_index, index)),
7642+
.call = parse_vc_conf,
7643+
},
7644+
76117645
/* Top level command. */
76127646
[SET] = {
76137647
.name = "set",

0 commit comments

Comments
 (0)