]> git.baikalelectronics.ru Git - kernel.git/commit
ovs: datapath: hide clang frame-overflow warnings
authorArnd Bergmann <arnd@arndb.de>
Mon, 22 Jul 2019 15:00:01 +0000 (17:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Jul 2019 22:45:11 +0000 (15:45 -0700)
commit6f548fb12109761558b868fa662779a0131b4b8a
tree80d4828fc09961777e350163b927cf66cf8c5665
parent88238a9f0755c1379e91dfed4ed56d6a1f70aff6
ovs: datapath: hide clang frame-overflow warnings

Some functions in the datapath code are factored out so that each
one has a stack frame smaller than 1024 bytes with gcc. However,
when compiling with clang, the functions are inlined more aggressively
and combined again so we get

net/openvswitch/datapath.c:1124:12: error: stack frame size of 1528 bytes in function 'ovs_flow_cmd_set' [-Werror,-Wframe-larger-than=]

Marking both get_flow_actions() and ovs_nla_init_match_and_action()
as 'noinline_for_stack' gives us the same behavior that we see with
gcc, and no warning. Note that this does not mean we actually use
less stack, as the functions call each other, and we still get
three copies of the large 'struct sw_flow_key' type on the stack.

The comment tells us that this was previously considered safe,
presumably since the netlink parsing functions are called with
a known backchain that does not also use a lot of stack space.

Fixes: 19dc104f804f ("datapath: Avoid using stack larger than 1024.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/openvswitch/datapath.c