From: Ivan Malov Date: Tue, 20 Oct 2020 09:12:51 +0000 (+0100) Subject: net/sfc: validate match spec in MAE backend X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=05e8b05d08d9f764990217c44dc72c2b6e2c5867;p=dpdk.git net/sfc: validate match spec in MAE backend Validate the match specification resulting from pattern parsing within MAE backend in RTE flow implementation. Signed-off-by: Ivan Malov Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index 53e141775a..7e4397762b 100644 --- a/drivers/net/sfc/sfc_mae.c +++ b/drivers/net/sfc/sfc_mae.c @@ -130,10 +130,18 @@ sfc_mae_rule_parse_pattern(struct sfc_adapter *sa, if (rc != 0) goto fail_parse_pattern; + if (!efx_mae_match_spec_is_valid(sa->nic, ctx_mae.match_spec_action)) { + rc = rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ITEM, NULL, + "Inconsistent pattern"); + goto fail_validate_match_spec_action; + } + spec->match_spec = ctx_mae.match_spec_action; return 0; +fail_validate_match_spec_action: fail_parse_pattern: efx_mae_match_spec_fini(sa->nic, ctx_mae.match_spec_action);