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);
120 struct tcf_gate *gact = to_gate(a);
122 spin_lock(&gact->tcf_lock);
124 tcf_lastuse_update(&gact->tcf_tm);
125 bstats_update(&gact->tcf_bstats, skb);
127 if (unlikely(gact->current_gate_status & GATE_ACT_PENDING)) {
128 spin_unlock(&gact->tcf_lock);
129 return gact->tcf_action;
132 if (!(gact->current_gate_status & GATE_ACT_GATE_OPEN))
135 if (gact->current_max_octets >= 0) {
136 gact->current_entry_octets += qdisc_pkt_len(skb);
137 if (gact->current_entry_octets > gact->current_max_octets) {
138 gact->tcf_qstats.overlimits++;
143 spin_unlock(&gact->tcf_lock);
145 return gact->tcf_action;
147 gact->tcf_qstats.drops++;
148 spin_unlock(&gact->tcf_lock);
275 static void gate_setup_timer(struct tcf_gate *gact, u64 basetime,
280 if (basetime == gact->param.tcfg_basetime &&
281 tko == gact->tk_offset &&
282 clockid == gact->param.tcfg_clockid)
285 spin_unlock_bh(&gact->tcf_lock);
286 hrtimer_cancel(&gact->hitimer);
287 spin_lock_bh(&gact->tcf_lock);
289 gact->param.tcfg_basetime = basetime;
290 gact->param.tcfg_clockid = clockid;
291 gact->tk_offset = tko;
292 hrtimer_init(&gact->hitimer, clockid, HRTIMER_MODE_ABS_SOFT);
293 gact->hitimer.function = gate_timer_func;
309 struct tcf_gate *gact;
381 gact = to_gate(*a);
383 INIT_LIST_HEAD(&gact->param.entries);
389 spin_lock_bh(&gact->tcf_lock);
390 p = &gact->param;
419 gate_setup_timer(gact, basetime, tk_offset, clockid,
423 gate_get_start_time(gact, &start);
425 gact->current_close_time = start;
426 gact->current_gate_status = GATE_ACT_GATE_OPEN | GATE_ACT_PENDING;
428 gact->next_entry = list_first_entry(&p->entries,
433 gate_start_timer(gact, start);
435 spin_unlock_bh(&gact->tcf_lock);
443 spin_unlock_bh(&gact->tcf_lock);
452 gate_setup_timer(gact, gact->param.tcfg_basetime,
453 gact->tk_offset, gact->param.tcfg_clockid,
461 struct tcf_gate *gact = to_gate(a);
464 p = &gact->param;
465 hrtimer_cancel(&gact->hitimer);
504 struct tcf_gate *gact = to_gate(a);
506 .index = gact->tcf_index,
507 .refcnt = refcount_read(&gact->tcf_refcnt) - ref,
508 .bindcnt = atomic_read(&gact->tcf_bindcnt) - bind,
515 spin_lock_bh(&gact->tcf_lock);
516 opt.action = gact->tcf_action;
518 p = &gact->param;
555 tcf_tm_dump(&t, &gact->tcf_tm);
558 spin_unlock_bh(&gact->tcf_lock);
563 spin_unlock_bh(&gact->tcf_lock);
581 struct tcf_gate *gact = to_gate(a);
582 struct tcf_t *tm = &gact->tcf_tm;