Lines Matching refs:a

44 static void tcf_action_goto_chain_exec(const struct tc_action *a,  in tcf_action_goto_chain_exec()  argument
47 const struct tcf_chain *chain = rcu_dereference_bh(a->goto_chain); in tcf_action_goto_chain_exec()
106 struct tcf_chain *tcf_action_set_ctrlact(struct tc_action *a, int action, in tcf_action_set_ctrlact() argument
109 a->tcfa_action = action; in tcf_action_set_ctrlact()
110 goto_chain = rcu_replace_pointer(a->goto_chain, goto_chain, 1); in tcf_action_set_ctrlact()
420 int tcf_idr_release(struct tc_action *a, bool bind) in tcf_idr_release() argument
422 const struct tc_action_ops *ops = a->ops; in tcf_idr_release()
425 ret = __tcf_idr_release(a, bind, false); in tcf_idr_release()
478 tcf_action_dump_terse(struct sk_buff *skb, struct tc_action *a, bool from_act) in tcf_action_dump_terse() argument
483 if (nla_put_string(skb, TCA_ACT_KIND, a->ops->kind)) in tcf_action_dump_terse()
485 if (tcf_action_copy_stats(skb, a, 0)) in tcf_action_dump_terse()
487 if (from_act && nla_put_u32(skb, TCA_ACT_INDEX, a->tcfa_index)) in tcf_action_dump_terse()
491 cookie = rcu_dereference(a->user_cookie); in tcf_action_dump_terse()
508 tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref) in tcf_action_dump_1() argument
515 if (tcf_action_dump_terse(skb, a, false)) in tcf_action_dump_1()
518 if (a->hw_stats != TCA_ACT_HW_STATS_ANY && in tcf_action_dump_1()
520 a->hw_stats, TCA_ACT_HW_STATS_ANY)) in tcf_action_dump_1()
523 if (a->used_hw_stats_valid && in tcf_action_dump_1()
525 a->used_hw_stats, TCA_ACT_HW_STATS_ANY)) in tcf_action_dump_1()
528 flags = a->tcfa_flags & TCA_ACT_FLAGS_USER_MASK; in tcf_action_dump_1()
534 if (nla_put_u32(skb, TCA_ACT_IN_HW_COUNT, a->in_hw_count)) in tcf_action_dump_1()
540 err = tcf_action_dump_old(skb, a, bind, ref); in tcf_action_dump_1()
698 int tcf_idr_search(struct tc_action_net *tn, struct tc_action **a, u32 index) in tcf_idr_search() argument
712 *a = p; in tcf_idr_search()
734 struct tc_action **a, u32 index) in __tcf_idr_search() argument
739 return ops->lookup(net, a, index); in __tcf_idr_search()
741 return tcf_idr_search(tn, a, index); in __tcf_idr_search()
778 struct tc_action **a, const struct tc_action_ops *ops, in tcf_idr_create() argument
821 *a = p; in tcf_idr_create()
836 struct nlattr *est, struct tc_action **a, in tcf_idr_create_from_flags() argument
841 return tcf_idr_create(tn, index, est, a, ops, bind, in tcf_idr_create_from_flags()
869 struct tc_action **a, int bind) in tcf_idr_check_alloc() argument
903 *a = p; in tcf_idr_check_alloc()
915 *a = NULL; in tcf_idr_check_alloc()
1018 struct tc_action_ops *a; in tcf_register_action() local
1039 list_for_each_entry(a, &act_base, head) { in tcf_register_action()
1040 if (act->id == a->id || (strcmp(act->kind, a->kind) == 0)) { in tcf_register_action()
1063 struct tc_action_ops *a; in tcf_unregister_action() local
1067 list_for_each_entry(a, &act_base, head) { in tcf_unregister_action()
1068 if (a == act) { in tcf_unregister_action()
1087 struct tc_action_ops *a, *res = NULL; in tc_lookup_action_n() local
1091 list_for_each_entry(a, &act_base, head) { in tc_lookup_action_n()
1092 if (strcmp(kind, a->kind) == 0) { in tc_lookup_action_n()
1093 if (try_module_get(a->owner)) in tc_lookup_action_n()
1094 res = a; in tc_lookup_action_n()
1106 struct tc_action_ops *a, *res = NULL; in tc_lookup_action() local
1110 list_for_each_entry(a, &act_base, head) { in tc_lookup_action()
1111 if (nla_strcmp(kind, a->kind) == 0) { in tc_lookup_action()
1112 if (try_module_get(a->owner)) in tc_lookup_action()
1113 res = a; in tc_lookup_action()
1137 const struct tc_action *a = actions[i]; in tcf_action_exec() local
1145 if (tc_act_skip_sw(a->tcfa_flags)) in tcf_action_exec()
1150 ret = tc_act(skb, a, res); in tcf_action_exec()
1171 if (unlikely(!rcu_access_pointer(a->goto_chain))) { in tcf_action_exec()
1176 tcf_action_goto_chain_exec(a, res); in tcf_action_exec()
1190 struct tc_action *a; in tcf_action_destroy() local
1193 tcf_act_for_each_action(i, a, actions) { in tcf_action_destroy()
1195 ops = a->ops; in tcf_action_destroy()
1196 ret = __tcf_idr_release(a, bind, true); in tcf_action_destroy()
1212 struct tc_action *a; in tcf_action_put_many() local
1215 tcf_act_for_each_action(i, a, actions) { in tcf_action_put_many()
1216 const struct tc_action_ops *ops = a->ops; in tcf_action_put_many()
1217 if (tcf_action_put(a)) in tcf_action_put_many()
1224 struct tc_action *a; in tca_put_bound_many() local
1227 tcf_act_for_each_action(i, a, actions) { in tca_put_bound_many()
1228 const struct tc_action_ops *ops = a->ops; in tca_put_bound_many()
1233 if (tcf_action_put(a)) in tca_put_bound_many()
1239 tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int bind, int ref) in tcf_action_dump_old() argument
1241 return a->ops->dump(skb, a, bind, ref); in tcf_action_dump_old()
1247 struct tc_action *a; in tcf_action_dump() local
1251 tcf_act_for_each_action(i, a, actions) { in tcf_action_dump()
1255 err = terse ? tcf_action_dump_terse(skb, a, false) : in tcf_action_dump()
1256 tcf_action_dump_1(skb, a, bind, ref); in tcf_action_dump()
1315 struct tc_action *a; in tcf_idr_insert_many() local
1318 tcf_act_for_each_action(i, a, actions) { in tcf_idr_insert_many()
1324 idrinfo = a->idrinfo; in tcf_idr_insert_many()
1327 idr_replace(&idrinfo->action_idr, a, a->tcfa_index); in tcf_idr_insert_many()
1405 struct tc_action *a; in tcf_action_init_1() local
1431 err = a_o->init(net, tb[TCA_ACT_OPTIONS], est, &a, tp, in tcf_action_init_1()
1434 err = a_o->init(net, nla, est, &a, tp, userflags.value | flags, in tcf_action_init_1()
1442 tcf_set_action_cookie(&a->user_cookie, user_cookie); in tcf_action_init_1()
1445 a->hw_stats = hw_stats; in tcf_action_init_1()
1447 return a; in tcf_action_init_1()
1573 void tcf_action_update_stats(struct tc_action *a, u64 bytes, u64 packets, in tcf_action_update_stats() argument
1576 if (a->cpu_bstats) { in tcf_action_update_stats()
1577 _bstats_update(this_cpu_ptr(a->cpu_bstats), bytes, packets); in tcf_action_update_stats()
1579 this_cpu_ptr(a->cpu_qstats)->drops += drops; in tcf_action_update_stats()
1582 _bstats_update(this_cpu_ptr(a->cpu_bstats_hw), in tcf_action_update_stats()
1587 _bstats_update(&a->tcfa_bstats, bytes, packets); in tcf_action_update_stats()
1588 a->tcfa_qstats.drops += drops; in tcf_action_update_stats()
1590 _bstats_update(&a->tcfa_bstats_hw, bytes, packets); in tcf_action_update_stats()
1706 struct tc_action *a; in tcf_action_get_1() local
1730 if (__tcf_idr_search(net, ops, &a, index) == 0) { in tcf_action_get_1()
1736 return a; in tcf_action_get_1()
1822 struct tc_action *a; in tcf_action_delete() local
1825 tcf_act_for_each_action(i, a, actions) { in tcf_action_delete()
1826 const struct tc_action_ops *ops = a->ops; in tcf_action_delete()
1830 struct tcf_idrinfo *idrinfo = a->idrinfo; in tcf_action_delete()
1831 u32 act_index = a->tcfa_index; in tcf_action_delete()
1834 if (tcf_action_put(a)) { in tcf_action_delete()