提交 aaeb1dea 编写于 作者: I Ivan Vecera 提交者: 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: NIvan Vecera <ivecera@redhat.com>
Reported-by: NLi Shuang <shuali@redhat.com>
Reviewed-by: NStefano Brivio <sbrivio@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 56425638
...@@ -1201,9 +1201,11 @@ static struct Qdisc *qdisc_create(struct net_device *dev, ...@@ -1201,9 +1201,11 @@ 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册