• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/net/sched/

Lines Matching defs:gact

2  * net/sched/gact.c	Generic actions
38 static int gact_net_rand(struct tcf_gact *gact)
40 if (!gact->tcfg_pval || net_random() % gact->tcfg_pval)
41 return gact->tcf_action;
42 return gact->tcfg_paction;
45 static int gact_determ(struct tcf_gact *gact)
47 if (!gact->tcfg_pval || gact->tcf_bstats.packets % gact->tcfg_pval)
48 return gact->tcf_action;
49 return gact->tcfg_paction;
52 typedef int (*g_rand)(struct tcf_gact *gact);
66 struct tcf_gact *gact;
89 pc = tcf_hash_create(parm->index, est, a, sizeof(*gact),
101 gact = to_gact(pc);
103 spin_lock_bh(&gact->tcf_lock);
104 gact->tcf_action = parm->action;
108 gact->tcfg_paction = p_parm->paction;
109 gact->tcfg_pval = p_parm->pval;
110 gact->tcfg_ptype = p_parm->ptype;
113 spin_unlock_bh(&gact->tcf_lock);
121 struct tcf_gact *gact = a->priv;
123 if (gact)
124 return tcf_hash_release(&gact->common, bind, &gact_hash_info);
130 struct tcf_gact *gact = a->priv;
133 spin_lock(&gact->tcf_lock);
135 if (gact->tcfg_ptype && gact_rand[gact->tcfg_ptype] != NULL)
136 action = gact_rand[gact->tcfg_ptype](gact);
138 action = gact->tcf_action;
140 action = gact->tcf_action;
142 gact->tcf_bstats.bytes += qdisc_pkt_len(skb);
143 gact->tcf_bstats.packets++;
145 gact->tcf_qstats.drops++;
146 gact->tcf_tm.lastuse = jiffies;
147 spin_unlock(&gact->tcf_lock);
155 struct tcf_gact *gact = a->priv;
157 .index = gact->tcf_index,
158 .refcnt = gact->tcf_refcnt - ref,
159 .bindcnt = gact->tcf_bindcnt - bind,
160 .action = gact->tcf_action,
166 if (gact->tcfg_ptype) {
168 .paction = gact->tcfg_paction,
169 .pval = gact->tcfg_pval,
170 .ptype = gact->tcfg_ptype,
176 t.install = jiffies_to_clock_t(jiffies - gact->tcf_tm.install);
177 t.lastuse = jiffies_to_clock_t(jiffies - gact->tcf_tm.lastuse);
178 t.expires = jiffies_to_clock_t(gact->tcf_tm.expires);
188 .kind = "gact",