From patchwork Mon Dec 18 22:45:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 850473 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=mojatatu-com.20150623.gappssmtp.com header.i=@mojatatu-com.20150623.gappssmtp.com header.b="UAGfuw8Q"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3z0x3D2VLKz9t2M for ; Tue, 19 Dec 2017 09:46:16 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938303AbdLRWpm (ORCPT ); Mon, 18 Dec 2017 17:45:42 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:45436 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936346AbdLRWpe (ORCPT ); Mon, 18 Dec 2017 17:45:34 -0500 Received: by mail-io0-f196.google.com with SMTP id e204so11542678iof.12 for ; Mon, 18 Dec 2017 14:45:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=plIPkI+dtPml7mdGRR5eFHJ5BB7ZCzHDgF42cup1hIA=; b=UAGfuw8QYmuXBgSpTBmcil9GkTbu2XzLvGwOCXOQzUqwgLLQsmru84/3s3hJyFyHWu 2qSNnkeLVbwr+PQypDW3YuZpXulHor3yR71IVyszYVyS4EoUb2czC0R/h9UJpT4hDnVE LmGxcmoY5lR3vSJ7kJ/yNACmFEKPr2IzVPdzTypQRtNYPo67LIIA0A5vfcyJdD9Sp60a ivayiNEY9hG713hE39tELHFOD4NtdMzEfBwzf6U5HOq8P9GeCHvhkNYLlfEk5Qfw3nBL GDj08zc4yfOoif3FyIdtHhXzyWF5QJqZsEqFgVgrYsqasjJ9/fmUiK/X48Ey5RweghH4 POHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=plIPkI+dtPml7mdGRR5eFHJ5BB7ZCzHDgF42cup1hIA=; b=f+vl13jKSRam02RdQQmMhcytypNwp+/ra0zA9neBSEHszaKU4mSpmhczRK53OzKWSV UPmUTp6B9ujPInAgwcvNIFoAL99ln7iU58oQ8DrX8e40getDcDXoMIa77NSf1vTWvwJs V0iNeDYDV8utSBTlIrPWQrlvMmIId5OY2FFN9XIaP//FiwYYuEOY2TZxEfPSirtas0al hh0ByCAA82ZKG+gW5dSgoLls5+uRBk7sw5sQVF6g5kZjppama+VFl6QcCQQrynwY9Mq6 FdYbOhD1w5HYo4nDcMy0OBTtCtqZ63BptWLkF/loXTcRLXTPiSXeIqBkIlEHTN6peb/f EwXg== X-Gm-Message-State: AKGB3mK28uwimRJwSDnKvM753uRitrPRSPlBv79hsFRLxc8A1Dr/tlFe 3PW90n3QX9xihT/q39kkSOPX6Q== X-Google-Smtp-Source: ACJfBosc6mESKWTq3st3o2nhQV9QWDo+eVfkQZ0g7EEgs0W9Nu5g/ib2JptkBywY0F7ScQqTkcU/yA== X-Received: by 10.107.47.93 with SMTP id j90mr1571361ioo.262.1513637134000; Mon, 18 Dec 2017 14:45:34 -0800 (PST) Received: from x220t.lan ([64.26.149.125]) by smtp.gmail.com with ESMTPSA id o71sm210867itb.28.2017.12.18.14.45.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 14:45:33 -0800 (PST) From: Alexander Aring To: jhs@mojatatu.com Cc: xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, netdev@vger.kernel.org, kernel@mojatatu.com, Alexander Aring , David Ahern Subject: [PATCHv3 net-next 05/14] net: sched: sch: add extack to change class Date: Mon, 18 Dec 2017 17:45:04 -0500 Message-Id: <20171218224513.29836-6-aring@mojatatu.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171218224513.29836-1-aring@mojatatu.com> References: <20171218224513.29836-1-aring@mojatatu.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch adds extack support for class change callback api. This prepares to handle extack support inside each specific class implementation. Cc: David Ahern Signed-off-by: Alexander Aring --- include/net/sch_generic.h | 3 ++- net/sched/sch_api.c | 2 +- net/sched/sch_atm.c | 3 ++- net/sched/sch_cbq.c | 2 +- net/sched/sch_drr.c | 3 ++- net/sched/sch_dsmark.c | 3 ++- net/sched/sch_fq_codel.c | 2 +- net/sched/sch_hfsc.c | 3 ++- net/sched/sch_htb.c | 2 +- net/sched/sch_qfq.c | 3 ++- net/sched/sch_sfb.c | 3 ++- 11 files changed, 18 insertions(+), 11 deletions(-) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 7f35e71a478b..219ad45cc4cd 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -157,7 +157,8 @@ struct Qdisc_class_ops { /* Class manipulation routines */ unsigned long (*find)(struct Qdisc *, u32 classid); int (*change)(struct Qdisc *, u32, u32, - struct nlattr **, unsigned long *); + struct nlattr **, unsigned long *, + struct netlink_ext_ack *); int (*delete)(struct Qdisc *, unsigned long); void (*walk)(struct Qdisc *, struct qdisc_walker * arg); diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index d57dc5cd4ecf..4a77b3d06f9b 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1905,7 +1905,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, new_cl = cl; err = -EOPNOTSUPP; if (cops->change) - err = cops->change(q, clid, portid, tca, &new_cl); + err = cops->change(q, clid, portid, tca, &new_cl, extack); if (err == 0) { tclass_notify(net, skb, n, q, new_cl, RTM_NEWTCLASS); /* We just create a new class, need to do reverse binding. */ diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index 53a07687c0fb..80ada9affe81 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c @@ -191,7 +191,8 @@ static const struct nla_policy atm_policy[TCA_ATM_MAX + 1] = { }; static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, - struct nlattr **tca, unsigned long *arg) + struct nlattr **tca, unsigned long *arg, + struct netlink_ext_ack *extack) { struct atm_qdisc_data *p = qdisc_priv(sch); struct atm_flow_data *flow = (struct atm_flow_data *)*arg; diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 86eba01457f3..8f1832df8b4f 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c @@ -1452,7 +1452,7 @@ static void cbq_destroy(struct Qdisc *sch) static int cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **tca, - unsigned long *arg) + unsigned long *arg, struct netlink_ext_ack *extack) { int err; struct cbq_sched_data *q = qdisc_priv(sch); diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c index 1a88473cd768..73b914bc47a4 100644 --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c @@ -64,7 +64,8 @@ static const struct nla_policy drr_policy[TCA_DRR_MAX + 1] = { }; static int drr_change_class(struct Qdisc *sch, u32 classid, u32 parentid, - struct nlattr **tca, unsigned long *arg) + struct nlattr **tca, unsigned long *arg, + struct netlink_ext_ack *extack) { struct drr_sched *q = qdisc_priv(sch); struct drr_class *cl = (struct drr_class *)*arg; diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c index 16dd480b5583..89e433bbd590 100644 --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c @@ -112,7 +112,8 @@ static const struct nla_policy dsmark_policy[TCA_DSMARK_MAX + 1] = { }; static int dsmark_change(struct Qdisc *sch, u32 classid, u32 parent, - struct nlattr **tca, unsigned long *arg) + struct nlattr **tca, unsigned long *arg, + struct netlink_ext_ack *extack) { struct dsmark_qdisc_data *p = qdisc_priv(sch); struct nlattr *opt = tca[TCA_OPTIONS]; diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c index d798c93f7c96..b4ca46aafb5a 100644 --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c @@ -479,7 +479,7 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt, q->cparams.mtu = psched_mtu(qdisc_dev(sch)); if (opt) { - int err = fq_codel_change(sch, opt, NULL); + int err = fq_codel_change(sch, opt, extack); if (err) return err; } diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index f49a4a4fe095..11410b0e4068 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c @@ -921,7 +921,8 @@ static const struct nla_policy hfsc_policy[TCA_HFSC_MAX + 1] = { static int hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, - struct nlattr **tca, unsigned long *arg) + struct nlattr **tca, unsigned long *arg, + struct netlink_ext_ack *extack) { struct hfsc_sched *q = qdisc_priv(sch); struct hfsc_class *cl = (struct hfsc_class *)*arg; diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 41d9b7da9273..eb535a23a69b 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -1327,7 +1327,7 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg) static int htb_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **tca, - unsigned long *arg) + unsigned long *arg, struct netlink_ext_ack *extack) { int err = -EINVAL; struct htb_sched *q = qdisc_priv(sch); diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c index 7c1b976314bd..1f4a84b687d2 100644 --- a/net/sched/sch_qfq.c +++ b/net/sched/sch_qfq.c @@ -402,7 +402,8 @@ static int qfq_change_agg(struct Qdisc *sch, struct qfq_class *cl, u32 weight, } static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, - struct nlattr **tca, unsigned long *arg) + struct nlattr **tca, unsigned long *arg, + struct netlink_ext_ack *extack) { struct qfq_sched *q = qdisc_priv(sch); struct qfq_class *cl = (struct qfq_class *)*arg; diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c index 1b9d69bd6ed6..d70d470361be 100644 --- a/net/sched/sch_sfb.c +++ b/net/sched/sch_sfb.c @@ -645,7 +645,8 @@ static void sfb_unbind(struct Qdisc *sch, unsigned long arg) } static int sfb_change_class(struct Qdisc *sch, u32 classid, u32 parentid, - struct nlattr **tca, unsigned long *arg) + struct nlattr **tca, unsigned long *arg, + struct netlink_ext_ack *extack) { return -ENOSYS; }