Wisam Jaddo 9001a863f4 app/flow-perf: support user order
The old design was using the bit mask to identify
items, action and attributes.

So it was all based on the order of the code itself,
to place the order of the actions, items & attributes
inside the flows. Such design will lead into many failures
when some PMD support order different than other PMD,
in the end the rules will fail to create. Also sometimes
the user needs to have one action before other actions
and vice versa, so using new design of arrays that
take user order into consideration make more sense.

After this patch, we start supporting inner items
and more than one instance of same action.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2020-09-18 18:55:10 +02:00

38 lines
921 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2020 Mellanox Technologies, Ltd
*
* This file contains the items, actions and attributes
* definition. And the methods to prepare and fill items,
* actions and attributes to generate rte_flow rule.
*/
#ifndef FLOW_PERF_FLOW_GEN
#define FLOW_PERF_FLOW_GEN
#include <stdint.h>
#include <rte_flow.h>
#include "config.h"
/* Actions */
#define HAIRPIN_QUEUE_ACTION FLOW_ACTION_MASK(0)
#define HAIRPIN_RSS_ACTION FLOW_ACTION_MASK(1)
/* Attributes */
#define INGRESS FLOW_ATTR_MASK(0)
#define EGRESS FLOW_ATTR_MASK(1)
#define TRANSFER FLOW_ATTR_MASK(2)
struct rte_flow *
generate_flow(uint16_t port_id,
uint16_t group,
uint64_t *flow_attrs,
uint64_t *flow_items,
uint64_t *flow_actions,
uint16_t next_table,
uint32_t outer_ip_src,
uint16_t hairpinq,
struct rte_flow_error *error);
#endif /* FLOW_PERF_FLOW_GEN */