act_api.h (6870112c46c867f50cd27570860a05bd82614b5c) act_api.h (4b61d3e8d3daebbde7ec02d593f84248fdf8bec2)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __NET_ACT_API_H
3#define __NET_ACT_API_H
4
5/*
6 * Public action API for classifiers/qdiscs
7*/
8

--- 92 unchanged lines hidden (view full) ---

101 int (*init)(struct net *net, struct nlattr *nla,
102 struct nlattr *est, struct tc_action **act, int ovr,
103 int bind, bool rtnl_held, struct tcf_proto *tp,
104 u32 flags, struct netlink_ext_ack *extack);
105 int (*walk)(struct net *, struct sk_buff *,
106 struct netlink_callback *, int,
107 const struct tc_action_ops *,
108 struct netlink_ext_ack *);
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __NET_ACT_API_H
3#define __NET_ACT_API_H
4
5/*
6 * Public action API for classifiers/qdiscs
7*/
8

--- 92 unchanged lines hidden (view full) ---

101 int (*init)(struct net *net, struct nlattr *nla,
102 struct nlattr *est, struct tc_action **act, int ovr,
103 int bind, bool rtnl_held, struct tcf_proto *tp,
104 u32 flags, struct netlink_ext_ack *extack);
105 int (*walk)(struct net *, struct sk_buff *,
106 struct netlink_callback *, int,
107 const struct tc_action_ops *,
108 struct netlink_ext_ack *);
109 void (*stats_update)(struct tc_action *, u64, u32, u64, bool);
109 void (*stats_update)(struct tc_action *, u64, u64, u64, u64, bool);
110 size_t (*get_fill_size)(const struct tc_action *act);
111 struct net_device *(*get_dev)(const struct tc_action *a,
112 tc_action_priv_destructor *destructor);
113 struct psample_group *
114 (*get_psample_group)(const struct tc_action *a,
115 tc_action_priv_destructor *destructor);
116};
117

--- 109 unchanged lines hidden (view full) ---

227 qstats_overlimit_inc(this_cpu_ptr(a->cpu_qstats));
228 return;
229 }
230 spin_lock(&a->tcfa_lock);
231 qstats_overlimit_inc(&a->tcfa_qstats);
232 spin_unlock(&a->tcfa_lock);
233}
234
110 size_t (*get_fill_size)(const struct tc_action *act);
111 struct net_device *(*get_dev)(const struct tc_action *a,
112 tc_action_priv_destructor *destructor);
113 struct psample_group *
114 (*get_psample_group)(const struct tc_action *a,
115 tc_action_priv_destructor *destructor);
116};
117

--- 109 unchanged lines hidden (view full) ---

227 qstats_overlimit_inc(this_cpu_ptr(a->cpu_qstats));
228 return;
229 }
230 spin_lock(&a->tcfa_lock);
231 qstats_overlimit_inc(&a->tcfa_qstats);
232 spin_unlock(&a->tcfa_lock);
233}
234
235void tcf_action_update_stats(struct tc_action *a, u64 bytes, u32 packets,
236 bool drop, bool hw);
235void tcf_action_update_stats(struct tc_action *a, u64 bytes, u64 packets,
236 u64 drops, bool hw);
237int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int);
238
239int tcf_action_check_ctrlact(int action, struct tcf_proto *tp,
240 struct tcf_chain **handle,
241 struct netlink_ext_ack *newchain);
242struct tcf_chain *tcf_action_set_ctrlact(struct tc_action *a, int action,
243 struct tcf_chain *newchain);
244#endif /* CONFIG_NET_CLS_ACT */
245
246static inline void tcf_action_stats_update(struct tc_action *a, u64 bytes,
237int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int);
238
239int tcf_action_check_ctrlact(int action, struct tcf_proto *tp,
240 struct tcf_chain **handle,
241 struct netlink_ext_ack *newchain);
242struct tcf_chain *tcf_action_set_ctrlact(struct tc_action *a, int action,
243 struct tcf_chain *newchain);
244#endif /* CONFIG_NET_CLS_ACT */
245
246static inline void tcf_action_stats_update(struct tc_action *a, u64 bytes,
247 u64 packets, u64 lastuse, bool hw)
247 u64 packets, u64 drops,
248 u64 lastuse, bool hw)
248{
249#ifdef CONFIG_NET_CLS_ACT
250 if (!a->ops->stats_update)
251 return;
252
249{
250#ifdef CONFIG_NET_CLS_ACT
251 if (!a->ops->stats_update)
252 return;
253
253 a->ops->stats_update(a, bytes, packets, lastuse, hw);
254 a->ops->stats_update(a, bytes, packets, drops, lastuse, hw);
254#endif
255}
256
257
258#endif
255#endif
256}
257
258
259#endif