summaryrefslogtreecommitdiffstats
path: root/net/sched/sch_generic.c
diff options
context:
space:
mode:
authorAlexander Aring2017-12-20 18:35:20 +0100
committerDavid S. Miller2017-12-21 18:32:51 +0100
commitd0bd684dddab51ed017ece0359f26b038ec31940 (patch)
treed291b35a0e232ba4314116d8d2333b703a49af3b /net/sched/sch_generic.c
parentnet: sch: api: add extack support in tcf_block_get (diff)
downloadkernel-qcow2-linux-d0bd684dddab51ed017ece0359f26b038ec31940.tar.gz
kernel-qcow2-linux-d0bd684dddab51ed017ece0359f26b038ec31940.tar.xz
kernel-qcow2-linux-d0bd684dddab51ed017ece0359f26b038ec31940.zip
net: sch: api: add extack support in qdisc_alloc
This patch adds extack support for the function qdisc_alloc which is a common used function in the tc subsystem. Callers which are interested in the receiving error can assign extack to get a more detailed information why qdisc_alloc failed. Cc: David Ahern <dsahern@gmail.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Alexander Aring <aring@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_generic.c')
-rw-r--r--net/sched/sch_generic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 30bc38c5d7ae..34ef4366f8e0 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -755,7 +755,8 @@ static struct lock_class_key qdisc_tx_busylock;
static struct lock_class_key qdisc_running_key;
struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
- const struct Qdisc_ops *ops)
+ const struct Qdisc_ops *ops,
+ struct netlink_ext_ack *extack)
{
void *p;
struct Qdisc *sch;
@@ -764,6 +765,7 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
struct net_device *dev;
if (!dev_queue) {
+ NL_SET_ERR_MSG(extack, "No device queue given");
err = -EINVAL;
goto errout;
}
@@ -835,7 +837,7 @@ struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
if (!try_module_get(ops->owner))
return NULL;
- sch = qdisc_alloc(dev_queue, ops);
+ sch = qdisc_alloc(dev_queue, ops, NULL);
if (IS_ERR(sch)) {
module_put(ops->owner);
return NULL;