• Home
  • Raw
  • Download

Lines Matching refs:a

30 void tcf_hash_destroy(struct tc_action *a)  in tcf_hash_destroy()  argument
32 struct tcf_common *p = a->priv; in tcf_hash_destroy()
33 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_destroy()
48 int tcf_hash_release(struct tc_action *a, int bind) in tcf_hash_release() argument
50 struct tcf_common *p = a->priv; in tcf_hash_release()
61 if (a->ops->cleanup) in tcf_hash_release()
62 a->ops->cleanup(a, bind); in tcf_hash_release()
63 tcf_hash_destroy(a); in tcf_hash_release()
72 struct tc_action *a) in tcf_dump_walker() argument
74 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_dump_walker()
91 a->priv = p; in tcf_dump_walker()
92 a->order = n_i; in tcf_dump_walker()
94 nest = nla_nest_start(skb, a->order); in tcf_dump_walker()
97 err = tcf_action_dump_1(skb, a, 0, 0); in tcf_dump_walker()
120 static int tcf_del_walker(struct sk_buff *skb, struct tc_action *a) in tcf_del_walker() argument
122 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_del_walker()
130 nest = nla_nest_start(skb, a->order); in tcf_del_walker()
133 if (nla_put_string(skb, TCA_KIND, a->ops->kind)) in tcf_del_walker()
138 a->priv = p; in tcf_del_walker()
139 ret = tcf_hash_release(a, 0); in tcf_del_walker()
141 module_put(a->ops->owner); in tcf_del_walker()
158 int type, struct tc_action *a) in tcf_generic_walker() argument
161 return tcf_del_walker(skb, a); in tcf_generic_walker()
163 return tcf_dump_walker(skb, cb, a); in tcf_generic_walker()
199 int tcf_hash_search(struct tc_action *a, u32 index) in tcf_hash_search() argument
201 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_search()
205 a->priv = p; in tcf_hash_search()
212 int tcf_hash_check(u32 index, struct tc_action *a, int bind) in tcf_hash_check() argument
214 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_check()
220 a->priv = p; in tcf_hash_check()
227 void tcf_hash_cleanup(struct tc_action *a, struct nlattr *est) in tcf_hash_cleanup() argument
229 struct tcf_common *pc = a->priv; in tcf_hash_cleanup()
237 int tcf_hash_create(u32 index, struct nlattr *est, struct tc_action *a, in tcf_hash_create() argument
240 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_create()
264 a->priv = (void *) p; in tcf_hash_create()
269 void tcf_hash_insert(struct tc_action *a) in tcf_hash_insert() argument
271 struct tcf_common *p = a->priv; in tcf_hash_insert()
272 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_insert()
286 struct tc_action_ops *a; in tcf_register_action() local
309 list_for_each_entry(a, &act_base, head) { in tcf_register_action()
310 if (act->type == a->type || (strcmp(act->kind, a->kind) == 0)) { in tcf_register_action()
325 struct tc_action_ops *a; in tcf_unregister_action() local
329 list_for_each_entry(a, &act_base, head) { in tcf_unregister_action()
330 if (a == act) { in tcf_unregister_action()
346 struct tc_action_ops *a, *res = NULL; in tc_lookup_action_n() local
350 list_for_each_entry(a, &act_base, head) { in tc_lookup_action_n()
351 if (strcmp(kind, a->kind) == 0) { in tc_lookup_action_n()
352 if (try_module_get(a->owner)) in tc_lookup_action_n()
353 res = a; in tc_lookup_action_n()
365 struct tc_action_ops *a, *res = NULL; in tc_lookup_action() local
369 list_for_each_entry(a, &act_base, head) { in tc_lookup_action()
370 if (nla_strcmp(kind, a->kind) == 0) { in tc_lookup_action()
371 if (try_module_get(a->owner)) in tc_lookup_action()
372 res = a; in tc_lookup_action()
384 const struct tc_action *a; in tcf_action_exec() local
392 list_for_each_entry(a, actions, list) { in tcf_action_exec()
394 ret = a->ops->act(skb, a, res); in tcf_action_exec()
412 struct tc_action *a, *tmp; in tcf_action_destroy() local
415 list_for_each_entry_safe(a, tmp, actions, list) { in tcf_action_destroy()
416 ret = tcf_hash_release(a, bind); in tcf_action_destroy()
418 module_put(a->ops->owner); in tcf_action_destroy()
421 list_del(&a->list); in tcf_action_destroy()
422 kfree(a); in tcf_action_destroy()
428 tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int bind, int ref) in tcf_action_dump_old() argument
430 return a->ops->dump(skb, a, bind, ref); in tcf_action_dump_old()
434 tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref) in tcf_action_dump_1() argument
440 if (nla_put_string(skb, TCA_KIND, a->ops->kind)) in tcf_action_dump_1()
442 if (tcf_action_copy_stats(skb, a, 0)) in tcf_action_dump_1()
447 err = tcf_action_dump_old(skb, a, bind, ref); in tcf_action_dump_1()
462 struct tc_action *a; in tcf_action_dump() local
466 list_for_each_entry(a, actions, list) { in tcf_action_dump()
467 nest = nla_nest_start(skb, a->order); in tcf_action_dump()
470 err = tcf_action_dump_1(skb, a, bind, ref); in tcf_action_dump()
489 struct tc_action *a; in tcf_action_init_1() local
537 a = kzalloc(sizeof(*a), GFP_KERNEL); in tcf_action_init_1()
538 if (a == NULL) in tcf_action_init_1()
541 a->ops = a_o; in tcf_action_init_1()
542 INIT_LIST_HEAD(&a->list); in tcf_action_init_1()
545 err = a_o->init(net, tb[TCA_ACT_OPTIONS], est, a, ovr, bind); in tcf_action_init_1()
547 err = a_o->init(net, nla, est, a, ovr, bind); in tcf_action_init_1()
558 return a; in tcf_action_init_1()
561 kfree(a); in tcf_action_init_1()
597 int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a, in tcf_action_copy_stats() argument
602 struct tcf_common *p = a->priv; in tcf_action_copy_stats()
611 if (a->type == TCA_OLD_COMPAT) in tcf_action_copy_stats()
709 struct tc_action *a; in tcf_action_get_1() local
724 a = create_a(0); in tcf_action_get_1()
725 if (a == NULL) in tcf_action_get_1()
729 a->ops = tc_lookup_action(tb[TCA_ACT_KIND]); in tcf_action_get_1()
730 if (a->ops == NULL) /* could happen in batch of actions */ in tcf_action_get_1()
733 if (a->ops->lookup(a, index) == 0) in tcf_action_get_1()
736 module_put(a->ops->owner); in tcf_action_get_1()
737 return a; in tcf_action_get_1()
740 module_put(a->ops->owner); in tcf_action_get_1()
742 kfree(a); in tcf_action_get_1()
749 struct tc_action *a, *tmp; in cleanup_a() local
751 list_for_each_entry_safe(a, tmp, actions, list) { in cleanup_a()
752 list_del(&a->list); in cleanup_a()
753 kfree(a); in cleanup_a()
768 struct tc_action a; in tca_action_flush() local
785 memset(&a, 0, sizeof(struct tc_action)); in tca_action_flush()
786 INIT_LIST_HEAD(&a.list); in tca_action_flush()
787 a.ops = tc_lookup_action(kind); in tca_action_flush()
788 if (a.ops == NULL) /*some idjot trying to flush unknown action */ in tca_action_flush()
803 err = a.ops->walk(skb, &dcb, RTM_DELACTION, &a); in tca_action_flush()
811 module_put(a.ops->owner); in tca_action_flush()
820 module_put(a.ops->owner); in tca_action_flush()
1029 struct tc_action a; in tc_dump_action() local
1043 memset(&a, 0, sizeof(struct tc_action)); in tc_dump_action()
1044 a.ops = a_o; in tc_dump_action()
1059 ret = a_o->walk(skb, cb, RTM_GETACTION, &a); in tc_dump_action()