From patchwork Wed Jan 17 22:40:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 862627 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="ouygHYft"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zMMWb4x3Wz9t66 for ; Thu, 18 Jan 2018 09:41:15 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753762AbeAQWlJ (ORCPT ); Wed, 17 Jan 2018 17:41:09 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:44055 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753394AbeAQWkq (ORCPT ); Wed, 17 Jan 2018 17:40:46 -0500 Received: by mail-io0-f196.google.com with SMTP id z6so5631150iob.11 for ; Wed, 17 Jan 2018 14:40:46 -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=6/aLyhDojCnsgrS+hmMTKRL4q5I4nnhlIOzG4Ld4/PE=; b=ouygHYftS8O4Sikl3QFYMiOxboRdF8LFmI/C4CPEykGFxZRU99BPlfOPR1VRytOTfd 0aATKqw8nKxtN563gLStfuMMr8CZ6TjeUQwg8tU3wOIEkBXspYRR+HsysgTsluEtMUUm 4GbOOHvZ8RAyrNILYapgLSQHfIM7ob5atOn0encDK7IvEhD4czyahE7/gMxru0ozxRoq VPOjyhjfqfoP4wG4uL3kajRhpcuH9sYlPp8dmd+ZirzlqEaJQ/a2BVu8JbrO7bDyrvRs h1j6lwuUKbN9eJt8ewXMeczhdwD2pY3iGzGIIzIrQTZv9K1Y/hClzPiA+zuIB+zNeknQ 31CA== 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=6/aLyhDojCnsgrS+hmMTKRL4q5I4nnhlIOzG4Ld4/PE=; b=GBp9DNw9LSusE+dLhTTFqustJdVtTJdjuIvcfm6KtbtcVaI/8lgEUcHv6NhM5gDAEF eoLyreJyN9Xv8xzsH3ErVULX/RFBQYVjRPxPdEP5IN7YQK4nEvo2mdB2bViaw6Nw15T1 s7BJE/ZCB+HyPEfek6uV0wgtICkLx+vw+7Y5voo6/sUEqugt83MDlt+jUYg3pd8Reyxe gSI4NLIHAuiAdCoYz+wsqVUzu6eqZ47UROCOGOmuRmoFP96NVryY0458++EAyUCKfFId t3N/q/SxqIqvhAAodITpAqA6p2pu7rbguQqVHApLH4wGFgtKUbpRgvFwODTh3/S2TLFu hcAQ== X-Gm-Message-State: AKwxytfiqpaJtpSuPf63M/U8geIWygH5Tg2iBvbaIgUo5zCQf7nCARgU Fg4d9qrZJ14U8qmYOxtwH8TJmw== X-Google-Smtp-Source: ACJfBosTYgHuZD8Bc7+wC3/MhETRWmf/PJifjPOGxPIsxvg+jfw7cxYo0baT124c3qQfP5/sdWXUCg== X-Received: by 10.107.19.149 with SMTP id 21mr17729237iot.109.1516228845723; Wed, 17 Jan 2018 14:40:45 -0800 (PST) Received: from x220t.lan ([64.26.149.125]) by smtp.gmail.com with ESMTPSA id p68sm2908729itc.26.2018.01.17.14.40.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jan 2018 14:40:44 -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, kubakici@wp.pl, Alexander Aring , David Ahern Subject: [PATCHv2 net-next 5/8] net: sched: cls: add extack support for delete callback Date: Wed, 17 Jan 2018 17:40:24 -0500 Message-Id: <20180117224027.24049-6-aring@mojatatu.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180117224027.24049-1-aring@mojatatu.com> References: <20180117224027.24049-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 classifier delete callback api. This prepares to handle extack support inside each specific classifier implementation. Cc: David Ahern Signed-off-by: Alexander Aring --- include/net/sch_generic.h | 3 ++- net/sched/cls_api.c | 2 +- net/sched/cls_basic.c | 3 ++- net/sched/cls_bpf.c | 3 ++- net/sched/cls_cgroup.c | 3 ++- net/sched/cls_flow.c | 3 ++- net/sched/cls_flower.c | 3 ++- net/sched/cls_fw.c | 3 ++- net/sched/cls_matchall.c | 3 ++- net/sched/cls_route.c | 3 ++- net/sched/cls_rsvp.h | 3 ++- net/sched/cls_tcindex.c | 5 +++-- net/sched/cls_u32.c | 3 ++- 13 files changed, 26 insertions(+), 14 deletions(-) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index ee398bcd46e7..cd1be1f25c36 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -242,7 +242,8 @@ struct tcf_proto_ops { void **, bool, struct netlink_ext_ack *); int (*delete)(struct tcf_proto *tp, void *arg, - bool *last); + bool *last, + struct netlink_ext_ack *); void (*walk)(struct tcf_proto*, struct tcf_walker *arg); void (*bind_class)(void *, u32, unsigned long); diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index f71192a5987c..9f88107c29c5 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -955,7 +955,7 @@ static int tfilter_del_notify(struct net *net, struct sk_buff *oskb, return -EINVAL; } - err = tp->ops->delete(tp, fh, last); + err = tp->ops->delete(tp, fh, last, extack); if (err) { kfree_skb(skb); return err; diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c index b7bcf67641bf..6088be65d167 100644 --- a/net/sched/cls_basic.c +++ b/net/sched/cls_basic.c @@ -130,7 +130,8 @@ static void basic_destroy(struct tcf_proto *tp) kfree_rcu(head, rcu); } -static int basic_delete(struct tcf_proto *tp, void *arg, bool *last) +static int basic_delete(struct tcf_proto *tp, void *arg, bool *last, + struct netlink_ext_ack *extack) { struct basic_head *head = rtnl_dereference(tp->root); struct basic_filter *f = arg; diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c index c86072779b0a..fc024fc3ec2f 100644 --- a/net/sched/cls_bpf.c +++ b/net/sched/cls_bpf.c @@ -295,7 +295,8 @@ static void __cls_bpf_delete(struct tcf_proto *tp, struct cls_bpf_prog *prog) __cls_bpf_delete_prog(prog); } -static int cls_bpf_delete(struct tcf_proto *tp, void *arg, bool *last) +static int cls_bpf_delete(struct tcf_proto *tp, void *arg, bool *last, + struct netlink_ext_ack *extack) { struct cls_bpf_head *head = rtnl_dereference(tp->root); diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index aaafcf6965f7..1b54fbfca414 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c @@ -156,7 +156,8 @@ static void cls_cgroup_destroy(struct tcf_proto *tp) } } -static int cls_cgroup_delete(struct tcf_proto *tp, void *arg, bool *last) +static int cls_cgroup_delete(struct tcf_proto *tp, void *arg, bool *last, + struct netlink_ext_ack *extack) { return -EOPNOTSUPP; } diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c index 07816133cbb9..64c24b488058 100644 --- a/net/sched/cls_flow.c +++ b/net/sched/cls_flow.c @@ -575,7 +575,8 @@ static int flow_change(struct net *net, struct sk_buff *in_skb, return err; } -static int flow_delete(struct tcf_proto *tp, void *arg, bool *last) +static int flow_delete(struct tcf_proto *tp, void *arg, bool *last, + struct netlink_ext_ack *extack) { struct flow_head *head = rtnl_dereference(tp->root); struct flow_filter *f = arg; diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 8235ed9143c4..50145b873ff1 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -985,7 +985,8 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, return err; } -static int fl_delete(struct tcf_proto *tp, void *arg, bool *last) +static int fl_delete(struct tcf_proto *tp, void *arg, bool *last, + struct netlink_ext_ack *extack) { struct cls_fl_head *head = rtnl_dereference(tp->root); struct cls_fl_filter *f = arg; diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c index 72a924a38753..bd21ed83eb07 100644 --- a/net/sched/cls_fw.c +++ b/net/sched/cls_fw.c @@ -172,7 +172,8 @@ static void fw_destroy(struct tcf_proto *tp) kfree_rcu(head, rcu); } -static int fw_delete(struct tcf_proto *tp, void *arg, bool *last) +static int fw_delete(struct tcf_proto *tp, void *arg, bool *last, + struct netlink_ext_ack *extack) { struct fw_head *head = rtnl_dereference(tp->root); struct fw_filter *f = arg; diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c index 9a0901ee6b74..f67d3d7fcf40 100644 --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c @@ -225,7 +225,8 @@ static int mall_change(struct net *net, struct sk_buff *in_skb, return err; } -static int mall_delete(struct tcf_proto *tp, void *arg, bool *last) +static int mall_delete(struct tcf_proto *tp, void *arg, bool *last, + struct netlink_ext_ack *extack) { return -EOPNOTSUPP; } diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index 92d683851cb0..55467c30d524 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c @@ -316,7 +316,8 @@ static void route4_destroy(struct tcf_proto *tp) kfree_rcu(head, rcu); } -static int route4_delete(struct tcf_proto *tp, void *arg, bool *last) +static int route4_delete(struct tcf_proto *tp, void *arg, bool *last, + struct netlink_ext_ack *extack) { struct route4_head *head = rtnl_dereference(tp->root); struct route4_filter *f = arg; diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h index c27d23694002..5cc0df690cff 100644 --- a/net/sched/cls_rsvp.h +++ b/net/sched/cls_rsvp.h @@ -350,7 +350,8 @@ static void rsvp_destroy(struct tcf_proto *tp) kfree_rcu(data, rcu); } -static int rsvp_delete(struct tcf_proto *tp, void *arg, bool *last) +static int rsvp_delete(struct tcf_proto *tp, void *arg, bool *last, + struct netlink_ext_ack *extack) { struct rsvp_head *head = rtnl_dereference(tp->root); struct rsvp_filter *nfp, *f = arg; diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c index 9d6621caa92f..01a163e0b6aa 100644 --- a/net/sched/cls_tcindex.c +++ b/net/sched/cls_tcindex.c @@ -193,7 +193,8 @@ static void tcindex_destroy_fexts(struct rcu_head *head) tcf_queue_work(&f->work); } -static int tcindex_delete(struct tcf_proto *tp, void *arg, bool *last) +static int tcindex_delete(struct tcf_proto *tp, void *arg, bool *last, + struct netlink_ext_ack *extack) { struct tcindex_data *p = rtnl_dereference(tp->root); struct tcindex_filter_result *r = arg; @@ -246,7 +247,7 @@ static int tcindex_destroy_element(struct tcf_proto *tp, { bool last; - return tcindex_delete(tp, arg, &last); + return tcindex_delete(tp, arg, &last, NULL); } static void __tcindex_destroy(struct rcu_head *head) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 933058bbd0a9..7f772da8e627 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -672,7 +672,8 @@ static void u32_destroy(struct tcf_proto *tp) tp->data = NULL; } -static int u32_delete(struct tcf_proto *tp, void *arg, bool *last) +static int u32_delete(struct tcf_proto *tp, void *arg, bool *last, + struct netlink_ext_ack *extack) { struct tc_u_hnode *ht = arg; struct tc_u_hnode *root_ht = rtnl_dereference(tp->root);