Commit 67bd0d5e authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso Committed by David S. Miller

net: flow_offload: add flow_block_cb_{priv, incref, decref}()

This patch completes the flow block API to introduce:

* flow_block_cb_priv() to access callback private data.
* flow_block_cb_incref() to bump reference counter on this flow block.
* flow_block_cb_decref() to decrement the reference counter.

These functions are taken from the existing tcf_block_cb_priv(),
tcf_block_cb_incref() and tcf_block_cb_decref().
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent da3eeb90
...@@ -281,6 +281,10 @@ void flow_block_cb_free(struct flow_block_cb *block_cb); ...@@ -281,6 +281,10 @@ void flow_block_cb_free(struct flow_block_cb *block_cb);
struct flow_block_cb *flow_block_cb_lookup(struct flow_block_offload *offload, struct flow_block_cb *flow_block_cb_lookup(struct flow_block_offload *offload,
tc_setup_cb_t *cb, void *cb_ident); tc_setup_cb_t *cb, void *cb_ident);
void *flow_block_cb_priv(struct flow_block_cb *block_cb);
void flow_block_cb_incref(struct flow_block_cb *block_cb);
unsigned int flow_block_cb_decref(struct flow_block_cb *block_cb);
static inline void flow_block_cb_add(struct flow_block_cb *block_cb, static inline void flow_block_cb_add(struct flow_block_cb *block_cb,
struct flow_block_offload *offload) struct flow_block_offload *offload)
{ {
......
...@@ -211,6 +211,24 @@ struct flow_block_cb *flow_block_cb_lookup(struct flow_block_offload *f, ...@@ -211,6 +211,24 @@ struct flow_block_cb *flow_block_cb_lookup(struct flow_block_offload *f,
} }
EXPORT_SYMBOL(flow_block_cb_lookup); EXPORT_SYMBOL(flow_block_cb_lookup);
void *flow_block_cb_priv(struct flow_block_cb *block_cb)
{
return block_cb->cb_priv;
}
EXPORT_SYMBOL(flow_block_cb_priv);
void flow_block_cb_incref(struct flow_block_cb *block_cb)
{
block_cb->refcnt++;
}
EXPORT_SYMBOL(flow_block_cb_incref);
unsigned int flow_block_cb_decref(struct flow_block_cb *block_cb)
{
return --block_cb->refcnt;
}
EXPORT_SYMBOL(flow_block_cb_decref);
int flow_block_cb_setup_simple(struct flow_block_offload *f, int flow_block_cb_setup_simple(struct flow_block_offload *f,
struct list_head *driver_block_list, struct list_head *driver_block_list,
tc_setup_cb_t *cb, void *cb_ident, void *cb_priv, tc_setup_cb_t *cb, void *cb_ident, void *cb_priv,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment