Commit e36245da authored by Asbjørn Sloth Tønnesen's avatar Asbjørn Sloth Tønnesen Committed by David S. Miller
Browse files

nfp: flower: fix check for unsupported control flags



Use flow_rule_is_supp_control_flags()

Check the mask, not the key, for unsupported control flags.

Only compile-tested, no access to HW

Signed-off-by: default avatarAsbjørn Sloth Tønnesen <ast@fiberby.net>
Reviewed-by: default avatarLouis Peens <louis.peens@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d11e6311
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -527,11 +527,11 @@ nfp_flower_calculate_key_layers(struct nfp_app *app,
		struct flow_match_control ctl;

		flow_rule_match_control(rule, &ctl);
		if (ctl.key->flags & ~NFP_FLOWER_SUPPORTED_CTLFLAGS) {
			NL_SET_ERR_MSG_MOD(extack, "unsupported offload: match on unknown control flag");

		if (!flow_rule_is_supp_control_flags(NFP_FLOWER_SUPPORTED_CTLFLAGS,
						     ctl.mask->flags, extack))
			return -EOPNOTSUPP;
	}
	}

	ret_key_ls->key_layer = key_layer;
	ret_key_ls->key_layer_two = key_layer_two;