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 <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
This commit is contained in:
Ivan Malov 2020-10-20 10:12:51 +01:00 committed by Ferruh Yigit
parent 34285fd089
commit 05e8b05d08

View File

@ -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);