By design, in a GROUP flow, outer match criteria go to "ENC" fields
of the action rule match specification. The current HW/FW hasn't
got support for these fields (except the VXLAN VNI) yet.
As a workaround, start parsing the pattern from the tunnel item.
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
const uint8_t *mask = NULL;
int rc;
const uint8_t *mask = NULL;
int rc;
- /*
- * We're about to start processing inner frame items.
- * Process pattern data that has been deferred so far
- * and reset pattern data storage.
- */
- rc = sfc_mae_rule_process_pattern_data(ctx_mae, error);
- if (rc != 0)
- return rc;
+ if (ctx_mae->ft_rule_type == SFC_FT_RULE_GROUP) {
+ /*
+ * As a workaround, pattern processing has started from
+ * this (tunnel) item. No pattern data to process yet.
+ */
+ } else {
+ /*
+ * We're about to start processing inner frame items.
+ * Process pattern data that has been deferred so far
+ * and reset pattern data storage.
+ */
+ rc = sfc_mae_rule_process_pattern_data(ctx_mae, error);
+ if (rc != 0)
+ return rc;
+ }
memset(&ctx_mae->pattern_data, 0, sizeof(ctx_mae->pattern_data));
memset(&ctx_mae->pattern_data, 0, sizeof(ctx_mae->pattern_data));
static int
sfc_mae_rule_encap_parse_init(struct sfc_adapter *sa,
static int
sfc_mae_rule_encap_parse_init(struct sfc_adapter *sa,
- const struct rte_flow_item pattern[],
struct sfc_mae_parse_ctx *ctx,
struct rte_flow_error *error)
{
struct sfc_mae_parse_ctx *ctx,
struct rte_flow_error *error)
{
+ const struct rte_flow_item *pattern = ctx->pattern;
struct sfc_mae *mae = &sa->mae;
uint8_t recirc_id = 0;
int rc;
struct sfc_mae *mae = &sa->mae;
uint8_t recirc_id = 0;
int rc;
RTE_FLOW_ERROR_TYPE_ITEM,
pattern, "tunnel offload: GROUP: tunnel type mismatch");
}
RTE_FLOW_ERROR_TYPE_ITEM,
pattern, "tunnel offload: GROUP: tunnel type mismatch");
}
+
+ /*
+ * The HW/FW hasn't got support for the use of "ENC" fields in
+ * action rules (except the VNET_ID one) yet. As a workaround,
+ * start parsing the pattern from the tunnel item.
+ */
+ ctx->pattern = pattern;
break;
default:
SFC_ASSERT(B_FALSE);
break;
default:
SFC_ASSERT(B_FALSE);
ctx_mae.encap_type = EFX_TUNNEL_PROTOCOL_NONE;
ctx_mae.match_spec = ctx_mae.match_spec_action;
ctx_mae.field_ids_remap = field_ids_no_remap;
ctx_mae.encap_type = EFX_TUNNEL_PROTOCOL_NONE;
ctx_mae.match_spec = ctx_mae.match_spec_action;
ctx_mae.field_ids_remap = field_ids_no_remap;
+ ctx_mae.pattern = pattern;
ctx.type = SFC_FLOW_PARSE_CTX_MAE;
ctx.mae = &ctx_mae;
ctx.type = SFC_FLOW_PARSE_CTX_MAE;
ctx.mae = &ctx_mae;
- rc = sfc_mae_rule_encap_parse_init(sa, pattern, &ctx_mae, error);
+ rc = sfc_mae_rule_encap_parse_init(sa, &ctx_mae, error);
if (rc != 0)
goto fail_encap_parse_init;
if (rc != 0)
goto fail_encap_parse_init;
spec->ft = ctx_mae.ft;
rc = sfc_flow_parse_pattern(sa, sfc_flow_items, RTE_DIM(sfc_flow_items),
spec->ft = ctx_mae.ft;
rc = sfc_flow_parse_pattern(sa, sfc_flow_items, RTE_DIM(sfc_flow_items),
+ ctx_mae.pattern, &ctx, error);
if (rc != 0)
goto fail_parse_pattern;
if (rc != 0)
goto fail_parse_pattern;
enum sfc_flow_tunnel_rule_type ft_rule_type;
struct sfc_mae_pattern_data pattern_data;
efx_tunnel_protocol_t encap_type;
enum sfc_flow_tunnel_rule_type ft_rule_type;
struct sfc_mae_pattern_data pattern_data;
efx_tunnel_protocol_t encap_type;
+ const struct rte_flow_item *pattern;
unsigned int priority;
struct sfc_flow_tunnel *ft;
};
unsigned int priority;
struct sfc_flow_tunnel *ft;
};