Lines Matching defs:est

38 				   struct xt_rateest *est)
42 h = xt_rateest_hash(est->name);
43 hlist_add_head(&est->list, &xn->hash[h]);
49 struct xt_rateest *est;
53 hlist_for_each_entry(est, &xn->hash[h], list) {
54 if (strcmp(est->name, name) == 0) {
55 est->refcnt++;
56 return est;
66 struct xt_rateest *est;
69 est = __xt_rateest_lookup(xn, name);
71 return est;
75 void xt_rateest_put(struct net *net, struct xt_rateest *est)
80 if (--est->refcnt == 0) {
81 hlist_del(&est->list);
82 gen_kill_estimator(&est->rate_est);
84 * gen_estimator est_timer() might access est->lock or bstats,
85 * wait a RCU grace period before freeing 'est'
87 kfree_rcu(est, rcu);
97 struct gnet_stats_basic_sync *stats = &info->est->bstats;
99 spin_lock_bh(&info->est->lock);
102 spin_unlock_bh(&info->est->lock);
111 struct xt_rateest *est;
114 struct gnet_estimator est;
118 if (strnlen(info->name, sizeof(est->name)) >= sizeof(est->name))
124 est = __xt_rateest_lookup(xn, info->name);
125 if (est) {
132 (info->interval != est->params.interval ||
133 info->ewma_log != est->params.ewma_log)) {
134 xt_rateest_put(par->net, est);
137 info->est = est;
142 est = kzalloc(sizeof(*est), GFP_KERNEL);
143 if (!est)
146 gnet_stats_basic_sync_init(&est->bstats);
147 strscpy(est->name, info->name, sizeof(est->name));
148 spin_lock_init(&est->lock);
149 est->refcnt = 1;
150 est->params.interval = info->interval;
151 est->params.ewma_log = info->ewma_log;
153 cfg.opt.nla_len = nla_attr_size(sizeof(cfg.est));
155 cfg.est.interval = info->interval;
156 cfg.est.ewma_log = info->ewma_log;
158 ret = gen_new_estimator(&est->bstats, NULL, &est->rate_est,
159 &est->lock, NULL, &cfg.opt);
163 info->est = est;
164 xt_rateest_hash_insert(xn, est);
169 kfree(est);
179 xt_rateest_put(par->net, info->est);
190 .usersize = offsetof(struct xt_rateest_target_info, est),