Commit 4dd78a73 authored by Maxim Mikityanskiy's avatar Maxim Mikityanskiy Committed by Jakub Kicinski

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: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ca1e4ab1
...@@ -210,7 +210,8 @@ struct Qdisc_class_ops { ...@@ -210,7 +210,8 @@ struct Qdisc_class_ops {
int (*change)(struct Qdisc *, u32, u32, int (*change)(struct Qdisc *, u32, u32,
struct nlattr **, unsigned long *, struct nlattr **, unsigned long *,
struct netlink_ext_ack *); struct netlink_ext_ack *);
int (*delete)(struct Qdisc *, unsigned long); int (*delete)(struct Qdisc *, unsigned long,
struct netlink_ext_ack *);
void (*walk)(struct Qdisc *, struct qdisc_walker * arg); void (*walk)(struct Qdisc *, struct qdisc_walker * arg);
/* Filter manipulation */ /* Filter manipulation */
......
...@@ -1866,7 +1866,8 @@ static int tclass_notify(struct net *net, struct sk_buff *oskb, ...@@ -1866,7 +1866,8 @@ static int tclass_notify(struct net *net, struct sk_buff *oskb,
static int tclass_del_notify(struct net *net, static int tclass_del_notify(struct net *net,
const struct Qdisc_class_ops *cops, const struct Qdisc_class_ops *cops,
struct sk_buff *oskb, struct nlmsghdr *n, struct sk_buff *oskb, struct nlmsghdr *n,
struct Qdisc *q, unsigned long cl) struct Qdisc *q, unsigned long cl,
struct netlink_ext_ack *extack)
{ {
u32 portid = oskb ? NETLINK_CB(oskb).portid : 0; u32 portid = oskb ? NETLINK_CB(oskb).portid : 0;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -1885,7 +1886,7 @@ static int tclass_del_notify(struct net *net, ...@@ -1885,7 +1886,7 @@ static int tclass_del_notify(struct net *net,
return -EINVAL; return -EINVAL;
} }
err = cops->delete(q, cl); err = cops->delete(q, cl, extack);
if (err) { if (err) {
kfree_skb(skb); kfree_skb(skb);
return err; return err;
...@@ -2088,7 +2089,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, ...@@ -2088,7 +2089,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n,
goto out; goto out;
break; break;
case RTM_DELTCLASS: case RTM_DELTCLASS:
err = tclass_del_notify(net, cops, skb, n, q, cl); err = tclass_del_notify(net, cops, skb, n, q, cl, extack);
/* Unbind the class with flilters with 0 */ /* Unbind the class with flilters with 0 */
tc_bind_tclass(q, portid, clid, 0); tc_bind_tclass(q, portid, clid, 0);
goto out; goto out;
......
...@@ -320,7 +320,8 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, ...@@ -320,7 +320,8 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
return error; return error;
} }
static int atm_tc_delete(struct Qdisc *sch, unsigned long arg) static int atm_tc_delete(struct Qdisc *sch, unsigned long arg,
struct netlink_ext_ack *extack)
{ {
struct atm_qdisc_data *p = qdisc_priv(sch); struct atm_qdisc_data *p = qdisc_priv(sch);
struct atm_flow_data *flow = (struct atm_flow_data *)arg; struct atm_flow_data *flow = (struct atm_flow_data *)arg;
......
...@@ -1675,7 +1675,8 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t ...@@ -1675,7 +1675,8 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t
return err; return err;
} }
static int cbq_delete(struct Qdisc *sch, unsigned long arg) static int cbq_delete(struct Qdisc *sch, unsigned long arg,
struct netlink_ext_ack *extack)
{ {
struct cbq_sched_data *q = qdisc_priv(sch); struct cbq_sched_data *q = qdisc_priv(sch);
struct cbq_class *cl = (struct cbq_class *)arg; struct cbq_class *cl = (struct cbq_class *)arg;
......
...@@ -146,7 +146,8 @@ static void drr_destroy_class(struct Qdisc *sch, struct drr_class *cl) ...@@ -146,7 +146,8 @@ static void drr_destroy_class(struct Qdisc *sch, struct drr_class *cl)
kfree(cl); kfree(cl);
} }
static int drr_delete_class(struct Qdisc *sch, unsigned long arg) static int drr_delete_class(struct Qdisc *sch, unsigned long arg,
struct netlink_ext_ack *extack)
{ {
struct drr_sched *q = qdisc_priv(sch); struct drr_sched *q = qdisc_priv(sch);
struct drr_class *cl = (struct drr_class *)arg; struct drr_class *cl = (struct drr_class *)arg;
......
...@@ -150,7 +150,8 @@ static int dsmark_change(struct Qdisc *sch, u32 classid, u32 parent, ...@@ -150,7 +150,8 @@ static int dsmark_change(struct Qdisc *sch, u32 classid, u32 parent,
return err; return err;
} }
static int dsmark_delete(struct Qdisc *sch, unsigned long arg) static int dsmark_delete(struct Qdisc *sch, unsigned long arg,
struct netlink_ext_ack *extack)
{ {
struct dsmark_qdisc_data *p = qdisc_priv(sch); struct dsmark_qdisc_data *p = qdisc_priv(sch);
......
...@@ -1090,7 +1090,8 @@ hfsc_destroy_class(struct Qdisc *sch, struct hfsc_class *cl) ...@@ -1090,7 +1090,8 @@ hfsc_destroy_class(struct Qdisc *sch, struct hfsc_class *cl)
} }
static int static int
hfsc_delete_class(struct Qdisc *sch, unsigned long arg) hfsc_delete_class(struct Qdisc *sch, unsigned long arg,
struct netlink_ext_ack *extack)
{ {
struct hfsc_sched *q = qdisc_priv(sch); struct hfsc_sched *q = qdisc_priv(sch);
struct hfsc_class *cl = (struct hfsc_class *)arg; struct hfsc_class *cl = (struct hfsc_class *)arg;
......
...@@ -1246,7 +1246,8 @@ static void htb_destroy(struct Qdisc *sch) ...@@ -1246,7 +1246,8 @@ static void htb_destroy(struct Qdisc *sch)
__qdisc_reset_queue(&q->direct_queue); __qdisc_reset_queue(&q->direct_queue);
} }
static int htb_delete(struct Qdisc *sch, unsigned long arg) static int htb_delete(struct Qdisc *sch, unsigned long arg,
struct netlink_ext_ack *extack)
{ {
struct htb_sched *q = qdisc_priv(sch); struct htb_sched *q = qdisc_priv(sch);
struct htb_class *cl = (struct htb_class *)arg; struct htb_class *cl = (struct htb_class *)arg;
......
...@@ -529,7 +529,8 @@ static void qfq_destroy_class(struct Qdisc *sch, struct qfq_class *cl) ...@@ -529,7 +529,8 @@ static void qfq_destroy_class(struct Qdisc *sch, struct qfq_class *cl)
kfree(cl); kfree(cl);
} }
static int qfq_delete_class(struct Qdisc *sch, unsigned long arg) static int qfq_delete_class(struct Qdisc *sch, unsigned long arg,
struct netlink_ext_ack *extack)
{ {
struct qfq_sched *q = qdisc_priv(sch); struct qfq_sched *q = qdisc_priv(sch);
struct qfq_class *cl = (struct qfq_class *)arg; struct qfq_class *cl = (struct qfq_class *)arg;
......
...@@ -649,7 +649,8 @@ static int sfb_change_class(struct Qdisc *sch, u32 classid, u32 parentid, ...@@ -649,7 +649,8 @@ static int sfb_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
return -ENOSYS; return -ENOSYS;
} }
static int sfb_delete(struct Qdisc *sch, unsigned long cl) static int sfb_delete(struct Qdisc *sch, unsigned long cl,
struct netlink_ext_ack *extack)
{ {
return -ENOSYS; return -ENOSYS;
} }
......
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