Lines Matching defs:gact

21 static ktime_t gate_get_time(struct tcf_gate *gact)
25 switch (gact->tk_offset) {
29 return ktime_mono_to_any(mono, gact->tk_offset);
35 static void gate_get_start_time(struct tcf_gate *gact, ktime_t *start)
37 struct tcf_gate_params *param = &gact->param;
42 now = gate_get_time(gact);
55 static void gate_start_timer(struct tcf_gate *gact, ktime_t start)
59 expires = hrtimer_get_expires(&gact->hitimer);
65 hrtimer_start(&gact->hitimer, start, HRTIMER_MODE_ABS_SOFT);
70 struct tcf_gate *gact = container_of(timer, struct tcf_gate,
72 struct tcf_gate_params *p = &gact->param;
76 spin_lock(&gact->tcf_lock);
78 next = gact->next_entry;
81 gact->current_gate_status = next->gate_state ? GATE_ACT_GATE_OPEN : 0;
82 gact->current_entry_octets = 0;
83 gact->current_max_octets = next->maxoctets;
85 gact->current_close_time = ktime_add_ns(gact->current_close_time,
88 close_time = gact->current_close_time;
96 now = gate_get_time(gact);
108 gact->next_entry = next;
110 hrtimer_set_expires(&gact->hitimer, close_time);
112 spin_unlock(&gact->tcf_lock);
121 struct tcf_gate *gact = to_gate(a);
122 int action = READ_ONCE(gact->tcf_action);
124 tcf_lastuse_update(&gact->tcf_tm);
125 tcf_action_update_bstats(&gact->common, skb);
127 spin_lock(&gact->tcf_lock);
128 if (unlikely(gact->current_gate_status & GATE_ACT_PENDING)) {
129 spin_unlock(&gact->tcf_lock);
133 if (!(gact->current_gate_status & GATE_ACT_GATE_OPEN)) {
134 spin_unlock(&gact->tcf_lock);
138 if (gact->current_max_octets >= 0) {
139 gact->current_entry_octets += qdisc_pkt_len(skb);
140 if (gact->current_entry_octets > gact->current_max_octets) {
141 spin_unlock(&gact->tcf_lock);
145 spin_unlock(&gact->tcf_lock);
150 tcf_action_inc_overlimit_qstats(&gact->common);
152 tcf_action_inc_drop_qstats(&gact->common);
278 static void gate_setup_timer(struct tcf_gate *gact, u64 basetime,
283 if (basetime == gact->param.tcfg_basetime &&
284 tko == gact->tk_offset &&
285 clockid == gact->param.tcfg_clockid)
288 spin_unlock_bh(&gact->tcf_lock);
289 hrtimer_cancel(&gact->hitimer);
290 spin_lock_bh(&gact->tcf_lock);
292 gact->param.tcfg_basetime = basetime;
293 gact->param.tcfg_clockid = clockid;
294 gact->tk_offset = tko;
295 hrtimer_init(&gact->hitimer, clockid, HRTIMER_MODE_ABS_SOFT);
296 gact->hitimer.function = gate_timer_func;
312 struct tcf_gate *gact;
384 gact = to_gate(*a);
386 INIT_LIST_HEAD(&gact->param.entries);
392 spin_lock_bh(&gact->tcf_lock);
393 p = &gact->param;
422 gate_setup_timer(gact, basetime, tk_offset, clockid,
426 gate_get_start_time(gact, &start);
428 gact->current_close_time = start;
429 gact->current_gate_status = GATE_ACT_GATE_OPEN | GATE_ACT_PENDING;
431 gact->next_entry = list_first_entry(&p->entries,
436 gate_start_timer(gact, start);
438 spin_unlock_bh(&gact->tcf_lock);
446 spin_unlock_bh(&gact->tcf_lock);
455 gate_setup_timer(gact, gact->param.tcfg_basetime,
456 gact->tk_offset, gact->param.tcfg_clockid,
464 struct tcf_gate *gact = to_gate(a);
467 p = &gact->param;
468 hrtimer_cancel(&gact->hitimer);
507 struct tcf_gate *gact = to_gate(a);
509 .index = gact->tcf_index,
510 .refcnt = refcount_read(&gact->tcf_refcnt) - ref,
511 .bindcnt = atomic_read(&gact->tcf_bindcnt) - bind,
518 spin_lock_bh(&gact->tcf_lock);
519 opt.action = gact->tcf_action;
521 p = &gact->param;
558 tcf_tm_dump(&t, &gact->tcf_tm);
561 spin_unlock_bh(&gact->tcf_lock);
566 spin_unlock_bh(&gact->tcf_lock);
574 struct tcf_gate *gact = to_gate(a);
575 struct tcf_t *tm = &gact->tcf_tm;