]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - net/sched/sch_api.c
net: Convert net_ratelimit uses to net_<level>_ratelimited
[mirror_ubuntu-zesty-kernel.git] / net / sched / sch_api.c
index 3d8981fde3019ae09130528c3f08e4d632385f2f..085ce53d570a82804485dfcf758a470fca6bd51b 100644 (file)
@@ -426,7 +426,8 @@ static int qdisc_dump_stab(struct sk_buff *skb, struct qdisc_size_table *stab)
        nest = nla_nest_start(skb, TCA_STAB);
        if (nest == NULL)
                goto nla_put_failure;
-       NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts);
+       if (nla_put(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts))
+               goto nla_put_failure;
        nla_nest_end(skb, nest);
 
        return skb->len;
@@ -1201,7 +1202,8 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
        tcm->tcm_parent = clid;
        tcm->tcm_handle = q->handle;
        tcm->tcm_info = atomic_read(&q->refcnt);
-       NLA_PUT_STRING(skb, TCA_KIND, q->ops->id);
+       if (nla_put_string(skb, TCA_KIND, q->ops->id))
+               goto nla_put_failure;
        if (q->ops->dump && q->ops->dump(q, skb) < 0)
                goto nla_put_failure;
        q->qstats.qlen = q->q.qlen;
@@ -1505,7 +1507,8 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
        tcm->tcm_parent = q->handle;
        tcm->tcm_handle = q->handle;
        tcm->tcm_info = 0;
-       NLA_PUT_STRING(skb, TCA_KIND, q->ops->id);
+       if (nla_put_string(skb, TCA_KIND, q->ops->id))
+               goto nla_put_failure;
        if (cl_ops->dump && cl_ops->dump(q, cl, skb, tcm) < 0)
                goto nla_put_failure;
 
@@ -1688,12 +1691,10 @@ reclassify:
                tp = otp;
 
                if (verd++ >= MAX_REC_LOOP) {
-                       if (net_ratelimit())
-                               pr_notice("%s: packet reclassify loop"
-                                         " rule prio %u protocol %02x\n",
-                                         tp->q->ops->id,
-                                         tp->prio & 0xffff,
-                                         ntohs(tp->protocol));
+                       net_notice_ratelimited("%s: packet reclassify loop rule prio %u protocol %02x\n",
+                                              tp->q->ops->id,
+                                              tp->prio & 0xffff,
+                                              ntohs(tp->protocol));
                        return TC_ACT_SHOT;
                }
                skb->tc_verd = SET_TC_VERD(skb->tc_verd, verd);