diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-07-09 23:55:39 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-10 00:38:50 +0300 |
commit | 4e95bc268b915c3a19ec8b9110f61e4ea41a1ed0 (patch) | |
tree | 98ae57b058ea60b87e43192551dc3868d866877f /include/net/pkt_cls.h | |
parent | 2bb295f3a5e612b36ccf5986b529a8d4b426cf4f (diff) | |
download | linux-4e95bc268b915c3a19ec8b9110f61e4ea41a1ed0.tar.xz |
net: flow_offload: add flow_block_cb_setup_simple()
Most drivers do the same thing to set up the flow block callbacks, this
patch adds a helper function to do this.
This preparation patch reduces the number of changes to adapt the
existing drivers to use the flow block callback API.
This new helper function takes a flow block list per-driver, which is
set to NULL until this driver list is used.
This patch also introduces the flow_block_command and
flow_block_binder_type enumerations, which are renamed to use
FLOW_BLOCK_* in follow up patches.
There are three definitions (aliases) in order to reduce the number of
updates in this patch, which go away once drivers are fully adapted to
use this flow block API.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/pkt_cls.h')
-rw-r--r-- | include/net/pkt_cls.h | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 1a7596ba0dbe..b6c306fa9541 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -26,11 +26,9 @@ struct tcf_walker { int register_tcf_proto_ops(struct tcf_proto_ops *ops); int unregister_tcf_proto_ops(struct tcf_proto_ops *ops); -enum tcf_block_binder_type { - TCF_BLOCK_BINDER_TYPE_UNSPEC, - TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS, - TCF_BLOCK_BINDER_TYPE_CLSACT_EGRESS, -}; +#define tc_block_offload flow_block_offload +#define tc_block_command flow_block_command +#define tcf_block_binder_type flow_block_binder_type struct tcf_block_ext_info { enum tcf_block_binder_type binder_type; @@ -610,18 +608,6 @@ int tc_setup_cb_call(struct tcf_block *block, enum tc_setup_type type, void *type_data, bool err_stop); unsigned int tcf_exts_num_actions(struct tcf_exts *exts); -enum tc_block_command { - TC_BLOCK_BIND, - TC_BLOCK_UNBIND, -}; - -struct tc_block_offload { - enum tc_block_command command; - enum tcf_block_binder_type binder_type; - struct tcf_block *block; - struct netlink_ext_ack *extack; -}; - struct tc_cls_common_offload { u32 chain_index; __be16 protocol; |