git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ethdev: add IPv4/IPv6 ECN header rewrite action
[dpdk.git]
/
app
/
test-flow-perf
/
flow_gen.c
diff --git
a/app/test-flow-perf/flow_gen.c
b/app/test-flow-perf/flow_gen.c
index
e87276b
..
a0aedf0
100644
(file)
--- a/
app/test-flow-perf/flow_gen.c
+++ b/
app/test-flow-perf/flow_gen.c
@@
-18,26
+18,39
@@
static void
fill_attributes(struct rte_flow_attr *attr,
static void
fill_attributes(struct rte_flow_attr *attr,
- uint64_t
flow_attrs, uint16_t group
)
+ uint64_t
*flow_attrs, uint16_t group, uint8_t max_priority
)
{
{
- if (flow_attrs & INGRESS)
- attr->ingress = 1;
- if (flow_attrs & EGRESS)
- attr->egress = 1;
- if (flow_attrs & TRANSFER)
- attr->transfer = 1;
+ uint8_t i;
+ for (i = 0; i < MAX_ATTRS_NUM; i++) {
+ if (flow_attrs[i] == 0)
+ break;
+ if (flow_attrs[i] & INGRESS)
+ attr->ingress = 1;
+ else if (flow_attrs[i] & EGRESS)
+ attr->egress = 1;
+ else if (flow_attrs[i] & TRANSFER)
+ attr->transfer = 1;
+ }
attr->group = group;
attr->group = group;
+ attr->priority = rte_rand_max(max_priority);
}
struct rte_flow *
generate_flow(uint16_t port_id,
uint16_t group,
}
struct rte_flow *
generate_flow(uint16_t port_id,
uint16_t group,
- uint64_t flow_attrs,
- uint64_t flow_items,
- uint64_t flow_actions,
+ uint64_t
*
flow_attrs,
+ uint64_t
*
flow_items,
+ uint64_t
*
flow_actions,
uint16_t next_table,
uint32_t outer_ip_src,
uint16_t hairpinq,
uint16_t next_table,
uint32_t outer_ip_src,
uint16_t hairpinq,
+ uint64_t encap_data,
+ uint64_t decap_data,
+ uint16_t dst_port,
+ uint8_t core_idx,
+ uint8_t rx_queues_count,
+ bool unique_data,
+ uint8_t max_priority,
struct rte_flow_error *error)
{
struct rte_flow_attr attr;
struct rte_flow_error *error)
{
struct rte_flow_attr attr;
@@
-49,12
+62,14
@@
generate_flow(uint16_t port_id,
memset(actions, 0, sizeof(actions));
memset(&attr, 0, sizeof(struct rte_flow_attr));
memset(actions, 0, sizeof(actions));
memset(&attr, 0, sizeof(struct rte_flow_attr));
- fill_attributes(&attr, flow_attrs, group);
+ fill_attributes(&attr, flow_attrs, group
, max_priority
);
fill_actions(actions, flow_actions,
fill_actions(actions, flow_actions,
- outer_ip_src, next_table, hairpinq);
+ outer_ip_src, next_table, hairpinq,
+ encap_data, decap_data, core_idx,
+ unique_data, rx_queues_count, dst_port);
- fill_items(items, flow_items, outer_ip_src);
+ fill_items(items, flow_items, outer_ip_src
, core_idx
);
flow = rte_flow_create(port_id, &attr, items, actions, error);
return flow;
flow = rte_flow_create(port_id, &attr, items, actions, error);
return flow;