common/mlx5: add flex parser DevX structures
The structures and other definitions will be used for the dynamic flex parser creation via Devx command interface. These structures will be used as some some intermediate variables and input parameters for the parser creation API. It is better to keep all members consistent with the PRM definition even though some of them will not be used. Signed-off-by: Bing Zhao <bingz@mellanox.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
This commit is contained in:
parent
daa38a8924
commit
711aedf187
@ -311,6 +311,50 @@ struct mlx5_devx_virtio_q_couners_attr {
|
|||||||
uint32_t invalid_buffer;
|
uint32_t invalid_buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* graph flow match sample attributes structure,
|
||||||
|
* used by flex parser operations.
|
||||||
|
*/
|
||||||
|
struct mlx5_devx_match_sample_attr {
|
||||||
|
uint32_t flow_match_sample_en:1;
|
||||||
|
uint32_t flow_match_sample_field_offset:16;
|
||||||
|
uint32_t flow_match_sample_offset_mode:4;
|
||||||
|
uint32_t flow_match_sample_field_offset_mask;
|
||||||
|
uint32_t flow_match_sample_field_offset_shift:4;
|
||||||
|
uint32_t flow_match_sample_field_base_offset:8;
|
||||||
|
uint32_t flow_match_sample_tunnel_mode:3;
|
||||||
|
uint32_t flow_match_sample_field_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* graph node arc attributes structure, used by flex parser operations. */
|
||||||
|
struct mlx5_devx_graph_arc_attr {
|
||||||
|
uint32_t compare_condition_value:16;
|
||||||
|
uint32_t start_inner_tunnel:1;
|
||||||
|
uint32_t arc_parse_graph_node:8;
|
||||||
|
uint32_t parse_graph_node_handle;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Maximal number of samples per graph node. */
|
||||||
|
#define MLX5_GRAPH_NODE_SAMPLE_NUM 8
|
||||||
|
|
||||||
|
/* Maximal number of input/output arcs per graph node. */
|
||||||
|
#define MLX5_GRAPH_NODE_ARC_NUM 8
|
||||||
|
|
||||||
|
/* parse graph node attributes structure, used by flex parser operations. */
|
||||||
|
struct mlx5_devx_graph_node_attr {
|
||||||
|
uint32_t modify_field_select;
|
||||||
|
uint32_t header_length_mode:4;
|
||||||
|
uint32_t header_length_base_value:16;
|
||||||
|
uint32_t header_length_field_shift:4;
|
||||||
|
uint32_t header_length_field_offset:16;
|
||||||
|
uint32_t header_length_field_mask;
|
||||||
|
struct mlx5_devx_match_sample_attr sample[MLX5_GRAPH_NODE_SAMPLE_NUM];
|
||||||
|
uint32_t next_header_field_offset:16;
|
||||||
|
uint32_t next_header_field_size:5;
|
||||||
|
struct mlx5_devx_graph_arc_attr in[MLX5_GRAPH_NODE_ARC_NUM];
|
||||||
|
struct mlx5_devx_graph_arc_attr out[MLX5_GRAPH_NODE_ARC_NUM];
|
||||||
|
};
|
||||||
|
|
||||||
/* mlx5_devx_cmds.c */
|
/* mlx5_devx_cmds.c */
|
||||||
|
|
||||||
__rte_internal
|
__rte_internal
|
||||||
|
@ -2793,6 +2793,36 @@ enum {
|
|||||||
/* The bits meter color use. */
|
/* The bits meter color use. */
|
||||||
#define MLX5_MTR_COLOR_BITS 8
|
#define MLX5_MTR_COLOR_BITS 8
|
||||||
|
|
||||||
|
/* Length mode of dynamic flex parser graph node. */
|
||||||
|
enum mlx5_parse_graph_node_len_mode {
|
||||||
|
MLX5_GRAPH_NODE_LEN_FIXED = 0x0,
|
||||||
|
MLX5_GRAPH_NODE_LEN_FIELD = 0x1,
|
||||||
|
MLX5_GRAPH_NODE_LEN_BITMASK = 0x2,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Offset mode of the samples of flex parser. */
|
||||||
|
enum mlx5_parse_graph_flow_match_sample_offset_mode {
|
||||||
|
MLX5_GRAPH_SAMPLE_OFFSET_FIXED = 0x0,
|
||||||
|
MLX5_GRAPH_SAMPLE_OFFSET_FIELD = 0x1,
|
||||||
|
MLX5_GRAPH_SAMPLE_OFFSET_BITMASK = 0x2,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Node index for an input / output arc of the flex parser graph. */
|
||||||
|
enum mlx5_parse_graph_arc_node_index {
|
||||||
|
MLX5_GRAPH_ARC_NODE_NULL = 0x0,
|
||||||
|
MLX5_GRAPH_ARC_NODE_HEAD = 0x1,
|
||||||
|
MLX5_GRAPH_ARC_NODE_MAC = 0x2,
|
||||||
|
MLX5_GRAPH_ARC_NODE_IP = 0x3,
|
||||||
|
MLX5_GRAPH_ARC_NODE_GRE = 0x4,
|
||||||
|
MLX5_GRAPH_ARC_NODE_UDP = 0x5,
|
||||||
|
MLX5_GRAPH_ARC_NODE_MPLS = 0x6,
|
||||||
|
MLX5_GRAPH_ARC_NODE_TCP = 0x7,
|
||||||
|
MLX5_GRAPH_ARC_NODE_VXLAN_GPE = 0x8,
|
||||||
|
MLX5_GRAPH_ARC_NODE_GENEVE = 0x9,
|
||||||
|
MLX5_GRAPH_ARC_NODE_IPSEC_ESP = 0xa,
|
||||||
|
MLX5_GRAPH_ARC_NODE_PROGRAMMABLE = 0x1f,
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a user mark to flow mark.
|
* Convert a user mark to flow mark.
|
||||||
*
|
*
|
||||||
|
@ -600,7 +600,7 @@ enum mlx5_flex_parser_profile_id {
|
|||||||
struct mlx5_flex_parser_profiles {
|
struct mlx5_flex_parser_profiles {
|
||||||
uint32_t num; /* Actual number of samples. */
|
uint32_t num; /* Actual number of samples. */
|
||||||
uint32_t ids[8]; /* Sample IDs for this profile. */
|
uint32_t ids[8]; /* Sample IDs for this profile. */
|
||||||
uint8_t offset[8]; /* Bytes offset of each parser. */
|
uint8_t offset[8]; /* Bytes offset of each parser. */
|
||||||
void *obj; /* Flex parser node object. */
|
void *obj; /* Flex parser node object. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user