aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/flow_offload.h
diff options
context:
space:
mode:
authorVlad Buslov <vladbu@mellanox.com>2019-09-13 18:28:39 +0300
committerDavid S. Miller <davem@davemloft.net>2019-09-16 09:18:02 +0200
commit1158958a218bb55d1c358200d7f82808d11bf929 (patch)
tree3fca9616bf020edceb8c13f528846231eec134bc /include/net/flow_offload.h
parentnet/wan: dscc4: remove broken dscc4 driver (diff)
downloadlinux-dev-1158958a218bb55d1c358200d7f82808d11bf929.tar.xz
linux-dev-1158958a218bb55d1c358200d7f82808d11bf929.zip
net: sched: extend flow_action_entry with destructor
Generalize flow_action_entry cleanup by extending the structure with pointer to destructor function. Set the destructor in tc_setup_flow_action(). Refactor tc_cleanup_flow_action() to call entry->destructor() instead of using switch that dispatches by entry->id and manually executes cleanup. This refactoring is necessary for following patches in this series that require destructor to use tc_action->ops callbacks that can't be easily obtained in tc_cleanup_flow_action(). Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/flow_offload.h')
-rw-r--r--include/net/flow_offload.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h
index fc881875f856..86c567f531f3 100644
--- a/include/net/flow_offload.h
+++ b/include/net/flow_offload.h
@@ -154,8 +154,12 @@ enum flow_action_mangle_base {
FLOW_ACT_MANGLE_HDR_TYPE_UDP,
};
+typedef void (*action_destr)(void *priv);
+
struct flow_action_entry {
enum flow_action_id id;
+ action_destr destructor;
+ void *destructor_priv;
union {
u32 chain_index; /* FLOW_ACTION_GOTO */
struct net_device *dev; /* FLOW_ACTION_REDIRECT */
@@ -170,7 +174,7 @@ struct flow_action_entry {
u32 mask;
u32 val;
} mangle;
- const struct ip_tunnel_info *tunnel; /* FLOW_ACTION_TUNNEL_ENCAP */
+ struct ip_tunnel_info *tunnel; /* FLOW_ACTION_TUNNEL_ENCAP */
u32 csum_flags; /* FLOW_ACTION_CSUM */
u32 mark; /* FLOW_ACTION_MARK */
u16 ptype; /* FLOW_ACTION_PTYPE */