flow_offload: add control flag checking helpers
authorAsbjørn Sloth Tønnesen <ast@fiberby.net>
Thu, 11 Apr 2024 10:52:54 +0000 (10:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Apr 2024 09:33:14 +0000 (10:33 +0100)
commitd11e63119432bdb55065d094cb6fd37e9147c70d
tree64f30282476a2c1f2edb4e369b417d69cd652b6e
parent3db3b62955cd6d73afde05a17d7e8e106695c3b9
flow_offload: add control flag checking helpers

These helpers aim to help drivers, with checking
for the presence of unsupported control flags.

For drivers supporting at least one control flag:
  flow_rule_is_supp_control_flags()

For drivers using flow_rule_match_control(), but not using flags:
  flow_rule_has_control_flags()

For drivers not using flow_rule_match_control():
  flow_rule_match_has_control_flags()

While primarily aimed at FLOW_DISSECTOR_KEY_CONTROL
and flow_rule_match_control(), then the first two
can also be used with FLOW_DISSECTOR_KEY_ENC_CONTROL
and flow_rule_match_enc_control().

These helpers mirrors the existing check done in sfc:
  drivers/net/ethernet/sfc/tc.c +276

Only compile-tested.

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>
include/net/flow_offload.h