From patchwork Mon Dec 18 22:45:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 850467 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="vCZ4QWFa"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3z0x2Z1GFvz9s4s for ; Tue, 19 Dec 2017 09:45:42 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936418AbdLRWpk (ORCPT ); Mon, 18 Dec 2017 17:45:40 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:41565 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936043AbdLRWpf (ORCPT ); Mon, 18 Dec 2017 17:45:35 -0500 Received: by mail-io0-f193.google.com with SMTP id o2so11535518ioe.8 for ; Mon, 18 Dec 2017 14:45:35 -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=v0q66t5dlE9vFyivYP0dtgXQB6PM+n/4nsb1YpoE8qA=; b=vCZ4QWFaycW9daReTTwwKQRce+ta4zJ1ro3KjmrtTobMhdN48s5cpwH4XgPAu8PGeI jQzgdvKikPo+7VVDq4Mr+vFx2SjDVMmjbre6M+xg/wzGSrivRUVVoOpnkPMJEnUKbrzF GU6twTbD+peSKEyewx6GHT8xG4XVLnAehiBQAW7uAsUZuevCVTZCj4DIat5ww4s3ZfBc qxTILhNq5IB3fBQQUtkYdoO1w7vnY9/zMI5wFoy9aBDtQ4153Jg1bRLodfNPRSbSmGWI JH9wwSUJWPwJ/lF7LgPh6l+WApF1svSOTOi3GtaK0z7Z70CZBhhHCzF+58XzHFNqSQqR 1iiQ== 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=v0q66t5dlE9vFyivYP0dtgXQB6PM+n/4nsb1YpoE8qA=; b=R5JE/5sCPbNmIyALD3eSLUhc88073mivl11/b28jjWZVVnJZK/VN6GkHoHAqyHKZf4 i+qI6DB0Ru7r17d68xmEK/tT9dj//aPuXm1vTh2MIisIa0h40/PEETKvsE7ZRLYtF3iC FVhFIBcnE+C7ZiYtJDsLYsCONub3YbWjNtU4q7p8fYfZMB6QYuxxIrVe5kBMqv3ruawA HNf46eogluUZClGsHwdyAVQFOc9br7Nt7fxgt/kzFQ/Tx3w7kCgFCeip/HDQhjZRSHLU 271/SijwAB8hsH/eOAfqJJK5I6pnAQJJa77o/AAXH8mALwo5D11LfF+htXbX3uVcypNS WzDA== X-Gm-Message-State: AKGB3mJAKPKVOGbyxlBUqzlkIkycAos9zmNu5ixvYNSWiWeUS5icF3cz VgIUsA+ex3CwYKNApMgQf3vbCy2E X-Google-Smtp-Source: ACJfBou3wqxR/GteXEnjsb5RpLdieIAbUBzOmWVBki2Iks2bEvgoF7cbUI2HHwko/pMdKKnA/7KpNg== X-Received: by 10.107.161.5 with SMTP id k5mr1668191ioe.290.1513637135078; Mon, 18 Dec 2017 14:45:35 -0800 (PST) Received: from x220t.lan ([64.26.149.125]) by smtp.gmail.com with ESMTPSA id o71sm210867itb.28.2017.12.18.14.45.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 14:45:34 -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 06/14] net: sched: sch: add extack for block callback Date: Mon, 18 Dec 2017 17:45:05 -0500 Message-Id: <20171218224513.29836-7-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 block callback to prepare per-qdisc specific changes for extack. Cc: David Ahern Signed-off-by: Alexander Aring --- include/net/sch_generic.h | 3 ++- net/sched/cls_api.c | 4 ++-- net/sched/sch_api.c | 2 +- net/sched/sch_atm.c | 3 ++- net/sched/sch_cbq.c | 3 ++- net/sched/sch_drr.c | 3 ++- net/sched/sch_dsmark.c | 3 ++- net/sched/sch_fq_codel.c | 3 ++- net/sched/sch_hfsc.c | 3 ++- net/sched/sch_htb.c | 3 ++- net/sched/sch_ingress.c | 6 ++++-- net/sched/sch_multiq.c | 3 ++- net/sched/sch_prio.c | 3 ++- net/sched/sch_qfq.c | 3 ++- net/sched/sch_sfb.c | 3 ++- net/sched/sch_sfq.c | 3 ++- 16 files changed, 33 insertions(+), 18 deletions(-) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 219ad45cc4cd..280106691c58 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -164,7 +164,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); diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 5b9b8a61e8c4..446ef956a79c 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -794,7 +794,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; @@ -1041,7 +1041,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; diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 4a77b3d06f9b..273f2c1e910f 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1758,7 +1758,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) { diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index 80ada9affe81..b606a75af333 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c @@ -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; diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 8f1832df8b4f..d46048a439a6 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c @@ -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; diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c index 73b914bc47a4..44a2870f6f10 100644 --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c @@ -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); diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c index 89e433bbd590..5dc5d5216fbb 100644 --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c @@ -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); diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c index b4ca46aafb5a..06e5360c54d8 100644 --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c @@ -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); diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index 11410b0e4068..961668d657a0 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c @@ -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; diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index eb535a23a69b..79cf24468a38 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -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; diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c index c703cf3a0bed..17fa8969f7e7 100644 --- a/net/sched/sch_ingress.c +++ b/net/sched/sch_ingress.c @@ -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); @@ -153,7 +154,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); diff --git a/net/sched/sch_multiq.c b/net/sched/sch_multiq.c index a8db1dbeb04f..4bcbd3636606 100644 --- a/net/sched/sch_multiq.c +++ b/net/sched/sch_multiq.c @@ -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); diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 5f8ecbaa2610..077af4730749 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c @@ -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); diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c index 1f4a84b687d2..e77e7131e620 100644 --- a/net/sched/sch_qfq.c +++ b/net/sched/sch_qfq.c @@ -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); diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c index d70d470361be..9e01b80edfe7 100644 --- a/net/sched/sch_sfb.c +++ b/net/sched/sch_sfb.c @@ -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); diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index 3b5869c7b3f3..7a217be39f2a 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c @@ -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);