提交 a7323311 编写于 作者: P Pablo Neira Ayuso 提交者: David S. Miller

net: flow_offload: rename tc_setup_cb_t to flow_setup_cb_t

Rename this type definition and adapt users.
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
Acked-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0c7294dd
...@@ -1679,7 +1679,7 @@ static int mlxsw_sp_setup_tc_block(struct mlxsw_sp_port *mlxsw_sp_port, ...@@ -1679,7 +1679,7 @@ static int mlxsw_sp_setup_tc_block(struct mlxsw_sp_port *mlxsw_sp_port,
struct flow_block_offload *f) struct flow_block_offload *f)
{ {
struct flow_block_cb *block_cb; struct flow_block_cb *block_cb;
tc_setup_cb_t *cb; flow_setup_cb_t *cb;
bool ingress; bool ingress;
int err; int err;
......
...@@ -134,7 +134,7 @@ static int ocelot_setup_tc_block(struct ocelot_port *port, ...@@ -134,7 +134,7 @@ static int ocelot_setup_tc_block(struct ocelot_port *port,
struct flow_block_offload *f) struct flow_block_offload *f)
{ {
struct flow_block_cb *block_cb; struct flow_block_cb *block_cb;
tc_setup_cb_t *cb; flow_setup_cb_t *cb;
int err; int err;
netdev_dbg(port->dev, "tc_block command %d, binder_type %d\n", netdev_dbg(port->dev, "tc_block command %d, binder_type %d\n",
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
#define _NET_FLOW_OFFLOAD_H #define _NET_FLOW_OFFLOAD_H
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/list.h>
#include <net/flow_dissector.h> #include <net/flow_dissector.h>
#include <net/sch_generic.h>
struct flow_match { struct flow_match {
struct flow_dissector *dissector; struct flow_dissector *dissector;
...@@ -261,23 +261,27 @@ struct flow_block_offload { ...@@ -261,23 +261,27 @@ struct flow_block_offload {
struct netlink_ext_ack *extack; struct netlink_ext_ack *extack;
}; };
enum tc_setup_type;
typedef int flow_setup_cb_t(enum tc_setup_type type, void *type_data,
void *cb_priv);
struct flow_block_cb { struct flow_block_cb {
struct list_head driver_list; struct list_head driver_list;
struct list_head list; struct list_head list;
tc_setup_cb_t *cb; flow_setup_cb_t *cb;
void *cb_ident; void *cb_ident;
void *cb_priv; void *cb_priv;
void (*release)(void *cb_priv); void (*release)(void *cb_priv);
unsigned int refcnt; unsigned int refcnt;
}; };
struct flow_block_cb *flow_block_cb_alloc(tc_setup_cb_t *cb, struct flow_block_cb *flow_block_cb_alloc(flow_setup_cb_t *cb,
void *cb_ident, void *cb_priv, void *cb_ident, void *cb_priv,
void (*release)(void *cb_priv)); void (*release)(void *cb_priv));
void flow_block_cb_free(struct flow_block_cb *block_cb); 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); flow_setup_cb_t *cb, void *cb_ident);
void *flow_block_cb_priv(struct flow_block_cb *block_cb); void *flow_block_cb_priv(struct flow_block_cb *block_cb);
void flow_block_cb_incref(struct flow_block_cb *block_cb); void flow_block_cb_incref(struct flow_block_cb *block_cb);
...@@ -295,11 +299,12 @@ static inline void flow_block_cb_remove(struct flow_block_cb *block_cb, ...@@ -295,11 +299,12 @@ static inline void flow_block_cb_remove(struct flow_block_cb *block_cb,
list_move(&block_cb->list, &offload->cb_list); list_move(&block_cb->list, &offload->cb_list);
} }
bool flow_block_cb_is_busy(tc_setup_cb_t *cb, void *cb_ident, bool flow_block_cb_is_busy(flow_setup_cb_t *cb, void *cb_ident,
struct list_head *driver_block_list); struct list_head *driver_block_list);
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_list, tc_setup_cb_t *cb, struct list_head *driver_list,
flow_setup_cb_t *cb,
void *cb_ident, void *cb_priv, bool ingress_only); void *cb_ident, void *cb_priv, bool ingress_only);
enum flow_cls_command { enum flow_cls_command {
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <net/sch_generic.h> #include <net/sch_generic.h>
#include <net/act_api.h> #include <net/act_api.h>
#include <net/flow_offload.h>
#include <net/net_namespace.h> #include <net/net_namespace.h>
/* TC action not accessible from user space */ /* TC action not accessible from user space */
...@@ -126,14 +125,14 @@ static inline struct Qdisc *tcf_block_q(struct tcf_block *block) ...@@ -126,14 +125,14 @@ static inline struct Qdisc *tcf_block_q(struct tcf_block *block)
} }
static inline static inline
int tc_setup_cb_block_register(struct tcf_block *block, tc_setup_cb_t *cb, int tc_setup_cb_block_register(struct tcf_block *block, flow_setup_cb_t *cb,
void *cb_priv) void *cb_priv)
{ {
return 0; return 0;
} }
static inline static inline
void tc_setup_cb_block_unregister(struct tcf_block *block, tc_setup_cb_t *cb, void tc_setup_cb_block_unregister(struct tcf_block *block, flow_setup_cb_t *cb,
void *cb_priv) void *cb_priv)
{ {
} }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <net/gen_stats.h> #include <net/gen_stats.h>
#include <net/rtnetlink.h> #include <net/rtnetlink.h>
#include <net/flow_offload.h>
struct Qdisc_ops; struct Qdisc_ops;
struct qdisc_walker; struct qdisc_walker;
...@@ -22,9 +23,6 @@ struct tcf_walker; ...@@ -22,9 +23,6 @@ struct tcf_walker;
struct module; struct module;
struct bpf_flow_keys; struct bpf_flow_keys;
typedef int tc_setup_cb_t(enum tc_setup_type type,
void *type_data, void *cb_priv);
typedef int tc_indr_block_bind_cb_t(struct net_device *dev, void *cb_priv, typedef int tc_indr_block_bind_cb_t(struct net_device *dev, void *cb_priv,
enum tc_setup_type type, void *type_data); enum tc_setup_type type, void *type_data);
...@@ -313,7 +311,7 @@ struct tcf_proto_ops { ...@@ -313,7 +311,7 @@ struct tcf_proto_ops {
void (*walk)(struct tcf_proto *tp, void (*walk)(struct tcf_proto *tp,
struct tcf_walker *arg, bool rtnl_held); struct tcf_walker *arg, bool rtnl_held);
int (*reoffload)(struct tcf_proto *tp, bool add, int (*reoffload)(struct tcf_proto *tp, bool add,
tc_setup_cb_t *cb, void *cb_priv, flow_setup_cb_t *cb, void *cb_priv,
struct netlink_ext_ack *extack); struct netlink_ext_ack *extack);
void (*bind_class)(void *, u32, unsigned long); void (*bind_class)(void *, u32, unsigned long);
void * (*tmplt_create)(struct net *net, void * (*tmplt_create)(struct net *net,
......
...@@ -165,7 +165,7 @@ void flow_rule_match_enc_opts(const struct flow_rule *rule, ...@@ -165,7 +165,7 @@ void flow_rule_match_enc_opts(const struct flow_rule *rule,
} }
EXPORT_SYMBOL(flow_rule_match_enc_opts); EXPORT_SYMBOL(flow_rule_match_enc_opts);
struct flow_block_cb *flow_block_cb_alloc(tc_setup_cb_t *cb, struct flow_block_cb *flow_block_cb_alloc(flow_setup_cb_t *cb,
void *cb_ident, void *cb_priv, void *cb_ident, void *cb_priv,
void (*release)(void *cb_priv)) void (*release)(void *cb_priv))
{ {
...@@ -194,7 +194,7 @@ void flow_block_cb_free(struct flow_block_cb *block_cb) ...@@ -194,7 +194,7 @@ void flow_block_cb_free(struct flow_block_cb *block_cb)
EXPORT_SYMBOL(flow_block_cb_free); EXPORT_SYMBOL(flow_block_cb_free);
struct flow_block_cb *flow_block_cb_lookup(struct flow_block_offload *f, struct flow_block_cb *flow_block_cb_lookup(struct flow_block_offload *f,
tc_setup_cb_t *cb, void *cb_ident) flow_setup_cb_t *cb, void *cb_ident)
{ {
struct flow_block_cb *block_cb; struct flow_block_cb *block_cb;
...@@ -226,7 +226,7 @@ unsigned int flow_block_cb_decref(struct flow_block_cb *block_cb) ...@@ -226,7 +226,7 @@ unsigned int flow_block_cb_decref(struct flow_block_cb *block_cb)
} }
EXPORT_SYMBOL(flow_block_cb_decref); EXPORT_SYMBOL(flow_block_cb_decref);
bool flow_block_cb_is_busy(tc_setup_cb_t *cb, void *cb_ident, bool flow_block_cb_is_busy(flow_setup_cb_t *cb, void *cb_ident,
struct list_head *driver_block_list) struct list_head *driver_block_list)
{ {
struct flow_block_cb *block_cb; struct flow_block_cb *block_cb;
...@@ -243,7 +243,8 @@ EXPORT_SYMBOL(flow_block_cb_is_busy); ...@@ -243,7 +243,8 @@ EXPORT_SYMBOL(flow_block_cb_is_busy);
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, flow_setup_cb_t *cb,
void *cb_ident, void *cb_priv,
bool ingress_only) bool ingress_only)
{ {
struct flow_block_cb *block_cb; struct flow_block_cb *block_cb;
......
...@@ -951,7 +951,7 @@ static int dsa_slave_setup_tc_block(struct net_device *dev, ...@@ -951,7 +951,7 @@ static int dsa_slave_setup_tc_block(struct net_device *dev,
struct flow_block_offload *f) struct flow_block_offload *f)
{ {
struct flow_block_cb *block_cb; struct flow_block_cb *block_cb;
tc_setup_cb_t *cb; flow_setup_cb_t *cb;
if (f->binder_type == FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS) if (f->binder_type == FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS)
cb = dsa_slave_setup_tc_block_cb_ig; cb = dsa_slave_setup_tc_block_cb_ig;
......
...@@ -1514,7 +1514,7 @@ void tcf_block_put(struct tcf_block *block) ...@@ -1514,7 +1514,7 @@ void tcf_block_put(struct tcf_block *block)
EXPORT_SYMBOL(tcf_block_put); EXPORT_SYMBOL(tcf_block_put);
static int static int
tcf_block_playback_offloads(struct tcf_block *block, tc_setup_cb_t *cb, tcf_block_playback_offloads(struct tcf_block *block, flow_setup_cb_t *cb,
void *cb_priv, bool add, bool offload_in_use, void *cb_priv, bool add, bool offload_in_use,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
......
...@@ -651,7 +651,7 @@ static void cls_bpf_walk(struct tcf_proto *tp, struct tcf_walker *arg, ...@@ -651,7 +651,7 @@ static void cls_bpf_walk(struct tcf_proto *tp, struct tcf_walker *arg,
} }
} }
static int cls_bpf_reoffload(struct tcf_proto *tp, bool add, tc_setup_cb_t *cb, static int cls_bpf_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
void *cb_priv, struct netlink_ext_ack *extack) void *cb_priv, struct netlink_ext_ack *extack)
{ {
struct cls_bpf_head *head = rtnl_dereference(tp->root); struct cls_bpf_head *head = rtnl_dereference(tp->root);
......
...@@ -1800,7 +1800,7 @@ fl_get_next_hw_filter(struct tcf_proto *tp, struct cls_fl_filter *f, bool add) ...@@ -1800,7 +1800,7 @@ fl_get_next_hw_filter(struct tcf_proto *tp, struct cls_fl_filter *f, bool add)
return NULL; return NULL;
} }
static int fl_reoffload(struct tcf_proto *tp, bool add, tc_setup_cb_t *cb, static int fl_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
void *cb_priv, struct netlink_ext_ack *extack) void *cb_priv, struct netlink_ext_ack *extack)
{ {
struct tcf_block *block = tp->chain->block; struct tcf_block *block = tp->chain->block;
......
...@@ -282,7 +282,7 @@ static void mall_walk(struct tcf_proto *tp, struct tcf_walker *arg, ...@@ -282,7 +282,7 @@ static void mall_walk(struct tcf_proto *tp, struct tcf_walker *arg,
arg->count++; arg->count++;
} }
static int mall_reoffload(struct tcf_proto *tp, bool add, tc_setup_cb_t *cb, static int mall_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
void *cb_priv, struct netlink_ext_ack *extack) void *cb_priv, struct netlink_ext_ack *extack)
{ {
struct cls_mall_head *head = rtnl_dereference(tp->root); struct cls_mall_head *head = rtnl_dereference(tp->root);
......
...@@ -1152,7 +1152,7 @@ static void u32_walk(struct tcf_proto *tp, struct tcf_walker *arg, ...@@ -1152,7 +1152,7 @@ static void u32_walk(struct tcf_proto *tp, struct tcf_walker *arg,
} }
static int u32_reoffload_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht, static int u32_reoffload_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
bool add, tc_setup_cb_t *cb, void *cb_priv, bool add, flow_setup_cb_t *cb, void *cb_priv,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
struct tc_cls_u32_offload cls_u32 = {}; struct tc_cls_u32_offload cls_u32 = {};
...@@ -1172,7 +1172,7 @@ static int u32_reoffload_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht, ...@@ -1172,7 +1172,7 @@ static int u32_reoffload_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
} }
static int u32_reoffload_knode(struct tcf_proto *tp, struct tc_u_knode *n, static int u32_reoffload_knode(struct tcf_proto *tp, struct tc_u_knode *n,
bool add, tc_setup_cb_t *cb, void *cb_priv, bool add, flow_setup_cb_t *cb, void *cb_priv,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
struct tc_u_hnode *ht = rtnl_dereference(n->ht_down); struct tc_u_hnode *ht = rtnl_dereference(n->ht_down);
...@@ -1213,7 +1213,7 @@ static int u32_reoffload_knode(struct tcf_proto *tp, struct tc_u_knode *n, ...@@ -1213,7 +1213,7 @@ static int u32_reoffload_knode(struct tcf_proto *tp, struct tc_u_knode *n,
return 0; return 0;
} }
static int u32_reoffload(struct tcf_proto *tp, bool add, tc_setup_cb_t *cb, static int u32_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
void *cb_priv, struct netlink_ext_ack *extack) void *cb_priv, struct netlink_ext_ack *extack)
{ {
struct tc_u_common *tp_c = tp->data; struct tc_u_common *tp_c = tp->data;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册