Lines Matching refs:n
666 static struct hlist_head *qdisc_class_hash_alloc(unsigned int n) in qdisc_class_hash_alloc() argument
671 h = kvmalloc_array(n, sizeof(struct hlist_head), GFP_KERNEL); in qdisc_class_hash_alloc()
674 for (i = 0; i < n; i++) in qdisc_class_hash_alloc()
776 void qdisc_tree_reduce_backlog(struct Qdisc *sch, int n, int len) in qdisc_tree_reduce_backlog() argument
784 drops = max_t(int, n, 0); in qdisc_tree_reduce_backlog()
808 sch->q.qlen -= n; in qdisc_tree_reduce_backlog()
993 struct nlmsghdr *n, u32 clid, struct Qdisc *q, in qdisc_get_notify() argument
1004 if (tc_fill_qdisc(skb, q, clid, portid, n->nlmsg_seq, 0, in qdisc_get_notify()
1011 n->nlmsg_flags & NLM_F_ECHO); in qdisc_get_notify()
1019 struct nlmsghdr *n, u32 clid, in qdisc_notify() argument
1026 if (!rtnl_notify_needed(net, n->nlmsg_flags, RTNLGRP_TC)) in qdisc_notify()
1034 if (tc_fill_qdisc(skb, old, clid, portid, n->nlmsg_seq, in qdisc_notify()
1039 if (tc_fill_qdisc(skb, new, clid, portid, n->nlmsg_seq, in qdisc_notify()
1046 n->nlmsg_flags & NLM_F_ECHO); in qdisc_notify()
1054 struct nlmsghdr *n, u32 clid, in notify_and_destroy() argument
1059 qdisc_notify(net, skb, n, clid, old, new, extack); in notify_and_destroy()
1088 struct sk_buff *skb, struct nlmsghdr *n, u32 classid, in qdisc_graft() argument
1146 qdisc_notify(net, skb, n, classid, old, new, extack); in qdisc_graft()
1159 notify_and_destroy(net, skb, n, classid, old, new, extack); in qdisc_graft()
1199 notify_and_destroy(net, skb, n, classid, old, new, extack); in qdisc_graft()
1467 static int __tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, in __tc_get_qdisc() argument
1519 if (n->nlmsg_type == RTM_DELQDISC) { in __tc_get_qdisc()
1528 err = qdisc_graft(dev, p, skb, n, clid, NULL, q, extack); in __tc_get_qdisc()
1532 qdisc_get_notify(net, skb, n, clid, q, NULL); in __tc_get_qdisc()
1537 static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, in tc_get_qdisc() argument
1541 struct tcmsg *tcm = nlmsg_data(n); in tc_get_qdisc()
1546 err = nlmsg_parse_deprecated(n, sizeof(*tcm), tca, TCA_MAX, in tc_get_qdisc()
1556 err = __tc_get_qdisc(skb, n, extack, dev, tca, tcm); in tc_get_qdisc()
1562 static bool req_create_or_replace(struct nlmsghdr *n) in req_create_or_replace() argument
1564 return (n->nlmsg_flags & NLM_F_CREATE && in req_create_or_replace()
1565 n->nlmsg_flags & NLM_F_REPLACE); in req_create_or_replace()
1568 static bool req_create_exclusive(struct nlmsghdr *n) in req_create_exclusive() argument
1570 return (n->nlmsg_flags & NLM_F_CREATE && in req_create_exclusive()
1571 n->nlmsg_flags & NLM_F_EXCL); in req_create_exclusive()
1574 static bool req_change(struct nlmsghdr *n) in req_change() argument
1576 return (!(n->nlmsg_flags & NLM_F_CREATE) && in req_change()
1577 !(n->nlmsg_flags & NLM_F_REPLACE) && in req_change()
1578 !(n->nlmsg_flags & NLM_F_EXCL)); in req_change()
1581 static int __tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, in __tc_modify_qdisc() argument
1618 if (q && !(n->nlmsg_flags & NLM_F_REPLACE)) { in __tc_modify_qdisc()
1633 if (n->nlmsg_flags & NLM_F_EXCL) { in __tc_modify_qdisc()
1689 if (req_create_or_replace(n) || in __tc_modify_qdisc()
1690 req_create_exclusive(n)) in __tc_modify_qdisc()
1692 else if (req_change(n)) in __tc_modify_qdisc()
1710 if (n->nlmsg_flags & NLM_F_EXCL) { in __tc_modify_qdisc()
1720 qdisc_notify(sock_net(skb->sk), skb, n, clid, NULL, q, extack); in __tc_modify_qdisc()
1724 if (!(n->nlmsg_flags & NLM_F_CREATE)) { in __tc_modify_qdisc()
1756 err = qdisc_graft(dev, p, skb, n, clid, q, NULL, extack); in __tc_modify_qdisc()
1790 static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, in tc_modify_qdisc() argument
1799 err = nlmsg_parse_deprecated(n, sizeof(*tcm), tca, TCA_MAX, in tc_modify_qdisc()
1806 tcm = nlmsg_data(n); in tc_modify_qdisc()
1812 err = __tc_modify_qdisc(skb, n, extack, dev, tca, tcm); in tc_modify_qdisc()
1989 struct nlmsghdr *n, struct Qdisc *q, in tclass_notify() argument
1995 if (!rtnl_notify_needed(net, n->nlmsg_flags, RTNLGRP_TC)) in tclass_notify()
2002 if (tc_fill_tclass(skb, q, cl, portid, n->nlmsg_seq, 0, event, extack) < 0) { in tclass_notify()
2008 n->nlmsg_flags & NLM_F_ECHO); in tclass_notify()
2012 struct nlmsghdr *n, struct Qdisc *q, in tclass_get_notify() argument
2022 if (tc_fill_tclass(skb, q, cl, portid, n->nlmsg_seq, 0, RTM_NEWTCLASS, in tclass_get_notify()
2029 n->nlmsg_flags & NLM_F_ECHO); in tclass_get_notify()
2034 struct sk_buff *oskb, struct nlmsghdr *n, in tclass_del_notify() argument
2045 if (rtnl_notify_needed(net, n->nlmsg_flags, RTNLGRP_TC)) { in tclass_del_notify()
2050 if (tc_fill_tclass(skb, q, cl, portid, n->nlmsg_seq, 0, in tclass_del_notify()
2066 n->nlmsg_flags & NLM_F_ECHO); in tclass_del_notify()
2079 static int tcf_node_bind(struct tcf_proto *tp, void *n, struct tcf_walker *arg) in tcf_node_bind() argument
2083 if (n && tp->ops->bind_class) { in tcf_node_bind()
2087 tp->ops->bind_class(n, a->classid, a->cl, q, a->base); in tcf_node_bind()
2155 static int __tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, in __tc_ctl_tclass() argument
2236 if (n->nlmsg_type != RTM_NEWTCLASS || in __tc_ctl_tclass()
2237 !(n->nlmsg_flags & NLM_F_CREATE)) in __tc_ctl_tclass()
2240 switch (n->nlmsg_type) { in __tc_ctl_tclass()
2243 if (n->nlmsg_flags & NLM_F_EXCL) in __tc_ctl_tclass()
2247 err = tclass_del_notify(net, cops, skb, n, q, cl, extack); in __tc_ctl_tclass()
2252 err = tclass_get_notify(net, skb, n, q, cl, extack); in __tc_ctl_tclass()
2276 tclass_notify(net, skb, n, q, new_cl, RTM_NEWTCLASS, extack); in __tc_ctl_tclass()
2285 static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, in tc_ctl_tclass() argument
2289 struct tcmsg *tcm = nlmsg_data(n); in tc_ctl_tclass()
2294 err = nlmsg_parse_deprecated(n, sizeof(*tcm), tca, TCA_MAX, in tc_ctl_tclass()
2304 err = __tc_ctl_tclass(skb, n, extack, dev, tca, tcm); in tc_ctl_tclass()