Merge tag 'riscv-for-linus-5.17-mw0' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-block.git] / include / net / netfilter / xt_rateest.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
5859034d
PM
2#ifndef _XT_RATEEST_H
3#define _XT_RATEEST_H
4
1c0d32fd
ED
5#include <net/gen_stats.h>
6
5859034d 7struct xt_rateest {
339bb99e 8 /* keep lock and bstats on same cache line to speedup xt_rateest_tg() */
50dc9a85 9 struct gnet_stats_basic_sync bstats;
339bb99e 10 spinlock_t lock;
1c0d32fd 11
339bb99e
ED
12
13 /* following fields not accessed in hot path */
1c0d32fd 14 unsigned int refcnt;
5859034d
PM
15 struct hlist_node list;
16 char name[IFNAMSIZ];
5859034d 17 struct gnet_estimator params;
c7de2cf0 18 struct rcu_head rcu;
1c0d32fd
ED
19
20 /* keep this field far away to speedup xt_rateest_mt() */
21 struct net_rate_estimator __rcu *rate_est;
5859034d
PM
22};
23
3427b2ab
CW
24struct xt_rateest *xt_rateest_lookup(struct net *net, const char *name);
25void xt_rateest_put(struct net *net, struct xt_rateest *est);
5859034d
PM
26
27#endif /* _XT_RATEEST_H */