* [PATCH net-next] net/sched: act_api: unexport tcf_action_dump_1()
@ 2024-10-17 16:19 Vladimir Oltean
2024-10-18 14:23 ` Simon Horman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Vladimir Oltean @ 2024-10-17 16:19 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Jamal Hadi Salim, Cong Wang, Jiri Pirko, Pedro Tammela,
linux-kernel
This isn't used outside act_api.c, but is called by tcf_dump_walker()
prior to its definition. So move it upwards and make it static.
Simultaneously, reorder the variable declarations so that they follow
the networking "reverse Christmas tree" coding style.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
include/net/act_api.h | 1 -
net/sched/act_api.c | 89 +++++++++++++++++++++----------------------
2 files changed, 44 insertions(+), 46 deletions(-)
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 77ee0c657e2c..404df8557f6a 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -219,7 +219,6 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
int tcf_action_dump(struct sk_buff *skb, struct tc_action *actions[], int bind,
int ref, bool terse);
int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
-int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
static inline void tcf_action_update_bstats(struct tc_action *a,
struct sk_buff *skb)
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 8e705b212c14..839790043256 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -504,6 +504,50 @@ tcf_action_dump_terse(struct sk_buff *skb, struct tc_action *a, bool from_act)
return -1;
}
+static int
+tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
+{
+ unsigned char *b = skb_tail_pointer(skb);
+ struct nlattr *nest;
+ int err = -EINVAL;
+ u32 flags;
+
+ if (tcf_action_dump_terse(skb, a, false))
+ goto nla_put_failure;
+
+ if (a->hw_stats != TCA_ACT_HW_STATS_ANY &&
+ nla_put_bitfield32(skb, TCA_ACT_HW_STATS,
+ a->hw_stats, TCA_ACT_HW_STATS_ANY))
+ goto nla_put_failure;
+
+ if (a->used_hw_stats_valid &&
+ nla_put_bitfield32(skb, TCA_ACT_USED_HW_STATS,
+ a->used_hw_stats, TCA_ACT_HW_STATS_ANY))
+ goto nla_put_failure;
+
+ flags = a->tcfa_flags & TCA_ACT_FLAGS_USER_MASK;
+ if (flags &&
+ nla_put_bitfield32(skb, TCA_ACT_FLAGS,
+ flags, flags))
+ goto nla_put_failure;
+
+ if (nla_put_u32(skb, TCA_ACT_IN_HW_COUNT, a->in_hw_count))
+ goto nla_put_failure;
+
+ nest = nla_nest_start_noflag(skb, TCA_ACT_OPTIONS);
+ if (nest == NULL)
+ goto nla_put_failure;
+ err = tcf_action_dump_old(skb, a, bind, ref);
+ if (err > 0) {
+ nla_nest_end(skb, nest);
+ return err;
+ }
+
+nla_put_failure:
+ nlmsg_trim(skb, b);
+ return -1;
+}
+
static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
struct netlink_callback *cb)
{
@@ -1190,51 +1234,6 @@ tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
return a->ops->dump(skb, a, bind, ref);
}
-int
-tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
-{
- int err = -EINVAL;
- unsigned char *b = skb_tail_pointer(skb);
- struct nlattr *nest;
- u32 flags;
-
- if (tcf_action_dump_terse(skb, a, false))
- goto nla_put_failure;
-
- if (a->hw_stats != TCA_ACT_HW_STATS_ANY &&
- nla_put_bitfield32(skb, TCA_ACT_HW_STATS,
- a->hw_stats, TCA_ACT_HW_STATS_ANY))
- goto nla_put_failure;
-
- if (a->used_hw_stats_valid &&
- nla_put_bitfield32(skb, TCA_ACT_USED_HW_STATS,
- a->used_hw_stats, TCA_ACT_HW_STATS_ANY))
- goto nla_put_failure;
-
- flags = a->tcfa_flags & TCA_ACT_FLAGS_USER_MASK;
- if (flags &&
- nla_put_bitfield32(skb, TCA_ACT_FLAGS,
- flags, flags))
- goto nla_put_failure;
-
- if (nla_put_u32(skb, TCA_ACT_IN_HW_COUNT, a->in_hw_count))
- goto nla_put_failure;
-
- nest = nla_nest_start_noflag(skb, TCA_ACT_OPTIONS);
- if (nest == NULL)
- goto nla_put_failure;
- err = tcf_action_dump_old(skb, a, bind, ref);
- if (err > 0) {
- nla_nest_end(skb, nest);
- return err;
- }
-
-nla_put_failure:
- nlmsg_trim(skb, b);
- return -1;
-}
-EXPORT_SYMBOL(tcf_action_dump_1);
-
int tcf_action_dump(struct sk_buff *skb, struct tc_action *actions[],
int bind, int ref, bool terse)
{
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net/sched: act_api: unexport tcf_action_dump_1()
2024-10-17 16:19 [PATCH net-next] net/sched: act_api: unexport tcf_action_dump_1() Vladimir Oltean
@ 2024-10-18 14:23 ` Simon Horman
2024-10-18 17:03 ` Toke Høiland-Jørgensen
2024-10-23 10:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2024-10-18 14:23 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Pedro Tammela, linux-kernel
On Thu, Oct 17, 2024 at 07:19:34PM +0300, Vladimir Oltean wrote:
> This isn't used outside act_api.c, but is called by tcf_dump_walker()
> prior to its definition. So move it upwards and make it static.
>
> Simultaneously, reorder the variable declarations so that they follow
> the networking "reverse Christmas tree" coding style.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Christmas has come early this year :)
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net/sched: act_api: unexport tcf_action_dump_1()
2024-10-17 16:19 [PATCH net-next] net/sched: act_api: unexport tcf_action_dump_1() Vladimir Oltean
2024-10-18 14:23 ` Simon Horman
@ 2024-10-18 17:03 ` Toke Høiland-Jørgensen
2024-10-23 10:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2024-10-18 17:03 UTC (permalink / raw)
To: Vladimir Oltean, netdev
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Jamal Hadi Salim, Cong Wang, Jiri Pirko, Pedro Tammela,
linux-kernel
Vladimir Oltean <vladimir.oltean@nxp.com> writes:
> This isn't used outside act_api.c, but is called by tcf_dump_walker()
> prior to its definition. So move it upwards and make it static.
>
> Simultaneously, reorder the variable declarations so that they follow
> the networking "reverse Christmas tree" coding style.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net/sched: act_api: unexport tcf_action_dump_1()
2024-10-17 16:19 [PATCH net-next] net/sched: act_api: unexport tcf_action_dump_1() Vladimir Oltean
2024-10-18 14:23 ` Simon Horman
2024-10-18 17:03 ` Toke Høiland-Jørgensen
@ 2024-10-23 10:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-23 10:00 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, davem, edumazet, kuba, pabeni, jhs, xiyou.wangcong, jiri,
pctammela, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Thu, 17 Oct 2024 19:19:34 +0300 you wrote:
> This isn't used outside act_api.c, but is called by tcf_dump_walker()
> prior to its definition. So move it upwards and make it static.
>
> Simultaneously, reorder the variable declarations so that they follow
> the networking "reverse Christmas tree" coding style.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
>
> [...]
Here is the summary with links:
- [net-next] net/sched: act_api: unexport tcf_action_dump_1()
https://git.kernel.org/netdev/net-next/c/83c289e81e88
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-23 10:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-17 16:19 [PATCH net-next] net/sched: act_api: unexport tcf_action_dump_1() Vladimir Oltean
2024-10-18 14:23 ` Simon Horman
2024-10-18 17:03 ` Toke Høiland-Jørgensen
2024-10-23 10:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).