]> www.infradead.org Git - users/jedix/linux-maple.git/commit
flow_offload: add encapsulation control flag helpers
authorAsbjørn Sloth Tønnesen <ast@fiberby.net>
Sun, 9 Jun 2024 17:33:51 +0000 (17:33 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 13 Jun 2024 00:56:00 +0000 (17:56 -0700)
commitb48a1540b73a3c3a9ef59ce34176cc8180c6ce57
tree6486626d69f7665f13951bb0d475d488bc103bd0
parentdee4dd10c79aaca192b73520d8fb64628468ae0f
flow_offload: add encapsulation control flag helpers

This patch adds two new helper functions:
  flow_rule_is_supp_enc_control_flags()
  flow_rule_has_enc_control_flags()

They are intended to be used for validating encapsulation control
flags, and compliment the similar helpers without "enc_" in the name.

The only difference is that they have their own error message,
to make it obvious if an unsupported flag error is related to
FLOW_DISSECTOR_KEY_CONTROL or FLOW_DISSECTOR_KEY_ENC_CONTROL.

flow_rule_has_enc_control_flags() is for drivers supporting
FLOW_DISSECTOR_KEY_ENC_CONTROL, but not supporting any
encapsulation control flags.
(Currently all 4 drivers fits this category)

flow_rule_is_supp_enc_control_flags() is currently only used
for the above helper, but should also be used by drivers once
they implement at least one encapsulation control flag.

There is AFAICT currently no need for an "enc_" variant of
flow_rule_match_has_control_flags(), as all drivers currently
supporting FLOW_DISSECTOR_KEY_ENC_CONTROL, are already calling
flow_rule_match_enc_control() directly.

Only compile tested.

Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Reviewed-by: Davide Caratti <dcaratti@redhat.com>
Link: https://lore.kernel.org/r/20240609173358.193178-2-ast@fiberby.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/flow_offload.h