Skip to content

Commit

Permalink
net: sched: sch: add extack for block callback
Browse files Browse the repository at this point in the history
This patch adds extack support for block callback to prepare per-qdisc
specific changes for extack.

Cc: David Ahern <[email protected]>
Acked-by: Jamal Hadi Salim <[email protected]>
Signed-off-by: Alexander Aring <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Alexander Aring authored and davem330 committed Dec 21, 2017
1 parent 793d81d commit cbaacc4
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 18 deletions.
3 changes: 2 additions & 1 deletion include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ struct Qdisc_class_ops {

/* Filter manipulation */
struct tcf_block * (*tcf_block)(struct Qdisc *sch,
unsigned long arg);
unsigned long arg,
struct netlink_ext_ack *extack);
unsigned long (*bind_tcf)(struct Qdisc *, unsigned long,
u32 classid);
void (*unbind_tcf)(struct Qdisc *, unsigned long);
Expand Down
4 changes: 2 additions & 2 deletions net/sched/cls_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
}

/* And the last stroke */
block = cops->tcf_block(q, cl);
block = cops->tcf_block(q, cl, extack);
if (!block) {
err = -EINVAL;
goto errout;
Expand Down Expand Up @@ -1040,7 +1040,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
if (cl == 0)
goto out;
}
block = cops->tcf_block(q, cl);
block = cops->tcf_block(q, cl, NULL);
if (!block)
goto out;

Expand Down
2 changes: 1 addition & 1 deletion net/sched/sch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,7 @@ static void tc_bind_tclass(struct Qdisc *q, u32 portid, u32 clid,
cl = cops->find(q, portid);
if (!cl)
return;
block = cops->tcf_block(q, cl);
block = cops->tcf_block(q, cl, NULL);
if (!block)
return;
list_for_each_entry(chain, &block->chain_list, list) {
Expand Down
3 changes: 2 additions & 1 deletion net/sched/sch_atm.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,8 @@ static void atm_tc_walk(struct Qdisc *sch, struct qdisc_walker *walker)
}
}

static struct tcf_block *atm_tc_tcf_block(struct Qdisc *sch, unsigned long cl)
static struct tcf_block *atm_tc_tcf_block(struct Qdisc *sch, unsigned long cl,
struct netlink_ext_ack *extack)
{
struct atm_qdisc_data *p = qdisc_priv(sch);
struct atm_flow_data *flow = (struct atm_flow_data *)cl;
Expand Down
3 changes: 2 additions & 1 deletion net/sched/sch_cbq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,8 @@ static int cbq_delete(struct Qdisc *sch, unsigned long arg)
return 0;
}

static struct tcf_block *cbq_tcf_block(struct Qdisc *sch, unsigned long arg)
static struct tcf_block *cbq_tcf_block(struct Qdisc *sch, unsigned long arg,
struct netlink_ext_ack *extack)
{
struct cbq_sched_data *q = qdisc_priv(sch);
struct cbq_class *cl = (struct cbq_class *)arg;
Expand Down
3 changes: 2 additions & 1 deletion net/sched/sch_drr.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ static unsigned long drr_search_class(struct Qdisc *sch, u32 classid)
return (unsigned long)drr_find_class(sch, classid);
}

static struct tcf_block *drr_tcf_block(struct Qdisc *sch, unsigned long cl)
static struct tcf_block *drr_tcf_block(struct Qdisc *sch, unsigned long cl,
struct netlink_ext_ack *extack)
{
struct drr_sched *q = qdisc_priv(sch);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/sch_dsmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ static void dsmark_walk(struct Qdisc *sch, struct qdisc_walker *walker)
}
}

static struct tcf_block *dsmark_tcf_block(struct Qdisc *sch, unsigned long cl)
static struct tcf_block *dsmark_tcf_block(struct Qdisc *sch, unsigned long cl,
struct netlink_ext_ack *extack)
{
struct dsmark_qdisc_data *p = qdisc_priv(sch);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/sch_fq_codel.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ static void fq_codel_unbind(struct Qdisc *q, unsigned long cl)
{
}

static struct tcf_block *fq_codel_tcf_block(struct Qdisc *sch, unsigned long cl)
static struct tcf_block *fq_codel_tcf_block(struct Qdisc *sch, unsigned long cl,
struct netlink_ext_ack *extack)
{
struct fq_codel_sched_data *q = qdisc_priv(sch);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/sch_hfsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,8 @@ hfsc_unbind_tcf(struct Qdisc *sch, unsigned long arg)
cl->filter_cnt--;
}

static struct tcf_block *hfsc_tcf_block(struct Qdisc *sch, unsigned long arg)
static struct tcf_block *hfsc_tcf_block(struct Qdisc *sch, unsigned long arg,
struct netlink_ext_ack *extack)
{
struct hfsc_sched *q = qdisc_priv(sch);
struct hfsc_class *cl = (struct hfsc_class *)arg;
Expand Down
3 changes: 2 additions & 1 deletion net/sched/sch_htb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
return err;
}

static struct tcf_block *htb_tcf_block(struct Qdisc *sch, unsigned long arg)
static struct tcf_block *htb_tcf_block(struct Qdisc *sch, unsigned long arg,
struct netlink_ext_ack *extack)
{
struct htb_sched *q = qdisc_priv(sch);
struct htb_class *cl = (struct htb_class *)arg;
Expand Down
6 changes: 4 additions & 2 deletions net/sched/sch_ingress.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ static void ingress_walk(struct Qdisc *sch, struct qdisc_walker *walker)
{
}

static struct tcf_block *ingress_tcf_block(struct Qdisc *sch, unsigned long cl)
static struct tcf_block *ingress_tcf_block(struct Qdisc *sch, unsigned long cl,
struct netlink_ext_ack *extack)
{
struct ingress_sched_data *q = qdisc_priv(sch);

Expand Down Expand Up @@ -154,7 +155,8 @@ static unsigned long clsact_bind_filter(struct Qdisc *sch,
return clsact_find(sch, classid);
}

static struct tcf_block *clsact_tcf_block(struct Qdisc *sch, unsigned long cl)
static struct tcf_block *clsact_tcf_block(struct Qdisc *sch, unsigned long cl,
struct netlink_ext_ack *extack)
{
struct clsact_sched_data *q = qdisc_priv(sch);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/sch_multiq.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ static void multiq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
}
}

static struct tcf_block *multiq_tcf_block(struct Qdisc *sch, unsigned long cl)
static struct tcf_block *multiq_tcf_block(struct Qdisc *sch, unsigned long cl,
struct netlink_ext_ack *extack)
{
struct multiq_sched_data *q = qdisc_priv(sch);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/sch_prio.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ static void prio_walk(struct Qdisc *sch, struct qdisc_walker *arg)
}
}

static struct tcf_block *prio_tcf_block(struct Qdisc *sch, unsigned long cl)
static struct tcf_block *prio_tcf_block(struct Qdisc *sch, unsigned long cl,
struct netlink_ext_ack *extack)
{
struct prio_sched_data *q = qdisc_priv(sch);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/sch_qfq.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,8 @@ static unsigned long qfq_search_class(struct Qdisc *sch, u32 classid)
return (unsigned long)qfq_find_class(sch, classid);
}

static struct tcf_block *qfq_tcf_block(struct Qdisc *sch, unsigned long cl)
static struct tcf_block *qfq_tcf_block(struct Qdisc *sch, unsigned long cl,
struct netlink_ext_ack *extack)
{
struct qfq_sched *q = qdisc_priv(sch);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/sch_sfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,8 @@ static void sfb_walk(struct Qdisc *sch, struct qdisc_walker *walker)
}
}

static struct tcf_block *sfb_tcf_block(struct Qdisc *sch, unsigned long cl)
static struct tcf_block *sfb_tcf_block(struct Qdisc *sch, unsigned long cl,
struct netlink_ext_ack *extack)
{
struct sfb_sched_data *q = qdisc_priv(sch);

Expand Down
3 changes: 2 additions & 1 deletion net/sched/sch_sfq.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,8 @@ static void sfq_unbind(struct Qdisc *q, unsigned long cl)
{
}

static struct tcf_block *sfq_tcf_block(struct Qdisc *sch, unsigned long cl)
static struct tcf_block *sfq_tcf_block(struct Qdisc *sch, unsigned long cl,
struct netlink_ext_ack *extack)
{
struct sfq_sched_data *q = qdisc_priv(sch);

Expand Down

0 comments on commit cbaacc4

Please sign in to comment.