net: flow_offload: add flow_block_cb_alloc() and flow_block_cb_free()

Add a new helper function to allocate flow_block_cb objects.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Pablo Neira Ayuso
2019-07-09 22:55:42 +02:00
committed by David S. Miller
parent 32f8c4093a
commit d63db30c85
2 changed files with 42 additions and 0 deletions

View File

@@ -260,6 +260,20 @@ struct flow_block_offload {
struct netlink_ext_ack *extack;
};
struct flow_block_cb {
struct list_head list;
tc_setup_cb_t *cb;
void *cb_ident;
void *cb_priv;
void (*release)(void *cb_priv);
unsigned int refcnt;
};
struct flow_block_cb *flow_block_cb_alloc(struct net *net, tc_setup_cb_t *cb,
void *cb_ident, void *cb_priv,
void (*release)(void *cb_priv));
void flow_block_cb_free(struct flow_block_cb *block_cb);
int flow_block_cb_setup_simple(struct flow_block_offload *f,
struct list_head *driver_list, tc_setup_cb_t *cb,
void *cb_ident, void *cb_priv, bool ingress_only);