Lines Matching refs:d
33 struct tcf_defact *d = a->priv; in tcf_simp() local
35 spin_lock(&d->tcf_lock); in tcf_simp()
36 d->tcf_tm.lastuse = jiffies; in tcf_simp()
37 bstats_update(&d->tcf_bstats, skb); in tcf_simp()
44 (char *)d->tcfd_defdata, d->tcf_bstats.packets); in tcf_simp()
45 spin_unlock(&d->tcf_lock); in tcf_simp()
46 return d->tcf_action; in tcf_simp()
51 struct tcf_defact *d = to_defact(a); in tcf_simp_release() local
52 kfree(d->tcfd_defdata); in tcf_simp_release()
55 static int alloc_defdata(struct tcf_defact *d, char *defdata) in alloc_defdata() argument
57 d->tcfd_defdata = kzalloc(SIMP_MAX_DATA, GFP_KERNEL); in alloc_defdata()
58 if (unlikely(!d->tcfd_defdata)) in alloc_defdata()
60 strlcpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA); in alloc_defdata()
64 static void reset_policy(struct tcf_defact *d, char *defdata, in reset_policy() argument
67 spin_lock_bh(&d->tcf_lock); in reset_policy()
68 d->tcf_action = p->action; in reset_policy()
69 memset(d->tcfd_defdata, 0, SIMP_MAX_DATA); in reset_policy()
70 strlcpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA); in reset_policy()
71 spin_unlock_bh(&d->tcf_lock); in reset_policy()
85 struct tcf_defact *d; in tcf_simp_init() local
106 ret = tcf_hash_create(parm->index, est, a, sizeof(*d), in tcf_simp_init()
111 d = to_defact(a); in tcf_simp_init()
112 ret = alloc_defdata(d, defdata); in tcf_simp_init()
117 d->tcf_action = parm->action; in tcf_simp_init()
120 d = to_defact(a); in tcf_simp_init()
128 reset_policy(d, defdata, parm); in tcf_simp_init()
140 struct tcf_defact *d = a->priv; in tcf_simp_dump() local
142 .index = d->tcf_index, in tcf_simp_dump()
143 .refcnt = d->tcf_refcnt - ref, in tcf_simp_dump()
144 .bindcnt = d->tcf_bindcnt - bind, in tcf_simp_dump()
145 .action = d->tcf_action, in tcf_simp_dump()
150 nla_put_string(skb, TCA_DEF_DATA, d->tcfd_defdata)) in tcf_simp_dump()
152 t.install = jiffies_to_clock_t(jiffies - d->tcf_tm.install); in tcf_simp_dump()
153 t.lastuse = jiffies_to_clock_t(jiffies - d->tcf_tm.lastuse); in tcf_simp_dump()
154 t.expires = jiffies_to_clock_t(d->tcf_tm.expires); in tcf_simp_dump()