net/mlx5: fix flow create failure with GENEVE options match
PATCH v2 1/1 net/mlx5: fix flow create failure with GENEVE options match
For non template API on top of HWS,
geneve options were missing a parser and therefore it failed. In template API it geneve options is configured by the user using mlx5 set/apply tlv_options commands.
To support hybrid mode, if no parser exists,
added inner configuration of geneve parser, else,
in debug mode, check if the geneve option needed exist in current parser configured.
In release mode, assume the option exist in current configured parser.
Updated needed configuration for geneve options in doc.
Fixes e38776c36c8a ("net/mlx5: introduce HWS for non-template flow API")
Signed-off-by Maayan Kashani <[email protected]>
Acked-by Bing Zhao <[email protected]>
--- doc/guides/nics/mlx5.rst | 5 +++ drivers/net/mlx5/mlx5_flow.h | 17 +++++++ drivers/net/mlx5/mlx5_flow_dv.c | 69 ++++++++++++++++++++++++++++- drivers/net/mlx5/mlx5_flow_geneve.c | 2 +- drivers/net/mlx5/mlx5_flow_hw.c | 6 +-- 5 files changed, 93 insertions(+), 6 deletions(-)
doc/guides/nics/mlx5.rst +5 -0
@@ -288,6 +288,11 @@ Limitations - RTE_FLOW_ITEM_TYPE_MPLS matching is not supported on group 0. - mpls_encap and mpls_decap actions support only one level of MPLS. + - When using synchrounous rte_flow APIs, + the following limitations and considerations apply: + + - Geneve options is supported when ``FLEX_PARSER_PROFILE_ENABLE`` = 0(default). + - When using Verbs flow engine (``dv_flow_en`` = 0), flow pattern without any specific VLAN will match for VLAN packets as well:
drivers/net/mlx5/mlx5_flow.h +17 -0
@@ -2158,6 +2158,23 @@ flow_hw_get_port_id_from_ctx(void *dr_ctx, uint32_t *port_val)return -EINVAL ; } +/** +* Get GENEVE TLV option matching to given type and class. +* +* @param priv +* Pointer to port's private data. +* @param type +* GENEVE option type. +* @param class +* GENEVE option class. +* +* @return +* Pointer to option structure if exist, NULL otherwise and rte_errno is set. +*/ +struct mlx5_geneve_tlv_option * +mlx5_geneve_tlv_option_get (const struct mlx5_priv *priv,uint8_t type, +uint16_t class); +/** * Get GENEVE TLV option FW information according type and class. *
drivers/net/mlx5/mlx5_flow_dv.c +67 -2
97 lines not on this page · raw message
drivers/net/mlx5/mlx5_flow_geneve.c +1 -1
@@ -97,7 +97,7 @@ option_match_type_and_class(uint8_t type, uint16_t class,* @return * Pointer to option structure if exist, NULL otherwise and rte_errno is set. */ -static struct mlx5_geneve_tlv_option * +struct mlx5_geneve_tlv_option *mlx5_geneve_tlv_option_get (const struct mlx5_priv *priv,uint8_t type,uint16_t class) {
drivers/net/mlx5/mlx5_flow_hw.c +3 -3
@@ -14096,9 +14096,9 @@ flow_hw_create_flow(struct rte_eth_dev *dev, enum mlx5_flow_type type,/* TODO TBD flow_hw_handle_tunnel_offload(). */ (*flow)->nt_rule = true; (*flow)->nt2hws->matcher = &matcher; - ret =flow_dv_translate_items_hws (items, &flow_attr, &matcher.mask.buf, -MLX5_SET_MATCHER_HS_M ,NULL , -NULL , error); + ret =__flow_dv_translate_items_hws (items, &flow_attr, &matcher.mask.buf, +MLX5_SET_MATCHER_HS_M ,NULL , +NULL , true, error);if (ret) goto error;
Signature · 1 line
2.21.0