Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _XT_RATEEST_H
0003 #define _XT_RATEEST_H
0004 
0005 #include <net/gen_stats.h>
0006 
0007 struct xt_rateest {
0008     /* keep lock and bstats on same cache line to speedup xt_rateest_tg() */
0009     struct gnet_stats_basic_sync    bstats;
0010     spinlock_t          lock;
0011 
0012 
0013     /* following fields not accessed in hot path */
0014     unsigned int            refcnt;
0015     struct hlist_node       list;
0016     char                name[IFNAMSIZ];
0017     struct gnet_estimator       params;
0018     struct rcu_head         rcu;
0019 
0020     /* keep this field far away to speedup xt_rateest_mt() */
0021     struct net_rate_estimator __rcu *rate_est;
0022 };
0023 
0024 struct xt_rateest *xt_rateest_lookup(struct net *net, const char *name);
0025 void xt_rateest_put(struct net *net, struct xt_rateest *est);
0026 
0027 #endif /* _XT_RATEEST_H */