Skip to content

Commit 807cfde

Browse files
tammeladavem330
authored andcommitted
net/sched: sch_htb: use extack on errors messages
Some error messages are still being printed to dmesg. Since extack is available, provide error messages there. Reviewed-by: Simon Horman <simon.horman@corigine.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent fadfc57 commit 807cfde

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

net/sched/sch_htb.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
17861786
goto failure;
17871787

17881788
err = nla_parse_nested_deprecated(tb, TCA_HTB_MAX, opt, htb_policy,
1789-
NULL);
1789+
extack);
17901790
if (err < 0)
17911791
goto failure;
17921792

@@ -1858,7 +1858,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
18581858

18591859
/* check maximal depth */
18601860
if (parent && parent->parent && parent->parent->level < 2) {
1861-
pr_err("htb: tree is too deep\n");
1861+
NL_SET_ERR_MSG_MOD(extack, "tree is too deep");
18621862
goto failure;
18631863
}
18641864
err = -ENOBUFS;
@@ -1917,8 +1917,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
19171917
};
19181918
err = htb_offload(dev, &offload_opt);
19191919
if (err) {
1920-
pr_err("htb: TC_HTB_LEAF_ALLOC_QUEUE failed with err = %d\n",
1921-
err);
1920+
NL_SET_ERR_MSG_WEAK(extack,
1921+
"Failed to offload TC_HTB_LEAF_ALLOC_QUEUE");
19221922
goto err_kill_estimator;
19231923
}
19241924
dev_queue = netdev_get_tx_queue(dev, offload_opt.qid);
@@ -1937,8 +1937,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
19371937
};
19381938
err = htb_offload(dev, &offload_opt);
19391939
if (err) {
1940-
pr_err("htb: TC_HTB_LEAF_TO_INNER failed with err = %d\n",
1941-
err);
1940+
NL_SET_ERR_MSG_WEAK(extack,
1941+
"Failed to offload TC_HTB_LEAF_TO_INNER");
19421942
htb_graft_helper(dev_queue, old_q);
19431943
goto err_kill_estimator;
19441944
}
@@ -2067,8 +2067,9 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
20672067
qdisc_put(parent_qdisc);
20682068

20692069
if (warn)
2070-
pr_warn("HTB: quantum of class %X is %s. Consider r2q change.\n",
2071-
cl->common.classid, (warn == -1 ? "small" : "big"));
2070+
NL_SET_ERR_MSG_FMT_MOD(extack,
2071+
"quantum of class %X is %s. Consider r2q change.",
2072+
cl->common.classid, (warn == -1 ? "small" : "big"));
20722073

20732074
qdisc_class_hash_grow(sch, &q->clhash);
20742075

0 commit comments

Comments
 (0)