From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C400C6FA89 for ; Thu, 8 Sep 2022 04:13:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229971AbiIHENc (ORCPT ); Thu, 8 Sep 2022 00:13:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbiIHENL (ORCPT ); Thu, 8 Sep 2022 00:13:11 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A27989806; Wed, 7 Sep 2022 21:13:08 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MNQcV3QPBzmVGZ; Thu, 8 Sep 2022 12:09:30 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:05 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 01/22] net: sched: act: move global static variable net_id to tc_action_ops Date: Thu, 8 Sep 2022 12:14:33 +0800 Message-ID: <20220908041454.365070-2-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Each tc action module has a corresponding net_id, so put net_id directly into the structure tc_action_ops. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- include/net/act_api.h | 1 + net/sched/act_bpf.c | 13 ++++++------- net/sched/act_connmark.c | 13 ++++++------- net/sched/act_csum.c | 13 ++++++------- net/sched/act_ct.c | 17 ++++++++--------- net/sched/act_ctinfo.c | 13 ++++++------- net/sched/act_gact.c | 13 ++++++------- net/sched/act_gate.c | 13 ++++++------- net/sched/act_ife.c | 13 ++++++------- net/sched/act_ipt.c | 31 ++++++++++++++----------------- net/sched/act_mirred.c | 13 ++++++------- net/sched/act_mpls.c | 13 ++++++------- net/sched/act_nat.c | 13 ++++++------- net/sched/act_pedit.c | 13 ++++++------- net/sched/act_police.c | 13 ++++++------- net/sched/act_sample.c | 13 ++++++------- net/sched/act_simple.c | 13 ++++++------- net/sched/act_skbedit.c | 13 ++++++------- net/sched/act_skbmod.c | 13 ++++++------- net/sched/act_tunnel_key.c | 13 ++++++------- net/sched/act_vlan.c | 13 ++++++------- 21 files changed, 131 insertions(+), 152 deletions(-) diff --git a/include/net/act_api.h b/include/net/act_api.h index 9cf6870b526e..61f2ceb3939e 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -111,6 +111,7 @@ struct tc_action_ops { struct list_head head; char kind[IFNAMSIZ]; enum tca_id id; /* identifier should match kind */ + unsigned int net_id; size_t size; struct module *owner; int (*act)(struct sk_buff *, const struct tc_action *, diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c index fea2d78b9ddc..dd839efe9649 100644 --- a/net/sched/act_bpf.c +++ b/net/sched/act_bpf.c @@ -29,7 +29,6 @@ struct tcf_bpf_cfg { bool is_ebpf; }; =20 -static unsigned int bpf_net_id; static struct tc_action_ops act_bpf_ops; =20 static int tcf_bpf_act(struct sk_buff *skb, const struct tc_action *act, @@ -280,7 +279,7 @@ static int tcf_bpf_init(struct net *net, struct nlattr = *nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, bpf_net_id); + struct tc_action_net *tn =3D net_generic(net, act_bpf_ops.net_id); bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct nlattr *tb[TCA_ACT_BPF_MAX + 1]; struct tcf_chain *goto_ch =3D NULL; @@ -395,14 +394,14 @@ static int tcf_bpf_walker(struct net *net, struct sk_= buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, bpf_net_id); + struct tc_action_net *tn =3D net_generic(net, act_bpf_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_bpf_search(struct net *net, struct tc_action **a, u32 index) { - struct tc_action_net *tn =3D net_generic(net, bpf_net_id); + struct tc_action_net *tn =3D net_generic(net, act_bpf_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -422,20 +421,20 @@ static struct tc_action_ops act_bpf_ops __read_mostly= =3D { =20 static __net_init int bpf_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, bpf_net_id); + struct tc_action_net *tn =3D net_generic(net, act_bpf_ops.net_id); =20 return tc_action_net_init(net, tn, &act_bpf_ops); } =20 static void __net_exit bpf_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, bpf_net_id); + tc_action_net_exit(net_list, act_bpf_ops.net_id); } =20 static struct pernet_operations bpf_net_ops =3D { .init =3D bpf_init_net, .exit_batch =3D bpf_exit_net, - .id =3D &bpf_net_id, + .id =3D &act_bpf_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_connmark.c b/net/sched/act_connmark.c index 09e2aafc8943..1ea9ad187560 100644 --- a/net/sched/act_connmark.c +++ b/net/sched/act_connmark.c @@ -25,7 +25,6 @@ #include #include =20 -static unsigned int connmark_net_id; static struct tc_action_ops act_connmark_ops; =20 static int tcf_connmark_act(struct sk_buff *skb, const struct tc_action *a, @@ -99,7 +98,7 @@ static int tcf_connmark_init(struct net *net, struct nlat= tr *nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, connmark_net_id); + struct tc_action_net *tn =3D net_generic(net, act_connmark_ops.net_id); struct nlattr *tb[TCA_CONNMARK_MAX + 1]; bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct tcf_chain *goto_ch =3D NULL; @@ -205,14 +204,14 @@ static int tcf_connmark_walker(struct net *net, struc= t sk_buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, connmark_net_id); + struct tc_action_net *tn =3D net_generic(net, act_connmark_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_connmark_search(struct net *net, struct tc_action **a, u32 = index) { - struct tc_action_net *tn =3D net_generic(net, connmark_net_id); + struct tc_action_net *tn =3D net_generic(net, act_connmark_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -231,20 +230,20 @@ static struct tc_action_ops act_connmark_ops =3D { =20 static __net_init int connmark_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, connmark_net_id); + struct tc_action_net *tn =3D net_generic(net, act_connmark_ops.net_id); =20 return tc_action_net_init(net, tn, &act_connmark_ops); } =20 static void __net_exit connmark_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, connmark_net_id); + tc_action_net_exit(net_list, act_connmark_ops.net_id); } =20 static struct pernet_operations connmark_net_ops =3D { .init =3D connmark_init_net, .exit_batch =3D connmark_exit_net, - .id =3D &connmark_net_id, + .id =3D &act_connmark_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index 22847ee009ef..400f80cca40f 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c @@ -37,7 +37,6 @@ static const struct nla_policy csum_policy[TCA_CSUM_MAX += 1] =3D { [TCA_CSUM_PARMS] =3D { .len =3D sizeof(struct tc_csum), }, }; =20 -static unsigned int csum_net_id; static struct tc_action_ops act_csum_ops; =20 static int tcf_csum_init(struct net *net, struct nlattr *nla, @@ -45,7 +44,7 @@ static int tcf_csum_init(struct net *net, struct nlattr *= nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, csum_net_id); + struct tc_action_net *tn =3D net_generic(net, act_csum_ops.net_id); bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct tcf_csum_params *params_new; struct nlattr *tb[TCA_CSUM_MAX + 1]; @@ -678,14 +677,14 @@ static int tcf_csum_walker(struct net *net, struct sk= _buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, csum_net_id); + struct tc_action_net *tn =3D net_generic(net, act_csum_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_csum_search(struct net *net, struct tc_action **a, u32 inde= x) { - struct tc_action_net *tn =3D net_generic(net, csum_net_id); + struct tc_action_net *tn =3D net_generic(net, act_csum_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -731,20 +730,20 @@ static struct tc_action_ops act_csum_ops =3D { =20 static __net_init int csum_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, csum_net_id); + struct tc_action_net *tn =3D net_generic(net, act_csum_ops.net_id); =20 return tc_action_net_init(net, tn, &act_csum_ops); } =20 static void __net_exit csum_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, csum_net_id); + tc_action_net_exit(net_list, act_csum_ops.net_id); } =20 static struct pernet_operations csum_net_ops =3D { .init =3D csum_init_net, .exit_batch =3D csum_exit_net, - .id =3D &csum_net_id, + .id =3D &act_csum_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index d55afb8d14be..38b2f583106c 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -649,7 +649,6 @@ static void tcf_ct_flow_tables_uninit(void) } =20 static struct tc_action_ops act_ct_ops; -static unsigned int ct_net_id; =20 struct tc_ct_action_net { struct tc_action_net tn; /* Must be first */ @@ -1255,7 +1254,7 @@ static int tcf_ct_fill_params(struct net *net, struct nlattr **tb, struct netlink_ext_ack *extack) { - struct tc_ct_action_net *tn =3D net_generic(net, ct_net_id); + struct tc_ct_action_net *tn =3D net_generic(net, act_ct_ops.net_id); struct nf_conntrack_zone zone; struct nf_conn *tmpl; int err; @@ -1330,7 +1329,7 @@ static int tcf_ct_init(struct net *net, struct nlattr= *nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, ct_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ct_ops.net_id); bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct tcf_ct_params *params =3D NULL; struct nlattr *tb[TCA_CT_MAX + 1]; @@ -1563,14 +1562,14 @@ static int tcf_ct_walker(struct net *net, struct sk= _buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, ct_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ct_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_ct_search(struct net *net, struct tc_action **a, u32 index) { - struct tc_action_net *tn =3D net_generic(net, ct_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ct_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -1623,7 +1622,7 @@ static struct tc_action_ops act_ct_ops =3D { static __net_init int ct_init_net(struct net *net) { unsigned int n_bits =3D sizeof_field(struct tcf_ct_params, labels) * 8; - struct tc_ct_action_net *tn =3D net_generic(net, ct_net_id); + struct tc_ct_action_net *tn =3D net_generic(net, act_ct_ops.net_id); =20 if (nf_connlabels_get(net, n_bits - 1)) { tn->labels =3D false; @@ -1641,20 +1640,20 @@ static void __net_exit ct_exit_net(struct list_head= *net_list) =20 rtnl_lock(); list_for_each_entry(net, net_list, exit_list) { - struct tc_ct_action_net *tn =3D net_generic(net, ct_net_id); + struct tc_ct_action_net *tn =3D net_generic(net, act_ct_ops.net_id); =20 if (tn->labels) nf_connlabels_put(net); } rtnl_unlock(); =20 - tc_action_net_exit(net_list, ct_net_id); + tc_action_net_exit(net_list, act_ct_ops.net_id); } =20 static struct pernet_operations ct_net_ops =3D { .init =3D ct_init_net, .exit_batch =3D ct_exit_net, - .id =3D &ct_net_id, + .id =3D &act_ct_ops.net_id, .size =3D sizeof(struct tc_ct_action_net), }; =20 diff --git a/net/sched/act_ctinfo.c b/net/sched/act_ctinfo.c index 0281e45987a4..626f338c694d 100644 --- a/net/sched/act_ctinfo.c +++ b/net/sched/act_ctinfo.c @@ -25,7 +25,6 @@ #include =20 static struct tc_action_ops act_ctinfo_ops; -static unsigned int ctinfo_net_id; =20 static void tcf_ctinfo_dscp_set(struct nf_conn *ct, struct tcf_ctinfo *ca, struct tcf_ctinfo_params *cp, @@ -157,7 +156,7 @@ static int tcf_ctinfo_init(struct net *net, struct nlat= tr *nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, ctinfo_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ctinfo_ops.net_id); bool bind =3D flags & TCA_ACT_FLAGS_BIND; u32 dscpmask =3D 0, dscpstatemask, index; struct nlattr *tb[TCA_CTINFO_MAX + 1]; @@ -347,14 +346,14 @@ static int tcf_ctinfo_walker(struct net *net, struct = sk_buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, ctinfo_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ctinfo_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_ctinfo_search(struct net *net, struct tc_action **a, u32 in= dex) { - struct tc_action_net *tn =3D net_generic(net, ctinfo_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ctinfo_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -384,20 +383,20 @@ static struct tc_action_ops act_ctinfo_ops =3D { =20 static __net_init int ctinfo_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, ctinfo_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ctinfo_ops.net_id); =20 return tc_action_net_init(net, tn, &act_ctinfo_ops); } =20 static void __net_exit ctinfo_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, ctinfo_net_id); + tc_action_net_exit(net_list, act_ctinfo_ops.net_id); } =20 static struct pernet_operations ctinfo_net_ops =3D { .init =3D ctinfo_init_net, .exit_batch =3D ctinfo_exit_net, - .id =3D &ctinfo_net_id, + .id =3D &act_ctinfo_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c index ac29d1065232..ede896a7ee6b 100644 --- a/net/sched/act_gact.c +++ b/net/sched/act_gact.c @@ -19,7 +19,6 @@ #include #include =20 -static unsigned int gact_net_id; static struct tc_action_ops act_gact_ops; =20 #ifdef CONFIG_GACT_PROB @@ -55,7 +54,7 @@ static int tcf_gact_init(struct net *net, struct nlattr *= nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, gact_net_id); + struct tc_action_net *tn =3D net_generic(net, act_gact_ops.net_id); bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct nlattr *tb[TCA_GACT_MAX + 1]; struct tcf_chain *goto_ch =3D NULL; @@ -227,14 +226,14 @@ static int tcf_gact_walker(struct net *net, struct sk= _buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, gact_net_id); + struct tc_action_net *tn =3D net_generic(net, act_gact_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_gact_search(struct net *net, struct tc_action **a, u32 inde= x) { - struct tc_action_net *tn =3D net_generic(net, gact_net_id); + struct tc_action_net *tn =3D net_generic(net, act_gact_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -317,20 +316,20 @@ static struct tc_action_ops act_gact_ops =3D { =20 static __net_init int gact_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, gact_net_id); + struct tc_action_net *tn =3D net_generic(net, act_gact_ops.net_id); =20 return tc_action_net_init(net, tn, &act_gact_ops); } =20 static void __net_exit gact_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, gact_net_id); + tc_action_net_exit(net_list, act_gact_ops.net_id); } =20 static struct pernet_operations gact_net_ops =3D { .init =3D gact_init_net, .exit_batch =3D gact_exit_net, - .id =3D &gact_net_id, + .id =3D &act_gact_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_gate.c b/net/sched/act_gate.c index fd5155274733..1b528550eb22 100644 --- a/net/sched/act_gate.c +++ b/net/sched/act_gate.c @@ -15,7 +15,6 @@ #include #include =20 -static unsigned int gate_net_id; static struct tc_action_ops act_gate_ops; =20 static ktime_t gate_get_time(struct tcf_gate *gact) @@ -298,7 +297,7 @@ static int tcf_gate_init(struct net *net, struct nlattr= *nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, gate_net_id); + struct tc_action_net *tn =3D net_generic(net, act_gate_ops.net_id); enum tk_offsets tk_offset =3D TK_OFFS_TAI; bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct nlattr *tb[TCA_GATE_MAX + 1]; @@ -570,7 +569,7 @@ static int tcf_gate_walker(struct net *net, struct sk_b= uff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, gate_net_id); + struct tc_action_net *tn =3D net_generic(net, act_gate_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } @@ -587,7 +586,7 @@ static void tcf_gate_stats_update(struct tc_action *a, = u64 bytes, u64 packets, =20 static int tcf_gate_search(struct net *net, struct tc_action **a, u32 inde= x) { - struct tc_action_net *tn =3D net_generic(net, gate_net_id); + struct tc_action_net *tn =3D net_generic(net, act_gate_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -664,20 +663,20 @@ static struct tc_action_ops act_gate_ops =3D { =20 static __net_init int gate_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, gate_net_id); + struct tc_action_net *tn =3D net_generic(net, act_gate_ops.net_id); =20 return tc_action_net_init(net, tn, &act_gate_ops); } =20 static void __net_exit gate_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, gate_net_id); + tc_action_net_exit(net_list, act_gate_ops.net_id); } =20 static struct pernet_operations gate_net_ops =3D { .init =3D gate_init_net, .exit_batch =3D gate_exit_net, - .id =3D &gate_net_id, + .id =3D &act_gate_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c index 41ba55e60b1b..ef8355012ac0 100644 --- a/net/sched/act_ife.c +++ b/net/sched/act_ife.c @@ -30,7 +30,6 @@ #include #include =20 -static unsigned int ife_net_id; static int max_metacnt =3D IFE_META_MAX + 1; static struct tc_action_ops act_ife_ops; =20 @@ -482,7 +481,7 @@ static int tcf_ife_init(struct net *net, struct nlattr = *nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, ife_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ife_ops.net_id); bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct nlattr *tb[TCA_IFE_MAX + 1]; struct nlattr *tb2[IFE_META_MAX + 1]; @@ -883,14 +882,14 @@ static int tcf_ife_walker(struct net *net, struct sk_= buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, ife_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ife_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_ife_search(struct net *net, struct tc_action **a, u32 index) { - struct tc_action_net *tn =3D net_generic(net, ife_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ife_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -910,20 +909,20 @@ static struct tc_action_ops act_ife_ops =3D { =20 static __net_init int ife_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, ife_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ife_ops.net_id); =20 return tc_action_net_init(net, tn, &act_ife_ops); } =20 static void __net_exit ife_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, ife_net_id); + tc_action_net_exit(net_list, act_ife_ops.net_id); } =20 static struct pernet_operations ife_net_ops =3D { .init =3D ife_init_net, .exit_batch =3D ife_exit_net, - .id =3D &ife_net_id, + .id =3D &act_ife_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c index 2f3d507c24a1..45bd55096ea8 100644 --- a/net/sched/act_ipt.c +++ b/net/sched/act_ipt.c @@ -24,10 +24,7 @@ #include =20 =20 -static unsigned int ipt_net_id; static struct tc_action_ops act_ipt_ops; - -static unsigned int xt_net_id; static struct tc_action_ops act_xt_ops; =20 static int ipt_init_target(struct net *net, struct xt_entry_target *t, @@ -206,8 +203,8 @@ static int tcf_ipt_init(struct net *net, struct nlattr = *nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - return __tcf_ipt_init(net, ipt_net_id, nla, est, a, &act_ipt_ops, - tp, flags); + return __tcf_ipt_init(net, act_ipt_ops.net_id, nla, est, + a, &act_ipt_ops, tp, flags); } =20 static int tcf_xt_init(struct net *net, struct nlattr *nla, @@ -215,8 +212,8 @@ static int tcf_xt_init(struct net *net, struct nlattr *= nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - return __tcf_ipt_init(net, xt_net_id, nla, est, a, &act_xt_ops, - tp, flags); + return __tcf_ipt_init(net, act_xt_ops.net_id, nla, est, + a, &act_xt_ops, tp, flags); } =20 static int tcf_ipt_act(struct sk_buff *skb, const struct tc_action *a, @@ -321,14 +318,14 @@ static int tcf_ipt_walker(struct net *net, struct sk_= buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, ipt_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ipt_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_ipt_search(struct net *net, struct tc_action **a, u32 index) { - struct tc_action_net *tn =3D net_generic(net, ipt_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ipt_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -348,20 +345,20 @@ static struct tc_action_ops act_ipt_ops =3D { =20 static __net_init int ipt_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, ipt_net_id); + struct tc_action_net *tn =3D net_generic(net, act_ipt_ops.net_id); =20 return tc_action_net_init(net, tn, &act_ipt_ops); } =20 static void __net_exit ipt_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, ipt_net_id); + tc_action_net_exit(net_list, act_ipt_ops.net_id); } =20 static struct pernet_operations ipt_net_ops =3D { .init =3D ipt_init_net, .exit_batch =3D ipt_exit_net, - .id =3D &ipt_net_id, + .id =3D &act_ipt_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 @@ -370,14 +367,14 @@ static int tcf_xt_walker(struct net *net, struct sk_b= uff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, xt_net_id); + struct tc_action_net *tn =3D net_generic(net, act_xt_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_xt_search(struct net *net, struct tc_action **a, u32 index) { - struct tc_action_net *tn =3D net_generic(net, xt_net_id); + struct tc_action_net *tn =3D net_generic(net, act_xt_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -397,20 +394,20 @@ static struct tc_action_ops act_xt_ops =3D { =20 static __net_init int xt_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, xt_net_id); + struct tc_action_net *tn =3D net_generic(net, act_xt_ops.net_id); =20 return tc_action_net_init(net, tn, &act_xt_ops); } =20 static void __net_exit xt_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, xt_net_id); + tc_action_net_exit(net_list, act_xt_ops.net_id); } =20 static struct pernet_operations xt_net_ops =3D { .init =3D xt_init_net, .exit_batch =3D xt_exit_net, - .id =3D &xt_net_id, + .id =3D &act_xt_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index a1d70cf86843..56877dd19375 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c @@ -86,7 +86,6 @@ static const struct nla_policy mirred_policy[TCA_MIRRED_M= AX + 1] =3D { [TCA_MIRRED_PARMS] =3D { .len =3D sizeof(struct tc_mirred) }, }; =20 -static unsigned int mirred_net_id; static struct tc_action_ops act_mirred_ops; =20 static int tcf_mirred_init(struct net *net, struct nlattr *nla, @@ -94,7 +93,7 @@ static int tcf_mirred_init(struct net *net, struct nlattr= *nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, mirred_net_id); + struct tc_action_net *tn =3D net_generic(net, act_mirred_ops.net_id); bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct nlattr *tb[TCA_MIRRED_MAX + 1]; struct tcf_chain *goto_ch =3D NULL; @@ -378,14 +377,14 @@ static int tcf_mirred_walker(struct net *net, struct = sk_buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, mirred_net_id); + struct tc_action_net *tn =3D net_generic(net, act_mirred_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_mirred_search(struct net *net, struct tc_action **a, u32 in= dex) { - struct tc_action_net *tn =3D net_generic(net, mirred_net_id); + struct tc_action_net *tn =3D net_generic(net, act_mirred_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -520,20 +519,20 @@ static struct tc_action_ops act_mirred_ops =3D { =20 static __net_init int mirred_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, mirred_net_id); + struct tc_action_net *tn =3D net_generic(net, act_mirred_ops.net_id); =20 return tc_action_net_init(net, tn, &act_mirred_ops); } =20 static void __net_exit mirred_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, mirred_net_id); + tc_action_net_exit(net_list, act_mirred_ops.net_id); } =20 static struct pernet_operations mirred_net_ops =3D { .init =3D mirred_init_net, .exit_batch =3D mirred_exit_net, - .id =3D &mirred_net_id, + .id =3D &act_mirred_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_mpls.c b/net/sched/act_mpls.c index adabeccb63e1..b754d2eae477 100644 --- a/net/sched/act_mpls.c +++ b/net/sched/act_mpls.c @@ -15,7 +15,6 @@ #include #include =20 -static unsigned int mpls_net_id; static struct tc_action_ops act_mpls_ops; =20 #define ACT_MPLS_TTL_DEFAULT 255 @@ -155,7 +154,7 @@ static int tcf_mpls_init(struct net *net, struct nlattr= *nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, mpls_net_id); + struct tc_action_net *tn =3D net_generic(net, act_mpls_ops.net_id); bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct nlattr *tb[TCA_MPLS_MAX + 1]; struct tcf_chain *goto_ch =3D NULL; @@ -372,14 +371,14 @@ static int tcf_mpls_walker(struct net *net, struct sk= _buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, mpls_net_id); + struct tc_action_net *tn =3D net_generic(net, act_mpls_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_mpls_search(struct net *net, struct tc_action **a, u32 inde= x) { - struct tc_action_net *tn =3D net_generic(net, mpls_net_id); + struct tc_action_net *tn =3D net_generic(net, act_mpls_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -459,20 +458,20 @@ static struct tc_action_ops act_mpls_ops =3D { =20 static __net_init int mpls_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, mpls_net_id); + struct tc_action_net *tn =3D net_generic(net, act_mpls_ops.net_id); =20 return tc_action_net_init(net, tn, &act_mpls_ops); } =20 static void __net_exit mpls_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, mpls_net_id); + tc_action_net_exit(net_list, act_mpls_ops.net_id); } =20 static struct pernet_operations mpls_net_ops =3D { .init =3D mpls_init_net, .exit_batch =3D mpls_exit_net, - .id =3D &mpls_net_id, + .id =3D &act_mpls_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 2a39b3729e84..f5810387ce9a 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c @@ -26,7 +26,6 @@ #include =20 =20 -static unsigned int nat_net_id; static struct tc_action_ops act_nat_ops; =20 static const struct nla_policy nat_policy[TCA_NAT_MAX + 1] =3D { @@ -37,7 +36,7 @@ static int tcf_nat_init(struct net *net, struct nlattr *n= la, struct nlattr *est, struct tc_action **a, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, nat_net_id); + struct tc_action_net *tn =3D net_generic(net, act_nat_ops.net_id); bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct nlattr *tb[TCA_NAT_MAX + 1]; struct tcf_chain *goto_ch =3D NULL; @@ -294,14 +293,14 @@ static int tcf_nat_walker(struct net *net, struct sk_= buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, nat_net_id); + struct tc_action_net *tn =3D net_generic(net, act_nat_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_nat_search(struct net *net, struct tc_action **a, u32 index) { - struct tc_action_net *tn =3D net_generic(net, nat_net_id); + struct tc_action_net *tn =3D net_generic(net, act_nat_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -320,20 +319,20 @@ static struct tc_action_ops act_nat_ops =3D { =20 static __net_init int nat_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, nat_net_id); + struct tc_action_net *tn =3D net_generic(net, act_nat_ops.net_id); =20 return tc_action_net_init(net, tn, &act_nat_ops); } =20 static void __net_exit nat_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, nat_net_id); + tc_action_net_exit(net_list, act_nat_ops.net_id); } =20 static struct pernet_operations nat_net_ops =3D { .init =3D nat_init_net, .exit_batch =3D nat_exit_net, - .id =3D &nat_net_id, + .id =3D &act_nat_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 823ee643371c..0951cd1e277e 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c @@ -21,7 +21,6 @@ #include #include =20 -static unsigned int pedit_net_id; static struct tc_action_ops act_pedit_ops; =20 static const struct nla_policy pedit_policy[TCA_PEDIT_MAX + 1] =3D { @@ -139,7 +138,7 @@ static int tcf_pedit_init(struct net *net, struct nlatt= r *nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, pedit_net_id); + struct tc_action_net *tn =3D net_generic(net, act_pedit_ops.net_id); bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct nlattr *tb[TCA_PEDIT_MAX + 1]; struct tcf_chain *goto_ch =3D NULL; @@ -497,14 +496,14 @@ static int tcf_pedit_walker(struct net *net, struct s= k_buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, pedit_net_id); + struct tc_action_net *tn =3D net_generic(net, act_pedit_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_pedit_search(struct net *net, struct tc_action **a, u32 ind= ex) { - struct tc_action_net *tn =3D net_generic(net, pedit_net_id); + struct tc_action_net *tn =3D net_generic(net, act_pedit_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -561,20 +560,20 @@ static struct tc_action_ops act_pedit_ops =3D { =20 static __net_init int pedit_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, pedit_net_id); + struct tc_action_net *tn =3D net_generic(net, act_pedit_ops.net_id); =20 return tc_action_net_init(net, tn, &act_pedit_ops); } =20 static void __net_exit pedit_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, pedit_net_id); + tc_action_net_exit(net_list, act_pedit_ops.net_id); } =20 static struct pernet_operations pedit_net_ops =3D { .init =3D pedit_init_net, .exit_batch =3D pedit_exit_net, - .id =3D &pedit_net_id, + .id =3D &act_pedit_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_police.c b/net/sched/act_police.c index b759628a47c2..b5df33c6de52 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c @@ -22,7 +22,6 @@ =20 /* Each policer is serialized by its individual spinlock */ =20 -static unsigned int police_net_id; static struct tc_action_ops act_police_ops; =20 static int tcf_police_walker(struct net *net, struct sk_buff *skb, @@ -30,7 +29,7 @@ static int tcf_police_walker(struct net *net, struct sk_b= uff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, police_net_id); + struct tc_action_net *tn =3D net_generic(net, act_police_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } @@ -58,7 +57,7 @@ static int tcf_police_init(struct net *net, struct nlattr= *nla, struct tc_police *parm; struct tcf_police *police; struct qdisc_rate_table *R_tab =3D NULL, *P_tab =3D NULL; - struct tc_action_net *tn =3D net_generic(net, police_net_id); + struct tc_action_net *tn =3D net_generic(net, act_police_ops.net_id); struct tcf_police_params *new; bool exists =3D false; u32 index; @@ -414,7 +413,7 @@ static int tcf_police_dump(struct sk_buff *skb, struct = tc_action *a, =20 static int tcf_police_search(struct net *net, struct tc_action **a, u32 in= dex) { - struct tc_action_net *tn =3D net_generic(net, police_net_id); + struct tc_action_net *tn =3D net_generic(net, act_police_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -522,20 +521,20 @@ static struct tc_action_ops act_police_ops =3D { =20 static __net_init int police_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, police_net_id); + struct tc_action_net *tn =3D net_generic(net, act_police_ops.net_id); =20 return tc_action_net_init(net, tn, &act_police_ops); } =20 static void __net_exit police_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, police_net_id); + tc_action_net_exit(net_list, act_police_ops.net_id); } =20 static struct pernet_operations police_net_ops =3D { .init =3D police_init_net, .exit_batch =3D police_exit_net, - .id =3D &police_net_id, + .id =3D &act_police_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_sample.c b/net/sched/act_sample.c index 2f7f5e44d28c..c25a193f9ef4 100644 --- a/net/sched/act_sample.c +++ b/net/sched/act_sample.c @@ -23,7 +23,6 @@ =20 #include =20 -static unsigned int sample_net_id; static struct tc_action_ops act_sample_ops; =20 static const struct nla_policy sample_policy[TCA_SAMPLE_MAX + 1] =3D { @@ -38,7 +37,7 @@ static int tcf_sample_init(struct net *net, struct nlattr= *nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, sample_net_id); + struct tc_action_net *tn =3D net_generic(net, act_sample_ops.net_id); bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct nlattr *tb[TCA_SAMPLE_MAX + 1]; struct psample_group *psample_group; @@ -246,14 +245,14 @@ static int tcf_sample_walker(struct net *net, struct = sk_buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, sample_net_id); + struct tc_action_net *tn =3D net_generic(net, act_sample_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_sample_search(struct net *net, struct tc_action **a, u32 in= dex) { - struct tc_action_net *tn =3D net_generic(net, sample_net_id); + struct tc_action_net *tn =3D net_generic(net, act_sample_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -330,20 +329,20 @@ static struct tc_action_ops act_sample_ops =3D { =20 static __net_init int sample_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, sample_net_id); + struct tc_action_net *tn =3D net_generic(net, act_sample_ops.net_id); =20 return tc_action_net_init(net, tn, &act_sample_ops); } =20 static void __net_exit sample_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, sample_net_id); + tc_action_net_exit(net_list, act_sample_ops.net_id); } =20 static struct pernet_operations sample_net_ops =3D { .init =3D sample_init_net, .exit_batch =3D sample_exit_net, - .id =3D &sample_net_id, + .id =3D &act_sample_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index 8c1d60bde93e..06efa08afff7 100644 --- a/net/sched/act_simple.c +++ b/net/sched/act_simple.c @@ -18,7 +18,6 @@ #include #include =20 -static unsigned int simp_net_id; static struct tc_action_ops act_simp_ops; =20 #define SIMP_MAX_DATA 32 @@ -89,7 +88,7 @@ static int tcf_simp_init(struct net *net, struct nlattr *= nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, simp_net_id); + struct tc_action_net *tn =3D net_generic(net, act_simp_ops.net_id); bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct nlattr *tb[TCA_DEF_MAX + 1]; struct tcf_chain *goto_ch =3D NULL; @@ -203,14 +202,14 @@ static int tcf_simp_walker(struct net *net, struct sk= _buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, simp_net_id); + struct tc_action_net *tn =3D net_generic(net, act_simp_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_simp_search(struct net *net, struct tc_action **a, u32 inde= x) { - struct tc_action_net *tn =3D net_generic(net, simp_net_id); + struct tc_action_net *tn =3D net_generic(net, act_simp_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -230,20 +229,20 @@ static struct tc_action_ops act_simp_ops =3D { =20 static __net_init int simp_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, simp_net_id); + struct tc_action_net *tn =3D net_generic(net, act_simp_ops.net_id); =20 return tc_action_net_init(net, tn, &act_simp_ops); } =20 static void __net_exit simp_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, simp_net_id); + tc_action_net_exit(net_list, act_simp_ops.net_id); } =20 static struct pernet_operations simp_net_ops =3D { .init =3D simp_init_net, .exit_batch =3D simp_exit_net, - .id =3D &simp_net_id, + .id =3D &act_simp_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index e3bd11dfe1ca..72729ed7219a 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched/act_skbedit.c @@ -20,7 +20,6 @@ #include #include =20 -static unsigned int skbedit_net_id; static struct tc_action_ops act_skbedit_ops; =20 static u16 tcf_skbedit_hash(struct tcf_skbedit_params *params, @@ -118,7 +117,7 @@ static int tcf_skbedit_init(struct net *net, struct nla= ttr *nla, struct tcf_proto *tp, u32 act_flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, skbedit_net_id); + struct tc_action_net *tn =3D net_generic(net, act_skbedit_ops.net_id); bool bind =3D act_flags & TCA_ACT_FLAGS_BIND; struct tcf_skbedit_params *params_new; struct nlattr *tb[TCA_SKBEDIT_MAX + 1]; @@ -352,14 +351,14 @@ static int tcf_skbedit_walker(struct net *net, struct= sk_buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, skbedit_net_id); + struct tc_action_net *tn =3D net_generic(net, act_skbedit_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_skbedit_search(struct net *net, struct tc_action **a, u32 i= ndex) { - struct tc_action_net *tn =3D net_generic(net, skbedit_net_id); + struct tc_action_net *tn =3D net_generic(net, act_skbedit_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -437,20 +436,20 @@ static struct tc_action_ops act_skbedit_ops =3D { =20 static __net_init int skbedit_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, skbedit_net_id); + struct tc_action_net *tn =3D net_generic(net, act_skbedit_ops.net_id); =20 return tc_action_net_init(net, tn, &act_skbedit_ops); } =20 static void __net_exit skbedit_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, skbedit_net_id); + tc_action_net_exit(net_list, act_skbedit_ops.net_id); } =20 static struct pernet_operations skbedit_net_ops =3D { .init =3D skbedit_init_net, .exit_batch =3D skbedit_exit_net, - .id =3D &skbedit_net_id, + .id =3D &act_skbedit_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c index 2083612d8780..999adceb686a 100644 --- a/net/sched/act_skbmod.c +++ b/net/sched/act_skbmod.c @@ -19,7 +19,6 @@ #include #include =20 -static unsigned int skbmod_net_id; static struct tc_action_ops act_skbmod_ops; =20 static int tcf_skbmod_act(struct sk_buff *skb, const struct tc_action *a, @@ -103,7 +102,7 @@ static int tcf_skbmod_init(struct net *net, struct nlat= tr *nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, skbmod_net_id); + struct tc_action_net *tn =3D net_generic(net, act_skbmod_ops.net_id); bool ovr =3D flags & TCA_ACT_FLAGS_REPLACE; bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct nlattr *tb[TCA_SKBMOD_MAX + 1]; @@ -281,14 +280,14 @@ static int tcf_skbmod_walker(struct net *net, struct = sk_buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, skbmod_net_id); + struct tc_action_net *tn =3D net_generic(net, act_skbmod_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tcf_skbmod_search(struct net *net, struct tc_action **a, u32 in= dex) { - struct tc_action_net *tn =3D net_generic(net, skbmod_net_id); + struct tc_action_net *tn =3D net_generic(net, act_skbmod_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -308,20 +307,20 @@ static struct tc_action_ops act_skbmod_ops =3D { =20 static __net_init int skbmod_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, skbmod_net_id); + struct tc_action_net *tn =3D net_generic(net, act_skbmod_ops.net_id); =20 return tc_action_net_init(net, tn, &act_skbmod_ops); } =20 static void __net_exit skbmod_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, skbmod_net_id); + tc_action_net_exit(net_list, act_skbmod_ops.net_id); } =20 static struct pernet_operations skbmod_net_ops =3D { .init =3D skbmod_init_net, .exit_batch =3D skbmod_exit_net, - .id =3D &skbmod_net_id, + .id =3D &act_skbmod_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_tunnel_key.c b/net/sched/act_tunnel_key.c index 856dc23cef8c..2db0c929fa09 100644 --- a/net/sched/act_tunnel_key.c +++ b/net/sched/act_tunnel_key.c @@ -20,7 +20,6 @@ #include #include =20 -static unsigned int tunnel_key_net_id; static struct tc_action_ops act_tunnel_key_ops; =20 static int tunnel_key_act(struct sk_buff *skb, const struct tc_action *a, @@ -358,7 +357,7 @@ static int tunnel_key_init(struct net *net, struct nlat= tr *nla, struct tcf_proto *tp, u32 act_flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, tunnel_key_net_id); + struct tc_action_net *tn =3D net_generic(net, act_tunnel_key_ops.net_id); bool bind =3D act_flags & TCA_ACT_FLAGS_BIND; struct nlattr *tb[TCA_TUNNEL_KEY_MAX + 1]; struct tcf_tunnel_key_params *params_new; @@ -775,14 +774,14 @@ static int tunnel_key_walker(struct net *net, struct = sk_buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, tunnel_key_net_id); + struct tc_action_net *tn =3D net_generic(net, act_tunnel_key_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } =20 static int tunnel_key_search(struct net *net, struct tc_action **a, u32 in= dex) { - struct tc_action_net *tn =3D net_generic(net, tunnel_key_net_id); + struct tc_action_net *tn =3D net_generic(net, act_tunnel_key_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -858,20 +857,20 @@ static struct tc_action_ops act_tunnel_key_ops =3D { =20 static __net_init int tunnel_key_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, tunnel_key_net_id); + struct tc_action_net *tn =3D net_generic(net, act_tunnel_key_ops.net_id); =20 return tc_action_net_init(net, tn, &act_tunnel_key_ops); } =20 static void __net_exit tunnel_key_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, tunnel_key_net_id); + tc_action_net_exit(net_list, act_tunnel_key_ops.net_id); } =20 static struct pernet_operations tunnel_key_net_ops =3D { .init =3D tunnel_key_init_net, .exit_batch =3D tunnel_key_exit_net, - .id =3D &tunnel_key_net_id, + .id =3D &act_tunnel_key_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index 68b5e772386a..a1a0c2c6a5cc 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c @@ -16,7 +16,6 @@ #include #include =20 -static unsigned int vlan_net_id; static struct tc_action_ops act_vlan_ops; =20 static int tcf_vlan_act(struct sk_buff *skb, const struct tc_action *a, @@ -117,7 +116,7 @@ static int tcf_vlan_init(struct net *net, struct nlattr= *nla, struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, vlan_net_id); + struct tc_action_net *tn =3D net_generic(net, act_vlan_ops.net_id); bool bind =3D flags & TCA_ACT_FLAGS_BIND; struct nlattr *tb[TCA_VLAN_MAX + 1]; struct tcf_chain *goto_ch =3D NULL; @@ -338,7 +337,7 @@ static int tcf_vlan_walker(struct net *net, struct sk_b= uff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { - struct tc_action_net *tn =3D net_generic(net, vlan_net_id); + struct tc_action_net *tn =3D net_generic(net, act_vlan_ops.net_id); =20 return tcf_generic_walker(tn, skb, cb, type, ops, extack); } @@ -355,7 +354,7 @@ static void tcf_vlan_stats_update(struct tc_action *a, = u64 bytes, u64 packets, =20 static int tcf_vlan_search(struct net *net, struct tc_action **a, u32 inde= x) { - struct tc_action_net *tn =3D net_generic(net, vlan_net_id); + struct tc_action_net *tn =3D net_generic(net, act_vlan_ops.net_id); =20 return tcf_idr_search(tn, a, index); } @@ -448,20 +447,20 @@ static struct tc_action_ops act_vlan_ops =3D { =20 static __net_init int vlan_init_net(struct net *net) { - struct tc_action_net *tn =3D net_generic(net, vlan_net_id); + struct tc_action_net *tn =3D net_generic(net, act_vlan_ops.net_id); =20 return tc_action_net_init(net, tn, &act_vlan_ops); } =20 static void __net_exit vlan_exit_net(struct list_head *net_list) { - tc_action_net_exit(net_list, vlan_net_id); + tc_action_net_exit(net_list, act_vlan_ops.net_id); } =20 static struct pernet_operations vlan_net_ops =3D { .init =3D vlan_init_net, .exit_batch =3D vlan_exit_net, - .id =3D &vlan_net_id, + .id =3D &act_vlan_ops.net_id, .size =3D sizeof(struct tc_action_net), }; =20 --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B5C5ECAAD5 for ; Thu, 8 Sep 2022 04:13:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229896AbiIHENT (ORCPT ); Thu, 8 Sep 2022 00:13:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbiIHENK (ORCPT ); Thu, 8 Sep 2022 00:13:10 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A75967F08E; Wed, 7 Sep 2022 21:13:09 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MNQfS040HzHnZv; Thu, 8 Sep 2022 12:11:12 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:06 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 02/22] net: sched: act_api: implement generic walker and search for tc action Date: Thu, 8 Sep 2022 12:14:34 +0800 Message-ID: <20220908041454.365070-3-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Being able to get tc_action_net by using net_id stored in tc_action_ops and execute the generic walk/search function, add __tcf_generic_walker() and __tcf_idr_search() helpers. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_api.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 817065aa2833..9b31a10cc639 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -676,6 +676,31 @@ int tcf_idr_search(struct tc_action_net *tn, struct tc= _action **a, u32 index) } EXPORT_SYMBOL(tcf_idr_search); =20 +static int __tcf_generic_walker(struct net *net, struct sk_buff *skb, + struct netlink_callback *cb, int type, + const struct tc_action_ops *ops, + struct netlink_ext_ack *extack) +{ + struct tc_action_net *tn =3D net_generic(net, ops->net_id); + + if (unlikely(ops->walk)) + return ops->walk(net, skb, cb, type, ops, extack); + + return tcf_generic_walker(tn, skb, cb, type, ops, extack); +} + +static int __tcf_idr_search(struct net *net, + const struct tc_action_ops *ops, + struct tc_action **a, u32 index) +{ + struct tc_action_net *tn =3D net_generic(net, ops->net_id); + + if (unlikely(ops->lookup)) + return ops->lookup(net, a, index); + + return tcf_idr_search(tn, a, index); +} + static int tcf_idr_delete_index(struct tcf_idrinfo *idrinfo, u32 index) { struct tc_action *p; @@ -926,7 +951,7 @@ int tcf_register_action(struct tc_action_ops *act, struct tc_action_ops *a; int ret; =20 - if (!act->act || !act->dump || !act->init || !act->walk || !act->lookup) + if (!act->act || !act->dump || !act->init) return -EINVAL; =20 /* We have to register pernet ops before making the action ops visible, @@ -1638,7 +1663,7 @@ static struct tc_action *tcf_action_get_1(struct net = *net, struct nlattr *nla, goto err_out; } err =3D -ENOENT; - if (ops->lookup(net, &a, index) =3D=3D 0) { + if (__tcf_idr_search(net, ops, &a, index) =3D=3D 0) { NL_SET_ERR_MSG(extack, "TC action with specified index not found"); goto err_mod; } @@ -1703,7 +1728,7 @@ static int tca_action_flush(struct net *net, struct n= lattr *nla, goto out_module_put; } =20 - err =3D ops->walk(net, skb, &dcb, RTM_DELACTION, ops, extack); + err =3D __tcf_generic_walker(net, skb, &dcb, RTM_DELACTION, ops, extack); if (err <=3D 0) { nla_nest_cancel(skb, nest); goto out_module_put; @@ -2121,7 +2146,7 @@ static int tc_dump_action(struct sk_buff *skb, struct= netlink_callback *cb) if (nest =3D=3D NULL) goto out_module_put; =20 - ret =3D a_o->walk(net, skb, cb, RTM_GETACTION, a_o, NULL); + ret =3D __tcf_generic_walker(net, skb, cb, RTM_GETACTION, a_o, NULL); if (ret < 0) goto out_module_put; =20 --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7721C6FA86 for ; Thu, 8 Sep 2022 04:13:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229941AbiIHEN0 (ORCPT ); Thu, 8 Sep 2022 00:13:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229788AbiIHENK (ORCPT ); Thu, 8 Sep 2022 00:13:10 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24DBF87681; Wed, 7 Sep 2022 21:13:10 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MNQfT0C5wzHnZm; Thu, 8 Sep 2022 12:11:13 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:07 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 03/22] net: sched: act_bpf: get rid of tcf_bpf_walker and tcf_bpf_search Date: Thu, 8 Sep 2022 12:14:35 +0800 Message-ID: <20220908041454.365070-4-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_bpf_walker() and tcf_bpf_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_bpf.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c index dd839efe9649..c5dbb68e6b78 100644 --- a/net/sched/act_bpf.c +++ b/net/sched/act_bpf.c @@ -389,23 +389,6 @@ static void tcf_bpf_cleanup(struct tc_action *act) tcf_bpf_cfg_cleanup(&tmp); } =20 -static int tcf_bpf_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_bpf_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_bpf_search(struct net *net, struct tc_action **a, u32 index) -{ - struct tc_action_net *tn =3D net_generic(net, act_bpf_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static struct tc_action_ops act_bpf_ops __read_mostly =3D { .kind =3D "bpf", .id =3D TCA_ID_BPF, @@ -414,8 +397,6 @@ static struct tc_action_ops act_bpf_ops __read_mostly = =3D { .dump =3D tcf_bpf_dump, .cleanup =3D tcf_bpf_cleanup, .init =3D tcf_bpf_init, - .walk =3D tcf_bpf_walker, - .lookup =3D tcf_bpf_search, .size =3D sizeof(struct tcf_bpf), }; =20 --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 602B4C38145 for ; Thu, 8 Sep 2022 04:13:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230032AbiIHENf (ORCPT ); Thu, 8 Sep 2022 00:13:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229835AbiIHENL (ORCPT ); Thu, 8 Sep 2022 00:13:11 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43D0F4C60A; Wed, 7 Sep 2022 21:13:11 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MNQbW0t8GzZcMX; Thu, 8 Sep 2022 12:08:39 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:08 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 04/22] net: sched: act_connmark: get rid of tcf_connmark_walker and tcf_connmark_search Date: Thu, 8 Sep 2022 12:14:36 +0800 Message-ID: <20220908041454.365070-5-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_connmark_walker() and tcf_connmark_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_connmark.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_connmark.c b/net/sched/act_connmark.c index 1ea9ad187560..66b143bb04ac 100644 --- a/net/sched/act_connmark.c +++ b/net/sched/act_connmark.c @@ -199,23 +199,6 @@ static inline int tcf_connmark_dump(struct sk_buff *sk= b, struct tc_action *a, return -1; } =20 -static int tcf_connmark_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_connmark_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_connmark_search(struct net *net, struct tc_action **a, u32 = index) -{ - struct tc_action_net *tn =3D net_generic(net, act_connmark_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static struct tc_action_ops act_connmark_ops =3D { .kind =3D "connmark", .id =3D TCA_ID_CONNMARK, @@ -223,8 +206,6 @@ static struct tc_action_ops act_connmark_ops =3D { .act =3D tcf_connmark_act, .dump =3D tcf_connmark_dump, .init =3D tcf_connmark_init, - .walk =3D tcf_connmark_walker, - .lookup =3D tcf_connmark_search, .size =3D sizeof(struct tcf_connmark_info), }; =20 --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA1E6ECAAD5 for ; Thu, 8 Sep 2022 04:13:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229795AbiIHENk (ORCPT ); Thu, 8 Sep 2022 00:13:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbiIHENN (ORCPT ); Thu, 8 Sep 2022 00:13:13 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A63537F08E; Wed, 7 Sep 2022 21:13:12 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MNQdl5jmCzgYwP; Thu, 8 Sep 2022 12:10:35 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:09 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 05/22] net: sched: act_csum: get rid of tcf_csum_walker and tcf_csum_search Date: Thu, 8 Sep 2022 12:14:37 +0800 Message-ID: <20220908041454.365070-6-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_csum_walker() and tcf_csum_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_csum.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index 400f80cca40f..1366adf9b909 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c @@ -672,23 +672,6 @@ static void tcf_csum_cleanup(struct tc_action *a) kfree_rcu(params, rcu); } =20 -static int tcf_csum_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_csum_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_csum_search(struct net *net, struct tc_action **a, u32 inde= x) -{ - struct tc_action_net *tn =3D net_generic(net, act_csum_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static size_t tcf_csum_get_fill_size(const struct tc_action *act) { return nla_total_size(sizeof(struct tc_csum)); @@ -721,8 +704,6 @@ static struct tc_action_ops act_csum_ops =3D { .dump =3D tcf_csum_dump, .init =3D tcf_csum_init, .cleanup =3D tcf_csum_cleanup, - .walk =3D tcf_csum_walker, - .lookup =3D tcf_csum_search, .get_fill_size =3D tcf_csum_get_fill_size, .offload_act_setup =3D tcf_csum_offload_act_setup, .size =3D sizeof(struct tcf_csum), --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 104BFC38145 for ; Thu, 8 Sep 2022 04:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbiIHENn (ORCPT ); Thu, 8 Sep 2022 00:13:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbiIHENO (ORCPT ); Thu, 8 Sep 2022 00:13:14 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3397086078; Wed, 7 Sep 2022 21:13:13 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MNQdm5tJvzgYwQ; Thu, 8 Sep 2022 12:10:36 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:10 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 06/22] net: sched: act_ct: get rid of tcf_ct_walker and tcf_ct_search Date: Thu, 8 Sep 2022 12:14:38 +0800 Message-ID: <20220908041454.365070-7-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_ct_walker() and tcf_ct_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_ct.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index 38b2f583106c..4dd3fac42504 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -1557,23 +1557,6 @@ static inline int tcf_ct_dump(struct sk_buff *skb, s= truct tc_action *a, return -1; } =20 -static int tcf_ct_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_ct_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_ct_search(struct net *net, struct tc_action **a, u32 index) -{ - struct tc_action_net *tn =3D net_generic(net, act_ct_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static void tcf_stats_update(struct tc_action *a, u64 bytes, u64 packets, u64 drops, u64 lastuse, bool hw) { @@ -1612,8 +1595,6 @@ static struct tc_action_ops act_ct_ops =3D { .dump =3D tcf_ct_dump, .init =3D tcf_ct_init, .cleanup =3D tcf_ct_cleanup, - .walk =3D tcf_ct_walker, - .lookup =3D tcf_ct_search, .stats_update =3D tcf_stats_update, .offload_act_setup =3D tcf_ct_offload_act_setup, .size =3D sizeof(struct tcf_ct), --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FF99C6FA83 for ; Thu, 8 Sep 2022 04:13:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbiIHENu (ORCPT ); Thu, 8 Sep 2022 00:13:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbiIHENP (ORCPT ); Thu, 8 Sep 2022 00:13:15 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73666A0240; Wed, 7 Sep 2022 21:13:14 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MNQfY0kR0zHndR; Thu, 8 Sep 2022 12:11:17 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:11 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 07/22] net: sched: act_ctinfo: get rid of tcf_ctinfo_walker and tcf_ctinfo_search Date: Thu, 8 Sep 2022 12:14:39 +0800 Message-ID: <20220908041454.365070-8-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_ctinfo_walker() and tcf_ctinfo_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_ctinfo.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_ctinfo.c b/net/sched/act_ctinfo.c index 626f338c694d..d4102f0a9abd 100644 --- a/net/sched/act_ctinfo.c +++ b/net/sched/act_ctinfo.c @@ -341,23 +341,6 @@ static int tcf_ctinfo_dump(struct sk_buff *skb, struct= tc_action *a, return -1; } =20 -static int tcf_ctinfo_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_ctinfo_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_ctinfo_search(struct net *net, struct tc_action **a, u32 in= dex) -{ - struct tc_action_net *tn =3D net_generic(net, act_ctinfo_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static void tcf_ctinfo_cleanup(struct tc_action *a) { struct tcf_ctinfo *ci =3D to_ctinfo(a); @@ -376,8 +359,6 @@ static struct tc_action_ops act_ctinfo_ops =3D { .dump =3D tcf_ctinfo_dump, .init =3D tcf_ctinfo_init, .cleanup=3D tcf_ctinfo_cleanup, - .walk =3D tcf_ctinfo_walker, - .lookup =3D tcf_ctinfo_search, .size =3D sizeof(struct tcf_ctinfo), }; =20 --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12958ECAAD5 for ; Thu, 8 Sep 2022 04:13:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230124AbiIHENx (ORCPT ); Thu, 8 Sep 2022 00:13:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229914AbiIHENZ (ORCPT ); Thu, 8 Sep 2022 00:13:25 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7348DC2F93; Wed, 7 Sep 2022 21:13:15 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MNQcd4GglzmVGB; Thu, 8 Sep 2022 12:09:37 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:12 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 08/22] net: sched: act_gact: get rid of tcf_gact_walker and tcf_gact_search Date: Thu, 8 Sep 2022 12:14:40 +0800 Message-ID: <20220908041454.365070-9-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_gact_walker() and tcf_gact_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_gact.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c index ede896a7ee6b..abe1bcc5c797 100644 --- a/net/sched/act_gact.c +++ b/net/sched/act_gact.c @@ -221,23 +221,6 @@ static int tcf_gact_dump(struct sk_buff *skb, struct t= c_action *a, return -1; } =20 -static int tcf_gact_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_gact_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_gact_search(struct net *net, struct tc_action **a, u32 inde= x) -{ - struct tc_action_net *tn =3D net_generic(net, act_gact_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static size_t tcf_gact_get_fill_size(const struct tc_action *act) { size_t sz =3D nla_total_size(sizeof(struct tc_gact)); /* TCA_GACT_PARMS */ @@ -307,8 +290,6 @@ static struct tc_action_ops act_gact_ops =3D { .stats_update =3D tcf_gact_stats_update, .dump =3D tcf_gact_dump, .init =3D tcf_gact_init, - .walk =3D tcf_gact_walker, - .lookup =3D tcf_gact_search, .get_fill_size =3D tcf_gact_get_fill_size, .offload_act_setup =3D tcf_gact_offload_act_setup, .size =3D sizeof(struct tcf_gact), --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95CB5C38145 for ; Thu, 8 Sep 2022 04:14:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbiIHEOZ (ORCPT ); Thu, 8 Sep 2022 00:14:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229983AbiIHENf (ORCPT ); Thu, 8 Sep 2022 00:13:35 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25D3EC32D8; Wed, 7 Sep 2022 21:13:16 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MNQdq6KdlzgYwd; Thu, 8 Sep 2022 12:10:39 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:13 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 09/22] net: sched: act_gate: get rid of tcf_gate_walker and tcf_gate_search Date: Thu, 8 Sep 2022 12:14:41 +0800 Message-ID: <20220908041454.365070-10-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_gate_walker() and tcf_gate_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_gate.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_gate.c b/net/sched/act_gate.c index 1b528550eb22..3049878e7315 100644 --- a/net/sched/act_gate.c +++ b/net/sched/act_gate.c @@ -564,16 +564,6 @@ static int tcf_gate_dump(struct sk_buff *skb, struct t= c_action *a, return -1; } =20 -static int tcf_gate_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_gate_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - static void tcf_gate_stats_update(struct tc_action *a, u64 bytes, u64 pack= ets, u64 drops, u64 lastuse, bool hw) { @@ -584,13 +574,6 @@ static void tcf_gate_stats_update(struct tc_action *a,= u64 bytes, u64 packets, tm->lastuse =3D max_t(u64, tm->lastuse, lastuse); } =20 -static int tcf_gate_search(struct net *net, struct tc_action **a, u32 inde= x) -{ - struct tc_action_net *tn =3D net_generic(net, act_gate_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static size_t tcf_gate_get_fill_size(const struct tc_action *act) { return nla_total_size(sizeof(struct tc_gate)); @@ -653,10 +636,8 @@ static struct tc_action_ops act_gate_ops =3D { .dump =3D tcf_gate_dump, .init =3D tcf_gate_init, .cleanup =3D tcf_gate_cleanup, - .walk =3D tcf_gate_walker, .stats_update =3D tcf_gate_stats_update, .get_fill_size =3D tcf_gate_get_fill_size, - .lookup =3D tcf_gate_search, .offload_act_setup =3D tcf_gate_offload_act_setup, .size =3D sizeof(struct tcf_gate), }; --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C67E9C6FA86 for ; Thu, 8 Sep 2022 04:14:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbiIHEOk (ORCPT ); Thu, 8 Sep 2022 00:14:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230054AbiIHENg (ORCPT ); Thu, 8 Sep 2022 00:13:36 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C14BC59EC; Wed, 7 Sep 2022 21:13:17 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MNQcg4RZbzmVGP; Thu, 8 Sep 2022 12:09:39 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:14 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 10/22] net: sched: act_ife: get rid of tcf_ife_walker and tcf_ife_search Date: Thu, 8 Sep 2022 12:14:42 +0800 Message-ID: <20220908041454.365070-11-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_ife_walker() and tcf_ife_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_ife.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c index ef8355012ac0..41d63b33461d 100644 --- a/net/sched/act_ife.c +++ b/net/sched/act_ife.c @@ -877,23 +877,6 @@ static int tcf_ife_act(struct sk_buff *skb, const stru= ct tc_action *a, return tcf_ife_decode(skb, a, res); } =20 -static int tcf_ife_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_ife_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_ife_search(struct net *net, struct tc_action **a, u32 index) -{ - struct tc_action_net *tn =3D net_generic(net, act_ife_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static struct tc_action_ops act_ife_ops =3D { .kind =3D "ife", .id =3D TCA_ID_IFE, @@ -902,8 +885,6 @@ static struct tc_action_ops act_ife_ops =3D { .dump =3D tcf_ife_dump, .cleanup =3D tcf_ife_cleanup, .init =3D tcf_ife_init, - .walk =3D tcf_ife_walker, - .lookup =3D tcf_ife_search, .size =3D sizeof(struct tcf_ife_info), }; =20 --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29B85ECAAD5 for ; Thu, 8 Sep 2022 04:14:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230212AbiIHEOr (ORCPT ); Thu, 8 Sep 2022 00:14:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230061AbiIHENu (ORCPT ); Thu, 8 Sep 2022 00:13:50 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE41AC695F; Wed, 7 Sep 2022 21:13:18 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MNQbf1x6RzZcMl; Thu, 8 Sep 2022 12:08:46 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:15 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 11/22] net: sched: act_ipt: get rid of tcf_ipt_walker/tcf_xt_walker and tcf_ipt_search/tcf_xt_search Date: Thu, 8 Sep 2022 12:14:43 +0800 Message-ID: <20220908041454.365070-12-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_ipt_walker()/tcf_xt_walker() and tcf_ipt_search()/tcf_xt_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_ipt.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c index 45bd55096ea8..1625e1037416 100644 --- a/net/sched/act_ipt.c +++ b/net/sched/act_ipt.c @@ -313,23 +313,6 @@ static int tcf_ipt_dump(struct sk_buff *skb, struct tc= _action *a, int bind, return -1; } =20 -static int tcf_ipt_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_ipt_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_ipt_search(struct net *net, struct tc_action **a, u32 index) -{ - struct tc_action_net *tn =3D net_generic(net, act_ipt_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static struct tc_action_ops act_ipt_ops =3D { .kind =3D "ipt", .id =3D TCA_ID_IPT, @@ -338,8 +321,6 @@ static struct tc_action_ops act_ipt_ops =3D { .dump =3D tcf_ipt_dump, .cleanup =3D tcf_ipt_release, .init =3D tcf_ipt_init, - .walk =3D tcf_ipt_walker, - .lookup =3D tcf_ipt_search, .size =3D sizeof(struct tcf_ipt), }; =20 @@ -362,23 +343,6 @@ static struct pernet_operations ipt_net_ops =3D { .size =3D sizeof(struct tc_action_net), }; =20 -static int tcf_xt_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_xt_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_xt_search(struct net *net, struct tc_action **a, u32 index) -{ - struct tc_action_net *tn =3D net_generic(net, act_xt_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static struct tc_action_ops act_xt_ops =3D { .kind =3D "xt", .id =3D TCA_ID_XT, @@ -387,8 +351,6 @@ static struct tc_action_ops act_xt_ops =3D { .dump =3D tcf_ipt_dump, .cleanup =3D tcf_ipt_release, .init =3D tcf_xt_init, - .walk =3D tcf_xt_walker, - .lookup =3D tcf_xt_search, .size =3D sizeof(struct tcf_ipt), }; =20 --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 610A8ECAAD5 for ; Thu, 8 Sep 2022 04:14:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbiIHEOw (ORCPT ); Thu, 8 Sep 2022 00:14:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbiIHENu (ORCPT ); Thu, 8 Sep 2022 00:13:50 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E2BAC6EB5; Wed, 7 Sep 2022 21:13:19 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MNQcj508QzmVGj; Thu, 8 Sep 2022 12:09:41 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:16 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 12/22] net: sched: act_mirred: get rid of tcf_mirred_walker and tcf_mirred_search Date: Thu, 8 Sep 2022 12:14:44 +0800 Message-ID: <20220908041454.365070-13-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_mirred_walker() and tcf_mirred_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_mirred.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 56877dd19375..f9c14d4188d4 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c @@ -372,23 +372,6 @@ static int tcf_mirred_dump(struct sk_buff *skb, struct= tc_action *a, int bind, return -1; } =20 -static int tcf_mirred_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_mirred_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_mirred_search(struct net *net, struct tc_action **a, u32 in= dex) -{ - struct tc_action_net *tn =3D net_generic(net, act_mirred_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static int mirred_device_event(struct notifier_block *unused, unsigned long event, void *ptr) { @@ -509,8 +492,6 @@ static struct tc_action_ops act_mirred_ops =3D { .dump =3D tcf_mirred_dump, .cleanup =3D tcf_mirred_release, .init =3D tcf_mirred_init, - .walk =3D tcf_mirred_walker, - .lookup =3D tcf_mirred_search, .get_fill_size =3D tcf_mirred_get_fill_size, .offload_act_setup =3D tcf_mirred_offload_act_setup, .size =3D sizeof(struct tcf_mirred), --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E060BC38145 for ; Thu, 8 Sep 2022 04:15:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbiIHEPj (ORCPT ); Thu, 8 Sep 2022 00:15:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230181AbiIHEOj (ORCPT ); Thu, 8 Sep 2022 00:14:39 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 534C7CCD7A; Wed, 7 Sep 2022 21:13:21 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MNQdv6vd0zgYWM; Thu, 8 Sep 2022 12:10:43 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:17 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 13/22] net: sched: act_mpls: get rid of tcf_mpls_walker and tcf_mpls_search Date: Thu, 8 Sep 2022 12:14:45 +0800 Message-ID: <20220908041454.365070-14-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_mpls_walker() and tcf_mpls_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_mpls.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_mpls.c b/net/sched/act_mpls.c index b754d2eae477..8ad25cc8ccd5 100644 --- a/net/sched/act_mpls.c +++ b/net/sched/act_mpls.c @@ -366,23 +366,6 @@ static int tcf_mpls_dump(struct sk_buff *skb, struct t= c_action *a, return -EMSGSIZE; } =20 -static int tcf_mpls_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_mpls_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_mpls_search(struct net *net, struct tc_action **a, u32 inde= x) -{ - struct tc_action_net *tn =3D net_generic(net, act_mpls_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static int tcf_mpls_offload_act_setup(struct tc_action *act, void *entry_d= ata, u32 *index_inc, bool bind, struct netlink_ext_ack *extack) @@ -450,8 +433,6 @@ static struct tc_action_ops act_mpls_ops =3D { .dump =3D tcf_mpls_dump, .init =3D tcf_mpls_init, .cleanup =3D tcf_mpls_cleanup, - .walk =3D tcf_mpls_walker, - .lookup =3D tcf_mpls_search, .offload_act_setup =3D tcf_mpls_offload_act_setup, .size =3D sizeof(struct tcf_mpls), }; --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A7A1ECAAD5 for ; Thu, 8 Sep 2022 04:15:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230355AbiIHEPR (ORCPT ); Thu, 8 Sep 2022 00:15:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230147AbiIHEOh (ORCPT ); Thu, 8 Sep 2022 00:14:37 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 530A6CCD79; Wed, 7 Sep 2022 21:13:22 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MNQcl5Gw9zmVG5; Thu, 8 Sep 2022 12:09:43 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:18 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 14/22] net: sched: act_nat: get rid of tcf_nat_walker and tcf_nat_search Date: Thu, 8 Sep 2022 12:14:46 +0800 Message-ID: <20220908041454.365070-15-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_nat_walker() and tcf_nat_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_nat.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index f5810387ce9a..9265145f1040 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c @@ -288,23 +288,6 @@ static int tcf_nat_dump(struct sk_buff *skb, struct tc= _action *a, return -1; } =20 -static int tcf_nat_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_nat_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_nat_search(struct net *net, struct tc_action **a, u32 index) -{ - struct tc_action_net *tn =3D net_generic(net, act_nat_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static struct tc_action_ops act_nat_ops =3D { .kind =3D "nat", .id =3D TCA_ID_NAT, @@ -312,8 +295,6 @@ static struct tc_action_ops act_nat_ops =3D { .act =3D tcf_nat_act, .dump =3D tcf_nat_dump, .init =3D tcf_nat_init, - .walk =3D tcf_nat_walker, - .lookup =3D tcf_nat_search, .size =3D sizeof(struct tcf_nat), }; =20 --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 418A8ECAAD5 for ; Thu, 8 Sep 2022 04:15:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230227AbiIHEPX (ORCPT ); Thu, 8 Sep 2022 00:15:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230162AbiIHEOj (ORCPT ); Thu, 8 Sep 2022 00:14:39 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50027CCE14; Wed, 7 Sep 2022 21:13:23 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MNQfj2CHFzHndp; Thu, 8 Sep 2022 12:11:25 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:19 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 15/22] net: sched: act_pedit: get rid of tcf_pedit_walker and tcf_pedit_search Date: Thu, 8 Sep 2022 12:14:47 +0800 Message-ID: <20220908041454.365070-16-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_pedit_walker() and tcf_pedit_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_pedit.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 0951cd1e277e..94ed5857ce67 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c @@ -491,23 +491,6 @@ static int tcf_pedit_dump(struct sk_buff *skb, struct = tc_action *a, return -1; } =20 -static int tcf_pedit_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_pedit_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_pedit_search(struct net *net, struct tc_action **a, u32 ind= ex) -{ - struct tc_action_net *tn =3D net_generic(net, act_pedit_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static int tcf_pedit_offload_act_setup(struct tc_action *act, void *entry_= data, u32 *index_inc, bool bind, struct netlink_ext_ack *extack) @@ -552,8 +535,6 @@ static struct tc_action_ops act_pedit_ops =3D { .dump =3D tcf_pedit_dump, .cleanup =3D tcf_pedit_cleanup, .init =3D tcf_pedit_init, - .walk =3D tcf_pedit_walker, - .lookup =3D tcf_pedit_search, .offload_act_setup =3D tcf_pedit_offload_act_setup, .size =3D sizeof(struct tcf_pedit), }; --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63F86ECAAD5 for ; Thu, 8 Sep 2022 04:15:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230313AbiIHEPK (ORCPT ); Thu, 8 Sep 2022 00:15:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229989AbiIHEOS (ORCPT ); Thu, 8 Sep 2022 00:14:18 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 463E3CCE1D; Wed, 7 Sep 2022 21:13:23 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MNQbl2srpzZcPH; Thu, 8 Sep 2022 12:08:51 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:20 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 16/22] net: sched: act_police: get rid of tcf_police_walker and tcf_police_search Date: Thu, 8 Sep 2022 12:14:48 +0800 Message-ID: <20220908041454.365070-17-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_police_walker() and tcf_police_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_police.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_police.c b/net/sched/act_police.c index b5df33c6de52..0adb26e366a7 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c @@ -24,16 +24,6 @@ =20 static struct tc_action_ops act_police_ops; =20 -static int tcf_police_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_police_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - static const struct nla_policy police_policy[TCA_POLICE_MAX + 1] =3D { [TCA_POLICE_RATE] =3D { .len =3D TC_RTAB_SIZE }, [TCA_POLICE_PEAKRATE] =3D { .len =3D TC_RTAB_SIZE }, @@ -411,13 +401,6 @@ static int tcf_police_dump(struct sk_buff *skb, struct= tc_action *a, return -1; } =20 -static int tcf_police_search(struct net *net, struct tc_action **a, u32 in= dex) -{ - struct tc_action_net *tn =3D net_generic(net, act_police_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static int tcf_police_act_to_flow_act(int tc_act, u32 *extval, struct netlink_ext_ack *extack) { @@ -512,8 +495,6 @@ static struct tc_action_ops act_police_ops =3D { .act =3D tcf_police_act, .dump =3D tcf_police_dump, .init =3D tcf_police_init, - .walk =3D tcf_police_walker, - .lookup =3D tcf_police_search, .cleanup =3D tcf_police_cleanup, .offload_act_setup =3D tcf_police_offload_act_setup, .size =3D sizeof(struct tcf_police), --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B33EC38145 for ; Thu, 8 Sep 2022 04:15:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230027AbiIHEPp (ORCPT ); Thu, 8 Sep 2022 00:15:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230201AbiIHEOm (ORCPT ); Thu, 8 Sep 2022 00:14:42 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42740CCE2E; Wed, 7 Sep 2022 21:13:25 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MNQcY0sWFzlVj6; Thu, 8 Sep 2022 12:09:33 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:21 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 17/22] net: sched: act_sample: get rid of tcf_sample_walker and tcf_sample_search Date: Thu, 8 Sep 2022 12:14:49 +0800 Message-ID: <20220908041454.365070-18-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_sample_walker() and tcf_sample_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_sample.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_sample.c b/net/sched/act_sample.c index c25a193f9ef4..5ba36f70e3a1 100644 --- a/net/sched/act_sample.c +++ b/net/sched/act_sample.c @@ -240,23 +240,6 @@ static int tcf_sample_dump(struct sk_buff *skb, struct= tc_action *a, return -1; } =20 -static int tcf_sample_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_sample_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_sample_search(struct net *net, struct tc_action **a, u32 in= dex) -{ - struct tc_action_net *tn =3D net_generic(net, act_sample_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static void tcf_psample_group_put(void *priv) { struct psample_group *group =3D priv; @@ -320,8 +303,6 @@ static struct tc_action_ops act_sample_ops =3D { .dump =3D tcf_sample_dump, .init =3D tcf_sample_init, .cleanup =3D tcf_sample_cleanup, - .walk =3D tcf_sample_walker, - .lookup =3D tcf_sample_search, .get_psample_group =3D tcf_sample_get_group, .offload_act_setup =3D tcf_sample_offload_act_setup, .size =3D sizeof(struct tcf_sample), --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C1E4C38145 for ; Thu, 8 Sep 2022 04:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230255AbiIHEPt (ORCPT ); Thu, 8 Sep 2022 00:15:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbiIHEPD (ORCPT ); Thu, 8 Sep 2022 00:15:03 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 866FE9E0C1; Wed, 7 Sep 2022 21:13:27 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MNQbq1d1bzZcfS; Thu, 8 Sep 2022 12:08:55 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:22 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 18/22] net: sched: act_simple: get rid of tcf_simp_walker and tcf_simp_search Date: Thu, 8 Sep 2022 12:14:50 +0800 Message-ID: <20220908041454.365070-19-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_simp_walker() and tcf_simp_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_simple.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index 06efa08afff7..18d376135461 100644 --- a/net/sched/act_simple.c +++ b/net/sched/act_simple.c @@ -197,23 +197,6 @@ static int tcf_simp_dump(struct sk_buff *skb, struct t= c_action *a, return -1; } =20 -static int tcf_simp_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_simp_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_simp_search(struct net *net, struct tc_action **a, u32 inde= x) -{ - struct tc_action_net *tn =3D net_generic(net, act_simp_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static struct tc_action_ops act_simp_ops =3D { .kind =3D "simple", .id =3D TCA_ID_SIMP, @@ -222,8 +205,6 @@ static struct tc_action_ops act_simp_ops =3D { .dump =3D tcf_simp_dump, .cleanup =3D tcf_simp_release, .init =3D tcf_simp_init, - .walk =3D tcf_simp_walker, - .lookup =3D tcf_simp_search, .size =3D sizeof(struct tcf_defact), }; =20 --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEC1FECAAD5 for ; Thu, 8 Sep 2022 04:15:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229673AbiIHEPz (ORCPT ); Thu, 8 Sep 2022 00:15:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230231AbiIHEPE (ORCPT ); Thu, 8 Sep 2022 00:15:04 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86753CCE3E; Wed, 7 Sep 2022 21:13:27 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MNQbq28StzZcfd; Thu, 8 Sep 2022 12:08:55 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:23 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 19/22] net: sched: act_skbedit: get rid of tcf_skbedit_walker and tcf_skbedit_search Date: Thu, 8 Sep 2022 12:14:51 +0800 Message-ID: <20220908041454.365070-20-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_skbedit_walker() and tcf_skbedit_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_skbedit.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index 72729ed7219a..7f598784fd30 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched/act_skbedit.c @@ -346,23 +346,6 @@ static void tcf_skbedit_cleanup(struct tc_action *a) kfree_rcu(params, rcu); } =20 -static int tcf_skbedit_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_skbedit_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_skbedit_search(struct net *net, struct tc_action **a, u32 i= ndex) -{ - struct tc_action_net *tn =3D net_generic(net, act_skbedit_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static size_t tcf_skbedit_get_fill_size(const struct tc_action *act) { return nla_total_size(sizeof(struct tc_skbedit)) @@ -427,9 +410,7 @@ static struct tc_action_ops act_skbedit_ops =3D { .dump =3D tcf_skbedit_dump, .init =3D tcf_skbedit_init, .cleanup =3D tcf_skbedit_cleanup, - .walk =3D tcf_skbedit_walker, .get_fill_size =3D tcf_skbedit_get_fill_size, - .lookup =3D tcf_skbedit_search, .offload_act_setup =3D tcf_skbedit_offload_act_setup, .size =3D sizeof(struct tcf_skbedit), }; --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFD1FC6FA83 for ; Thu, 8 Sep 2022 04:15:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230397AbiIHEPb (ORCPT ); Thu, 8 Sep 2022 00:15:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230178AbiIHEOj (ORCPT ); Thu, 8 Sep 2022 00:14:39 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7BE1CD502; Wed, 7 Sep 2022 21:13:28 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MNQf30ypLzgYmH; Thu, 8 Sep 2022 12:10:51 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:24 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 20/22] net: sched: act_skbmod: get rid of tcf_skbmod_walker and tcf_skbmod_search Date: Thu, 8 Sep 2022 12:14:52 +0800 Message-ID: <20220908041454.365070-21-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_skbmod_walker() and tcf_skbmod_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_skbmod.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c index 999adceb686a..d98758a63934 100644 --- a/net/sched/act_skbmod.c +++ b/net/sched/act_skbmod.c @@ -275,23 +275,6 @@ static int tcf_skbmod_dump(struct sk_buff *skb, struct= tc_action *a, return -1; } =20 -static int tcf_skbmod_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_skbmod_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tcf_skbmod_search(struct net *net, struct tc_action **a, u32 in= dex) -{ - struct tc_action_net *tn =3D net_generic(net, act_skbmod_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static struct tc_action_ops act_skbmod_ops =3D { .kind =3D "skbmod", .id =3D TCA_ACT_SKBMOD, @@ -300,8 +283,6 @@ static struct tc_action_ops act_skbmod_ops =3D { .dump =3D tcf_skbmod_dump, .init =3D tcf_skbmod_init, .cleanup =3D tcf_skbmod_cleanup, - .walk =3D tcf_skbmod_walker, - .lookup =3D tcf_skbmod_search, .size =3D sizeof(struct tcf_skbmod), }; =20 --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A790ECAAD5 for ; Thu, 8 Sep 2022 04:16:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230452AbiIHEQ2 (ORCPT ); Thu, 8 Sep 2022 00:16:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230307AbiIHEPK (ORCPT ); Thu, 8 Sep 2022 00:15:10 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAB42CD50B; Wed, 7 Sep 2022 21:13:29 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MNQct6BnzzmVGY; Thu, 8 Sep 2022 12:09:50 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:26 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 21/22] net: sched: act_tunnel_key: get rid of tunnel_key_walker and tunnel_key_search Date: Thu, 8 Sep 2022 12:14:53 +0800 Message-ID: <20220908041454.365070-22-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tunnel_key_walker() and tunnel_key_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_tunnel_key.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_tunnel_key.c b/net/sched/act_tunnel_key.c index 2db0c929fa09..2691a3d8e451 100644 --- a/net/sched/act_tunnel_key.c +++ b/net/sched/act_tunnel_key.c @@ -769,23 +769,6 @@ static int tunnel_key_dump(struct sk_buff *skb, struct= tc_action *a, return -1; } =20 -static int tunnel_key_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_tunnel_key_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - -static int tunnel_key_search(struct net *net, struct tc_action **a, u32 in= dex) -{ - struct tc_action_net *tn =3D net_generic(net, act_tunnel_key_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static void tcf_tunnel_encap_put_tunnel(void *priv) { struct ip_tunnel_info *tunnel =3D priv; @@ -849,8 +832,6 @@ static struct tc_action_ops act_tunnel_key_ops =3D { .dump =3D tunnel_key_dump, .init =3D tunnel_key_init, .cleanup =3D tunnel_key_release, - .walk =3D tunnel_key_walker, - .lookup =3D tunnel_key_search, .offload_act_setup =3D tcf_tunnel_key_offload_act_setup, .size =3D sizeof(struct tcf_tunnel_key), }; --=20 2.17.1 From nobody Mon Apr 6 11:03:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3D83ECAAD5 for ; Thu, 8 Sep 2022 04:16:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbiIHEQF (ORCPT ); Thu, 8 Sep 2022 00:16:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230260AbiIHEPG (ORCPT ); Thu, 8 Sep 2022 00:15:06 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67D98CD512; Wed, 7 Sep 2022 21:13:30 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MNQf51GpyzgYwT; Thu, 8 Sep 2022 12:10:53 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 12:13:27 +0800 From: Zhengchao Shao To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH net-next,v3 22/22] net: sched: act_vlan: get rid of tcf_vlan_walker and tcf_vlan_search Date: Thu, 8 Sep 2022 12:14:54 +0800 Message-ID: <20220908041454.365070-23-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908041454.365070-1-shaozhengchao@huawei.com> References: <20220908041454.365070-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tcf_vlan_walker() and tcf_vlan_search() do the same thing as generic walk/search function, so remove them. Signed-off-by: Zhengchao Shao Acked-by: Jamal Hadi Salim --- net/sched/act_vlan.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index a1a0c2c6a5cc..7b24e898a3e6 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c @@ -332,16 +332,6 @@ static int tcf_vlan_dump(struct sk_buff *skb, struct t= c_action *a, return -1; } =20 -static int tcf_vlan_walker(struct net *net, struct sk_buff *skb, - struct netlink_callback *cb, int type, - const struct tc_action_ops *ops, - struct netlink_ext_ack *extack) -{ - struct tc_action_net *tn =3D net_generic(net, act_vlan_ops.net_id); - - return tcf_generic_walker(tn, skb, cb, type, ops, extack); -} - static void tcf_vlan_stats_update(struct tc_action *a, u64 bytes, u64 pack= ets, u64 drops, u64 lastuse, bool hw) { @@ -352,13 +342,6 @@ static void tcf_vlan_stats_update(struct tc_action *a,= u64 bytes, u64 packets, tm->lastuse =3D max_t(u64, tm->lastuse, lastuse); } =20 -static int tcf_vlan_search(struct net *net, struct tc_action **a, u32 inde= x) -{ - struct tc_action_net *tn =3D net_generic(net, act_vlan_ops.net_id); - - return tcf_idr_search(tn, a, index); -} - static size_t tcf_vlan_get_fill_size(const struct tc_action *act) { return nla_total_size(sizeof(struct tc_vlan)) @@ -437,10 +420,8 @@ static struct tc_action_ops act_vlan_ops =3D { .dump =3D tcf_vlan_dump, .init =3D tcf_vlan_init, .cleanup =3D tcf_vlan_cleanup, - .walk =3D tcf_vlan_walker, .stats_update =3D tcf_vlan_stats_update, .get_fill_size =3D tcf_vlan_get_fill_size, - .lookup =3D tcf_vlan_search, .offload_act_setup =3D tcf_vlan_offload_act_setup, .size =3D sizeof(struct tcf_vlan), }; --=20 2.17.1