summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-03-07 18:58:35 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-17 21:46:55 +0300
commit81f7503fb41bf734bfc7ce2d38bb537d3c15214b (patch)
tree0cd9ab0fb54e4cc709e79e8bf818eab66273a3aa /net/core
parent30db8e400c4db194df58562ed884fa79899834e5 (diff)
downloadlinux-81f7503fb41bf734bfc7ce2d38bb537d3c15214b.tar.xz
ethtool: reduce stack usage with clang
commit 3499e87ea0413ee5b2cc028f4c8ed4d424bc7f98 upstream. clang inlines the dev_ethtool() more aggressively than gcc does, leading to a larger amount of used stack space: net/core/ethtool.c:2536:24: error: stack frame size of 1216 bytes in function 'dev_ethtool' [-Werror,-Wframe-larger-than=] Marking the sub-functions that require the most stack space as noinline_for_stack gives us reasonable behavior on all compilers. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Miles Chen <miles.chen@mediatek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/ethtool.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 09d828a6a173..1011625a0ca4 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -2413,9 +2413,10 @@ static int ethtool_set_tunable(struct net_device *dev, void __user *useraddr)
return ret;
}
-static int ethtool_get_per_queue_coalesce(struct net_device *dev,
- void __user *useraddr,
- struct ethtool_per_queue_op *per_queue_opt)
+static noinline_for_stack int
+ethtool_get_per_queue_coalesce(struct net_device *dev,
+ void __user *useraddr,
+ struct ethtool_per_queue_op *per_queue_opt)
{
u32 bit;
int ret;
@@ -2443,9 +2444,10 @@ static int ethtool_get_per_queue_coalesce(struct net_device *dev,
return 0;
}
-static int ethtool_set_per_queue_coalesce(struct net_device *dev,
- void __user *useraddr,
- struct ethtool_per_queue_op *per_queue_opt)
+static noinline_for_stack int
+ethtool_set_per_queue_coalesce(struct net_device *dev,
+ void __user *useraddr,
+ struct ethtool_per_queue_op *per_queue_opt)
{
u32 bit;
int i, ret = 0;
@@ -2499,7 +2501,7 @@ roll_back:
return ret;
}
-static int ethtool_set_per_queue(struct net_device *dev,
+static int noinline_for_stack ethtool_set_per_queue(struct net_device *dev,
void __user *useraddr, u32 sub_cmd)
{
struct ethtool_per_queue_op per_queue_opt;