Commit aaeb1dea authored by Ivan Vecera's avatar Ivan Vecera Committed by David S. Miller

net: sched: sch_api: set an error msg when qdisc_alloc_handle() fails

This patch sets an error message in extack when the number of qdisc
handles exceeds the maximum. Also the error-code ENOSPC is more
appropriate than ENOMEM in this situation.
Signed-off-by: default avatarIvan Vecera <ivecera@redhat.com>
Reported-by: default avatarLi Shuang <shuali@redhat.com>
Reviewed-by: default avatarStefano Brivio <sbrivio@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 56425638
...@@ -1201,10 +1201,12 @@ static struct Qdisc *qdisc_create(struct net_device *dev, ...@@ -1201,10 +1201,12 @@ static struct Qdisc *qdisc_create(struct net_device *dev,
} else { } else {
if (handle == 0) { if (handle == 0) {
handle = qdisc_alloc_handle(dev); handle = qdisc_alloc_handle(dev);
err = -ENOMEM; if (handle == 0) {
if (handle == 0) NL_SET_ERR_MSG(extack, "Maximum number of qdisc handles was exceeded");
err = -ENOSPC;
goto err_out3; goto err_out3;
} }
}
if (!netif_is_multiqueue(dev)) if (!netif_is_multiqueue(dev))
sch->flags |= TCQ_F_ONETXQUEUE; sch->flags |= TCQ_F_ONETXQUEUE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment