Lines Matching refs:tp
103 struct nlmsghdr *n, struct tcf_proto *tp,
109 static inline u32 tcf_auto_prio(struct tcf_proto *tp) in tcf_auto_prio() argument
113 if (tp) in tcf_auto_prio()
114 first = tp->prio - 1; in tcf_auto_prio()
134 struct tcf_proto *tp; in tc_ctl_tfilter() local
206 (tp = rtnl_dereference(*back)) != NULL; in tc_ctl_tfilter()
207 back = &tp->next) { in tc_ctl_tfilter()
208 if (tp->prio >= prio) { in tc_ctl_tfilter()
209 if (tp->prio == prio) { in tc_ctl_tfilter()
211 (tp->protocol != protocol && protocol)) in tc_ctl_tfilter()
214 tp = NULL; in tc_ctl_tfilter()
219 if (tp == NULL) { in tc_ctl_tfilter()
234 tp = kzalloc(sizeof(*tp), GFP_KERNEL); in tc_ctl_tfilter()
235 if (tp == NULL) in tc_ctl_tfilter()
262 kfree(tp); in tc_ctl_tfilter()
265 tp->ops = tp_ops; in tc_ctl_tfilter()
266 tp->protocol = protocol; in tc_ctl_tfilter()
267 tp->prio = nprio ? : in tc_ctl_tfilter()
269 tp->q = q; in tc_ctl_tfilter()
270 tp->classify = tp_ops->classify; in tc_ctl_tfilter()
271 tp->classid = parent; in tc_ctl_tfilter()
273 err = tp_ops->init(tp); in tc_ctl_tfilter()
276 kfree(tp); in tc_ctl_tfilter()
282 } else if (tca[TCA_KIND] && nla_strcmp(tca[TCA_KIND], tp->ops->kind)) in tc_ctl_tfilter()
285 fh = tp->ops->get(tp, t->tcm_handle); in tc_ctl_tfilter()
289 struct tcf_proto *next = rtnl_dereference(tp->next); in tc_ctl_tfilter()
293 tfilter_notify(net, skb, n, tp, fh, RTM_DELTFILTER); in tc_ctl_tfilter()
294 tcf_destroy(tp, true); in tc_ctl_tfilter()
309 tcf_destroy(tp, true); in tc_ctl_tfilter()
314 err = tp->ops->delete(tp, fh); in tc_ctl_tfilter()
316 struct tcf_proto *next = rtnl_dereference(tp->next); in tc_ctl_tfilter()
318 tfilter_notify(net, skb, n, tp, fh, RTM_DELTFILTER); in tc_ctl_tfilter()
319 if (tcf_destroy(tp, false)) in tc_ctl_tfilter()
324 err = tfilter_notify(net, skb, n, tp, fh, RTM_NEWTFILTER); in tc_ctl_tfilter()
332 err = tp->ops->change(net, skb, tp, cl, t->tcm_handle, tca, &fh, in tc_ctl_tfilter()
336 RCU_INIT_POINTER(tp->next, rtnl_dereference(*back)); in tc_ctl_tfilter()
337 rcu_assign_pointer(*back, tp); in tc_ctl_tfilter()
339 tfilter_notify(net, skb, n, tp, fh, RTM_NEWTFILTER); in tc_ctl_tfilter()
342 tcf_destroy(tp, true); in tc_ctl_tfilter()
354 static int tcf_fill_node(struct net *net, struct sk_buff *skb, struct tcf_proto *tp, in tcf_fill_node() argument
368 tcm->tcm_ifindex = qdisc_dev(tp->q)->ifindex; in tcf_fill_node()
369 tcm->tcm_parent = tp->classid; in tcf_fill_node()
370 tcm->tcm_info = TC_H_MAKE(tp->prio, tp->protocol); in tcf_fill_node()
371 if (nla_put_string(skb, TCA_KIND, tp->ops->kind)) in tcf_fill_node()
376 if (tp->ops->dump && tp->ops->dump(net, tp, fh, skb, tcm) < 0) in tcf_fill_node()
389 struct nlmsghdr *n, struct tcf_proto *tp, in tfilter_notify() argument
399 if (tcf_fill_node(net, skb, tp, fh, portid, n->nlmsg_seq, 0, event) <= 0) { in tfilter_notify()
414 static int tcf_node_dump(struct tcf_proto *tp, unsigned long n, in tcf_node_dump() argument
420 return tcf_fill_node(net, a->skb, tp, n, NETLINK_CB(a->cb->skb).portid, in tcf_node_dump()
432 struct tcf_proto *tp, __rcu **chain; in tc_dump_tfilter() local
466 for (tp = rtnl_dereference(*chain), t = 0; in tc_dump_tfilter()
467 tp; tp = rtnl_dereference(tp->next), t++) { in tc_dump_tfilter()
471 TC_H_MAJ(tcm->tcm_info) != tp->prio) in tc_dump_tfilter()
474 TC_H_MIN(tcm->tcm_info) != tp->protocol) in tc_dump_tfilter()
479 if (tcf_fill_node(net, skb, tp, 0, NETLINK_CB(cb->skb).portid, in tc_dump_tfilter()
486 if (tp->ops->walk == NULL) in tc_dump_tfilter()
494 tp->ops->walk(tp, &arg.w); in tc_dump_tfilter()
518 int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb, in tcf_exts_validate() argument
554 void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, in tcf_exts_change() argument
559 tcf_tree_lock(tp); in tcf_exts_change()
563 tcf_tree_unlock(tp); in tcf_exts_change()