app/flow-perf: support flag action

Introduce flag action support to flow perf
application.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
This commit is contained in:
Wisam Jaddo 2020-08-30 11:15:36 +00:00 committed by Ferruh Yigit
parent ef9ae0cf57
commit d71bc9e99c
4 changed files with 28 additions and 0 deletions

View File

@ -428,6 +428,14 @@ add_set_ipv6_dscp(struct rte_flow_action *actions,
actions[actions_counter].conf = &set_dscp; actions[actions_counter].conf = &set_dscp;
} }
static void
add_flag(struct rte_flow_action *actions,
uint8_t actions_counter,
__rte_unused struct additional_para para)
{
actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_FLAG;
}
void void
fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions, fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions,
uint32_t counter, uint16_t next_table, uint16_t hairpinq) uint32_t counter, uint16_t next_table, uint16_t hairpinq)
@ -482,6 +490,12 @@ fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions,
.mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_SET_TAG), .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_SET_TAG),
.funct = add_set_tag, .funct = add_set_tag,
}, },
{
.mask = FLOW_ACTION_MASK(
RTE_FLOW_ACTION_TYPE_FLAG
),
.funct = add_flag,
},
{ {
.mask = FLOW_ACTION_MASK( .mask = FLOW_ACTION_MASK(
RTE_FLOW_ACTION_TYPE_SET_MAC_SRC RTE_FLOW_ACTION_TYPE_SET_MAC_SRC

View File

@ -170,6 +170,7 @@ usage(char *progname)
"ipv4 dscp value to be set is random each flow\n"); "ipv4 dscp value to be set is random each flow\n");
printf(" --set-ipv6-dscp: add set ipv6 dscp action to flow actions\n" printf(" --set-ipv6-dscp: add set ipv6 dscp action to flow actions\n"
"ipv6 dscp value to be set is random each flow\n"); "ipv6 dscp value to be set is random each flow\n");
printf(" --flag: add flag action to flow actions\n");
} }
static void static void
@ -465,6 +466,14 @@ args_parse(int argc, char **argv)
.map = &flow_actions[0], .map = &flow_actions[0],
.map_idx = &actions_idx .map_idx = &actions_idx
}, },
{
.str = "flag",
.mask = FLOW_ACTION_MASK(
RTE_FLOW_ACTION_TYPE_FLAG
),
.map = &flow_actions[0],
.map_idx = &actions_idx
},
}; };
static const struct option lgopts[] = { static const struct option lgopts[] = {
@ -522,6 +531,7 @@ args_parse(int argc, char **argv)
{ "dec-ttl", 0, 0, 0 }, { "dec-ttl", 0, 0, 0 },
{ "set-ipv4-dscp", 0, 0, 0 }, { "set-ipv4-dscp", 0, 0, 0 },
{ "set-ipv6-dscp", 0, 0, 0 }, { "set-ipv6-dscp", 0, 0, 0 },
{ "flag", 0, 0, 0 },
}; };
hairpin_queues_num = 0; hairpin_queues_num = 0;

View File

@ -63,6 +63,7 @@ New Features
moreover the app also now starts to support inner moreover the app also now starts to support inner
items matching as well. items matching as well.
* Added header modify actions. * Added header modify actions.
* Added flag action.
Removed Items Removed Items

View File

@ -303,3 +303,6 @@ Actions:
* ``--set-ipv6-dscp`` * ``--set-ipv6-dscp``
Add set IPv6 dscp action to all flows actions. Add set IPv6 dscp action to all flows actions.
The dscp value to be is random each flow. The dscp value to be is random each flow.
* ``--flag``
Add flag action to all flows actions.