Skip to content

Commit c69a9b0

Browse files
tammeladavem330
authored andcommitted
net/sched: sch_qfq: 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 807cfde commit c69a9b0

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

net/sched/sch_qfq.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
402402
int err;
403403
int delta_w;
404404

405-
if (tca[TCA_OPTIONS] == NULL) {
406-
pr_notice("qfq: no options\n");
405+
if (NL_REQ_ATTR_CHECK(extack, NULL, tca, TCA_OPTIONS)) {
406+
NL_SET_ERR_MSG_MOD(extack, "missing options");
407407
return -EINVAL;
408408
}
409409

@@ -442,8 +442,9 @@ static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
442442
delta_w = weight - (cl ? cl->agg->class_weight : 0);
443443

444444
if (q->wsum + delta_w > QFQ_MAX_WSUM) {
445-
pr_notice("qfq: total weight out of range (%d + %u)\n",
446-
delta_w, q->wsum);
445+
NL_SET_ERR_MSG_FMT_MOD(extack,
446+
"total weight out of range (%d + %u)\n",
447+
delta_w, q->wsum);
447448
return -EINVAL;
448449
}
449450

0 commit comments

Comments
 (0)