[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231011034344.104398-7-npiggin@gmail.com>
Date: Wed, 11 Oct 2023 13:43:43 +1000
From: Nicholas Piggin <npiggin@...il.com>
To: netdev@...r.kernel.org
Cc: Nicholas Piggin <npiggin@...il.com>,
dev@...nvswitch.org,
Pravin B Shelar <pshelar@....org>,
Aaron Conole <aconole@...hat.com>,
"Eelco Chaudron" <echaudro@...hat.com>,
"Ilya Maximets" <imaximet@...hat.com>,
"Flavio Leitner" <fbl@...hat.com>
Subject: [PATCH 6/7] net: openvswitch: uninline ovs_fragment to control stack usage
ovs_fragment uses a lot of stack, 400 bytes. It is a leaf function
but its caller do_output is involved in openvswitch recursion.
GCC 13.2 for powerpc64le is not inlining it, but it only has a single
call site, so it is liable to being inlined.
Mark it noinline_for_stack, to ensure it doesn't bloat stack use in
the recursive path.
Signed-off-by: Nicholas Piggin <npiggin@...il.com>
---
net/openvswitch/actions.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 87ec668d5556..ef3a59012d26 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -900,9 +900,9 @@ static void prepare_frag(struct vport *vport, struct sk_buff *skb,
skb_pull(skb, hlen);
}
-static void ovs_fragment(struct net *net, struct vport *vport,
- struct sk_buff *skb, u16 mru,
- struct sw_flow_key *key)
+static noinline_for_stack
+void ovs_fragment(struct net *net, struct vport *vport, struct sk_buff *skb,
+ u16 mru, struct sw_flow_key *key)
{
enum ovs_drop_reason reason;
u16 orig_network_offset = 0;
--
2.42.0
Powered by blists - more mailing lists