Skip to content

Commit 4dd78a7

Browse files
Maxim Mikityanskiykuba-moo
authored andcommitted
net: sched: Add extack to Qdisc_class_ops.delete
In a following commit, sch_htb will start using extack in the delete class operation to pass hardware errors in offload mode. This commit prepares for that by adding the extack parameter to this callback and converting usage of the existing qdiscs. Signed-off-by: Maxim Mikityanskiy <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ca1e4ab commit 4dd78a7

File tree

10 files changed

+22
-12
lines changed

10 files changed

+22
-12
lines changed

include/net/sch_generic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ struct Qdisc_class_ops {
210210
int (*change)(struct Qdisc *, u32, u32,
211211
struct nlattr **, unsigned long *,
212212
struct netlink_ext_ack *);
213-
int (*delete)(struct Qdisc *, unsigned long);
213+
int (*delete)(struct Qdisc *, unsigned long,
214+
struct netlink_ext_ack *);
214215
void (*walk)(struct Qdisc *, struct qdisc_walker * arg);
215216

216217
/* Filter manipulation */

net/sched/sch_api.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,7 +1866,8 @@ static int tclass_notify(struct net *net, struct sk_buff *oskb,
18661866
static int tclass_del_notify(struct net *net,
18671867
const struct Qdisc_class_ops *cops,
18681868
struct sk_buff *oskb, struct nlmsghdr *n,
1869-
struct Qdisc *q, unsigned long cl)
1869+
struct Qdisc *q, unsigned long cl,
1870+
struct netlink_ext_ack *extack)
18701871
{
18711872
u32 portid = oskb ? NETLINK_CB(oskb).portid : 0;
18721873
struct sk_buff *skb;
@@ -1885,7 +1886,7 @@ static int tclass_del_notify(struct net *net,
18851886
return -EINVAL;
18861887
}
18871888

1888-
err = cops->delete(q, cl);
1889+
err = cops->delete(q, cl, extack);
18891890
if (err) {
18901891
kfree_skb(skb);
18911892
return err;
@@ -2088,7 +2089,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n,
20882089
goto out;
20892090
break;
20902091
case RTM_DELTCLASS:
2091-
err = tclass_del_notify(net, cops, skb, n, q, cl);
2092+
err = tclass_del_notify(net, cops, skb, n, q, cl, extack);
20922093
/* Unbind the class with flilters with 0 */
20932094
tc_bind_tclass(q, portid, clid, 0);
20942095
goto out;

net/sched/sch_atm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
320320
return error;
321321
}
322322

323-
static int atm_tc_delete(struct Qdisc *sch, unsigned long arg)
323+
static int atm_tc_delete(struct Qdisc *sch, unsigned long arg,
324+
struct netlink_ext_ack *extack)
324325
{
325326
struct atm_qdisc_data *p = qdisc_priv(sch);
326327
struct atm_flow_data *flow = (struct atm_flow_data *)arg;

net/sched/sch_cbq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,8 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t
16751675
return err;
16761676
}
16771677

1678-
static int cbq_delete(struct Qdisc *sch, unsigned long arg)
1678+
static int cbq_delete(struct Qdisc *sch, unsigned long arg,
1679+
struct netlink_ext_ack *extack)
16791680
{
16801681
struct cbq_sched_data *q = qdisc_priv(sch);
16811682
struct cbq_class *cl = (struct cbq_class *)arg;

net/sched/sch_drr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ static void drr_destroy_class(struct Qdisc *sch, struct drr_class *cl)
146146
kfree(cl);
147147
}
148148

149-
static int drr_delete_class(struct Qdisc *sch, unsigned long arg)
149+
static int drr_delete_class(struct Qdisc *sch, unsigned long arg,
150+
struct netlink_ext_ack *extack)
150151
{
151152
struct drr_sched *q = qdisc_priv(sch);
152153
struct drr_class *cl = (struct drr_class *)arg;

net/sched/sch_dsmark.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ static int dsmark_change(struct Qdisc *sch, u32 classid, u32 parent,
150150
return err;
151151
}
152152

153-
static int dsmark_delete(struct Qdisc *sch, unsigned long arg)
153+
static int dsmark_delete(struct Qdisc *sch, unsigned long arg,
154+
struct netlink_ext_ack *extack)
154155
{
155156
struct dsmark_qdisc_data *p = qdisc_priv(sch);
156157

net/sched/sch_hfsc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,8 @@ hfsc_destroy_class(struct Qdisc *sch, struct hfsc_class *cl)
10901090
}
10911091

10921092
static int
1093-
hfsc_delete_class(struct Qdisc *sch, unsigned long arg)
1093+
hfsc_delete_class(struct Qdisc *sch, unsigned long arg,
1094+
struct netlink_ext_ack *extack)
10941095
{
10951096
struct hfsc_sched *q = qdisc_priv(sch);
10961097
struct hfsc_class *cl = (struct hfsc_class *)arg;

net/sched/sch_htb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,8 @@ static void htb_destroy(struct Qdisc *sch)
12461246
__qdisc_reset_queue(&q->direct_queue);
12471247
}
12481248

1249-
static int htb_delete(struct Qdisc *sch, unsigned long arg)
1249+
static int htb_delete(struct Qdisc *sch, unsigned long arg,
1250+
struct netlink_ext_ack *extack)
12501251
{
12511252
struct htb_sched *q = qdisc_priv(sch);
12521253
struct htb_class *cl = (struct htb_class *)arg;

net/sched/sch_qfq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,8 @@ static void qfq_destroy_class(struct Qdisc *sch, struct qfq_class *cl)
529529
kfree(cl);
530530
}
531531

532-
static int qfq_delete_class(struct Qdisc *sch, unsigned long arg)
532+
static int qfq_delete_class(struct Qdisc *sch, unsigned long arg,
533+
struct netlink_ext_ack *extack)
533534
{
534535
struct qfq_sched *q = qdisc_priv(sch);
535536
struct qfq_class *cl = (struct qfq_class *)arg;

net/sched/sch_sfb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,8 @@ static int sfb_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
649649
return -ENOSYS;
650650
}
651651

652-
static int sfb_delete(struct Qdisc *sch, unsigned long cl)
652+
static int sfb_delete(struct Qdisc *sch, unsigned long cl,
653+
struct netlink_ext_ack *extack)
653654
{
654655
return -ENOSYS;
655656
}

0 commit comments

Comments
 (0)