Lines Matching refs:n
660 static struct hlist_head *qdisc_class_hash_alloc(unsigned int n) in qdisc_class_hash_alloc() argument
665 h = kvmalloc_array(n, sizeof(struct hlist_head), GFP_KERNEL); in qdisc_class_hash_alloc()
668 for (i = 0; i < n; i++) in qdisc_class_hash_alloc()
770 void qdisc_tree_reduce_backlog(struct Qdisc *sch, int n, int len) in qdisc_tree_reduce_backlog() argument
779 if (n == 0 && len == 0) in qdisc_tree_reduce_backlog()
781 drops = max_t(int, n, 0); in qdisc_tree_reduce_backlog()
798 notify = !sch->q.qlen && !WARN_ON_ONCE(!n && in qdisc_tree_reduce_backlog()
811 sch->q.qlen -= n; in qdisc_tree_reduce_backlog()
974 struct nlmsghdr *n, u32 clid, in qdisc_notify() argument
985 if (tc_fill_qdisc(skb, old, clid, portid, n->nlmsg_seq, in qdisc_notify()
990 if (tc_fill_qdisc(skb, new, clid, portid, n->nlmsg_seq, in qdisc_notify()
997 n->nlmsg_flags & NLM_F_ECHO); in qdisc_notify()
1005 struct nlmsghdr *n, u32 clid, in notify_and_destroy() argument
1009 qdisc_notify(net, skb, n, clid, old, new); in notify_and_destroy()
1038 struct sk_buff *skb, struct nlmsghdr *n, u32 classid, in qdisc_graft() argument
1089 notify_and_destroy(net, skb, n, classid, old, new); in qdisc_graft()
1094 notify_and_destroy(net, skb, n, classid, old, new); in qdisc_graft()
1125 notify_and_destroy(net, skb, n, classid, old, new); in qdisc_graft()
1435 static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, in tc_get_qdisc() argument
1439 struct tcmsg *tcm = nlmsg_data(n); in tc_get_qdisc()
1447 if ((n->nlmsg_type != RTM_GETQDISC) && in tc_get_qdisc()
1451 err = nlmsg_parse_deprecated(n, sizeof(*tcm), tca, TCA_MAX, in tc_get_qdisc()
1498 if (n->nlmsg_type == RTM_DELQDISC) { in tc_get_qdisc()
1507 err = qdisc_graft(dev, p, skb, n, clid, NULL, q, extack); in tc_get_qdisc()
1511 qdisc_notify(net, skb, n, clid, NULL, q); in tc_get_qdisc()
1516 static bool req_create_or_replace(struct nlmsghdr *n) in req_create_or_replace() argument
1518 return (n->nlmsg_flags & NLM_F_CREATE && in req_create_or_replace()
1519 n->nlmsg_flags & NLM_F_REPLACE); in req_create_or_replace()
1522 static bool req_create_exclusive(struct nlmsghdr *n) in req_create_exclusive() argument
1524 return (n->nlmsg_flags & NLM_F_CREATE && in req_create_exclusive()
1525 n->nlmsg_flags & NLM_F_EXCL); in req_create_exclusive()
1528 static bool req_change(struct nlmsghdr *n) in req_change() argument
1530 return (!(n->nlmsg_flags & NLM_F_CREATE) && in req_change()
1531 !(n->nlmsg_flags & NLM_F_REPLACE) && in req_change()
1532 !(n->nlmsg_flags & NLM_F_EXCL)); in req_change()
1538 static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, in tc_modify_qdisc() argument
1554 err = nlmsg_parse_deprecated(n, sizeof(*tcm), tca, TCA_MAX, in tc_modify_qdisc()
1559 tcm = nlmsg_data(n); in tc_modify_qdisc()
1590 if (q && !(n->nlmsg_flags & NLM_F_REPLACE)) { in tc_modify_qdisc()
1601 if (n->nlmsg_flags & NLM_F_EXCL) { in tc_modify_qdisc()
1657 if (req_create_or_replace(n) || in tc_modify_qdisc()
1658 req_create_exclusive(n)) in tc_modify_qdisc()
1660 else if (req_change(n)) in tc_modify_qdisc()
1678 if (n->nlmsg_flags & NLM_F_EXCL) { in tc_modify_qdisc()
1688 qdisc_notify(net, skb, n, clid, NULL, q); in tc_modify_qdisc()
1692 if (!(n->nlmsg_flags & NLM_F_CREATE)) { in tc_modify_qdisc()
1727 err = qdisc_graft(dev, p, skb, n, clid, q, NULL, extack); in tc_modify_qdisc()
1897 struct nlmsghdr *n, struct Qdisc *q, in tclass_notify() argument
1908 if (tc_fill_tclass(skb, q, cl, portid, n->nlmsg_seq, 0, event) < 0) { in tclass_notify()
1914 n->nlmsg_flags & NLM_F_ECHO); in tclass_notify()
1922 struct sk_buff *oskb, struct nlmsghdr *n, in tclass_del_notify() argument
1936 if (tc_fill_tclass(skb, q, cl, portid, n->nlmsg_seq, 0, in tclass_del_notify()
1949 n->nlmsg_flags & NLM_F_ECHO); in tclass_del_notify()
1964 static int tcf_node_bind(struct tcf_proto *tp, void *n, struct tcf_walker *arg) in tcf_node_bind() argument
1972 tp->ops->bind_class(n, a->classid, a->cl, q, a->base); in tcf_node_bind()
2040 static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, in tc_ctl_tclass() argument
2044 struct tcmsg *tcm = nlmsg_data(n); in tc_ctl_tclass()
2056 if ((n->nlmsg_type != RTM_GETTCLASS) && in tc_ctl_tclass()
2060 err = nlmsg_parse_deprecated(n, sizeof(*tcm), tca, TCA_MAX, in tc_ctl_tclass()
2134 if (n->nlmsg_type != RTM_NEWTCLASS || in tc_ctl_tclass()
2135 !(n->nlmsg_flags & NLM_F_CREATE)) in tc_ctl_tclass()
2138 switch (n->nlmsg_type) { in tc_ctl_tclass()
2141 if (n->nlmsg_flags & NLM_F_EXCL) in tc_ctl_tclass()
2145 err = tclass_del_notify(net, cops, skb, n, q, cl); in tc_ctl_tclass()
2150 err = tclass_notify(net, skb, n, q, cl, RTM_NEWTCLASS); in tc_ctl_tclass()
2168 tclass_notify(net, skb, n, q, new_cl, RTM_NEWTCLASS); in tc_ctl_tclass()