Skip to content

Commit

Permalink
net: sched: add tcf_proto_op to offload a rule
Browse files Browse the repository at this point in the history
Create a new tcf_proto_op called 'reoffload' that generates a new offload
message for each node in a tcf_proto. Pointers to the tcf_proto and
whether the offload request is to add or delete the node are included.
Also included is a callback function to send the offload message to and
the option of priv data to go with the cb.

Signed-off-by: John Hurley <john.hurley@netronome.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
John Hurley authored and David S. Miller committed Jun 26, 2018
1 parent 60513bd commit e56185c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions include/net/act_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ static inline void tcf_action_stats_update(struct tc_action *a, u64 bytes,
#endif
}

typedef int tc_setup_cb_t(enum tc_setup_type type,
void *type_data, void *cb_priv);

#ifdef CONFIG_NET_CLS_ACT
int tc_setup_cb_egdev_register(const struct net_device *dev,
tc_setup_cb_t *cb, void *cb_priv);
Expand Down
6 changes: 6 additions & 0 deletions include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ struct qdisc_walker;
struct tcf_walker;
struct module;

typedef int tc_setup_cb_t(enum tc_setup_type type,
void *type_data, void *cb_priv);

struct qdisc_rate_table {
struct tc_ratespec rate;
u32 data[256];
Expand Down Expand Up @@ -256,6 +259,9 @@ struct tcf_proto_ops {
bool *last,
struct netlink_ext_ack *);
void (*walk)(struct tcf_proto*, struct tcf_walker *arg);
int (*reoffload)(struct tcf_proto *tp, bool add,
tc_setup_cb_t *cb, void *cb_priv,
struct netlink_ext_ack *extack);
void (*bind_class)(void *, u32, unsigned long);

/* rtnetlink specific */
Expand Down

0 comments on commit e56185c

Please sign in to comment.