]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nfp: flower: fix check for unsupported control flags
authorAsbjørn Sloth Tønnesen <ast@fiberby.net>
Thu, 11 Apr 2024 10:52:55 +0000 (10:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Apr 2024 09:33:14 +0000 (10:33 +0100)
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: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/offload.c

index 0aceef9fe58267564afee1c179e7731a3c615482..8e0a890381b60e29a3d507983940076a543edb82 100644 (file)
@@ -527,10 +527,10 @@ 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;