diff options
Diffstat (limited to 'include/net/act_api.h')
| -rw-r--r-- | include/net/act_api.h | 24 | 
1 files changed, 21 insertions, 3 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h index 3ee4c92afd1b..9d446f136607 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -21,6 +21,8 @@ struct tcf_common {  	struct gnet_stats_rate_est64	tcfc_rate_est;  	spinlock_t			tcfc_lock;  	struct rcu_head			tcfc_rcu; +	struct gnet_stats_basic_cpu __percpu *cpu_bstats; +	struct gnet_stats_queue __percpu *cpu_qstats;  };  #define tcf_head	common.tcfc_head  #define tcf_index	common.tcfc_index @@ -68,6 +70,17 @@ static inline void tcf_hashinfo_destroy(struct tcf_hashinfo *hf)  	kfree(hf->htab);  } +/* Update lastuse only if needed, to avoid dirtying a cache line. + * We use a temp variable to avoid fetching jiffies twice. + */ +static inline void tcf_lastuse_update(struct tcf_t *tm) +{ +	unsigned long now = jiffies; + +	if (tm->lastuse != now) +		tm->lastuse = now; +} +  #ifdef CONFIG_NET_CLS_ACT  #define ACT_P_CREATED 1 @@ -98,15 +111,20 @@ struct tc_action_ops {  };  int tcf_hash_search(struct tc_action *a, u32 index); -void tcf_hash_destroy(struct tc_action *a); -int tcf_hash_release(struct tc_action *a, int bind);  u32 tcf_hash_new_index(struct tcf_hashinfo *hinfo);  int tcf_hash_check(u32 index, struct tc_action *a, int bind);  int tcf_hash_create(u32 index, struct nlattr *est, struct tc_action *a, -		    int size, int bind); +		    int size, int bind, bool cpustats);  void tcf_hash_cleanup(struct tc_action *a, struct nlattr *est);  void tcf_hash_insert(struct tc_action *a); +int __tcf_hash_release(struct tc_action *a, bool bind, bool strict); + +static inline int tcf_hash_release(struct tc_action *a, bool bind) +{ +	return __tcf_hash_release(a, bind, false); +} +  int tcf_register_action(struct tc_action_ops *a, unsigned int mask);  int tcf_unregister_action(struct tc_action_ops *a);  int tcf_action_destroy(struct list_head *actions, int bind);  |