Commit c69a9b02 authored by Pedro Tammela's avatar Pedro Tammela Committed by David S. Miller
Browse files

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: default avatarSimon Horman <simon.horman@corigine.com>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarPedro Tammela <pctammela@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 807cfded
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -402,8 +402,8 @@ static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
	int err;
	int delta_w;

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

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

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