• Home
  • Raw
  • Download

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
208 (tp = rtnl_dereference(*back)) != NULL; in tc_ctl_tfilter()
209 back = &tp->next) { in tc_ctl_tfilter()
210 if (tp->prio >= prio) { in tc_ctl_tfilter()
211 if (tp->prio == prio) { in tc_ctl_tfilter()
213 (tp->protocol != protocol && protocol)) in tc_ctl_tfilter()
216 tp = NULL; in tc_ctl_tfilter()
221 if (tp == NULL) { in tc_ctl_tfilter()
236 tp = kzalloc(sizeof(*tp), GFP_KERNEL); in tc_ctl_tfilter()
237 if (tp == NULL) in tc_ctl_tfilter()
264 kfree(tp); in tc_ctl_tfilter()
267 tp->ops = tp_ops; in tc_ctl_tfilter()
268 tp->protocol = protocol; in tc_ctl_tfilter()
269 tp->prio = nprio ? : in tc_ctl_tfilter()
271 tp->q = q; in tc_ctl_tfilter()
272 tp->classify = tp_ops->classify; in tc_ctl_tfilter()
273 tp->classid = parent; in tc_ctl_tfilter()
275 err = tp_ops->init(tp); in tc_ctl_tfilter()
278 kfree(tp); in tc_ctl_tfilter()
284 } else if (tca[TCA_KIND] && nla_strcmp(tca[TCA_KIND], tp->ops->kind)) in tc_ctl_tfilter()
287 fh = tp->ops->get(tp, t->tcm_handle); in tc_ctl_tfilter()
291 struct tcf_proto *next = rtnl_dereference(tp->next); in tc_ctl_tfilter()
295 tfilter_notify(net, skb, n, tp, fh, RTM_DELTFILTER); in tc_ctl_tfilter()
296 tcf_destroy(tp, true); in tc_ctl_tfilter()
311 tcf_destroy(tp, true); in tc_ctl_tfilter()
316 err = tp->ops->delete(tp, fh); in tc_ctl_tfilter()
318 struct tcf_proto *next = rtnl_dereference(tp->next); in tc_ctl_tfilter()
320 tfilter_notify(net, skb, n, tp, in tc_ctl_tfilter()
322 if (tcf_destroy(tp, false)) in tc_ctl_tfilter()
327 err = tfilter_notify(net, skb, n, tp, fh, RTM_NEWTFILTER); in tc_ctl_tfilter()
335 err = tp->ops->change(net, skb, tp, cl, t->tcm_handle, tca, &fh, in tc_ctl_tfilter()
339 RCU_INIT_POINTER(tp->next, rtnl_dereference(*back)); in tc_ctl_tfilter()
340 rcu_assign_pointer(*back, tp); in tc_ctl_tfilter()
342 tfilter_notify(net, skb, n, tp, fh, RTM_NEWTFILTER); in tc_ctl_tfilter()
345 tcf_destroy(tp, true); in tc_ctl_tfilter()
357 static int tcf_fill_node(struct net *net, struct sk_buff *skb, struct tcf_proto *tp, in tcf_fill_node() argument
371 tcm->tcm_ifindex = qdisc_dev(tp->q)->ifindex; in tcf_fill_node()
372 tcm->tcm_parent = tp->classid; in tcf_fill_node()
373 tcm->tcm_info = TC_H_MAKE(tp->prio, tp->protocol); in tcf_fill_node()
374 if (nla_put_string(skb, TCA_KIND, tp->ops->kind)) in tcf_fill_node()
379 if (tp->ops->dump && tp->ops->dump(net, tp, fh, skb, tcm) < 0) in tcf_fill_node()
392 struct nlmsghdr *n, struct tcf_proto *tp, in tfilter_notify() argument
402 if (tcf_fill_node(net, skb, tp, fh, portid, n->nlmsg_seq, 0, event) <= 0) { in tfilter_notify()
417 static int tcf_node_dump(struct tcf_proto *tp, unsigned long n, in tcf_node_dump() argument
423 return tcf_fill_node(net, a->skb, tp, n, NETLINK_CB(a->cb->skb).portid, in tcf_node_dump()
435 struct tcf_proto *tp, __rcu **chain; in tc_dump_tfilter() local
469 for (tp = rtnl_dereference(*chain), t = 0; in tc_dump_tfilter()
470 tp; tp = rtnl_dereference(tp->next), t++) { in tc_dump_tfilter()
474 TC_H_MAJ(tcm->tcm_info) != tp->prio) in tc_dump_tfilter()
477 TC_H_MIN(tcm->tcm_info) != tp->protocol) in tc_dump_tfilter()
482 if (tcf_fill_node(net, skb, tp, 0, NETLINK_CB(cb->skb).portid, in tc_dump_tfilter()
489 if (tp->ops->walk == NULL) in tc_dump_tfilter()
497 tp->ops->walk(tp, &arg.w); in tc_dump_tfilter()
521 int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb, in tcf_exts_validate() argument
557 void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, in tcf_exts_change() argument
562 tcf_tree_lock(tp); in tcf_exts_change()
566 tcf_tree_unlock(tp); in tcf_exts_change()