netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] macsec: add noinline tag to avoid a frame size warning
@ 2019-04-01  9:37 Florian Westphal
  2019-04-01 20:51 ` Sabrina Dubroca
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Westphal @ 2019-04-01  9:37 UTC (permalink / raw)
  To: netdev; +Cc: Florian Westphal, Sabrina Dubroca

seen with debug config:
drivers/net/macsec.c: In function 'dump_secy':
drivers/net/macsec.c:2597: warning: the frame size of 2216 bytes is larger
than 2048 bytes [-Wframe-larger-than=]

just mark it with noinline_for_stack, this is netlink dump code.

Cc: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 drivers/net/macsec.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 947c40f112d1..dbea9452b19a 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -2175,8 +2175,9 @@ static int copy_tx_sa_stats(struct sk_buff *skb,
 	return 0;
 }
 
-static int copy_rx_sa_stats(struct sk_buff *skb,
-			    struct macsec_rx_sa_stats __percpu *pstats)
+static int noinline_for_stack
+copy_rx_sa_stats(struct sk_buff *skb,
+		 struct macsec_rx_sa_stats __percpu *pstats)
 {
 	struct macsec_rx_sa_stats sum = {0, };
 	int cpu;
@@ -2201,8 +2202,8 @@ static int copy_rx_sa_stats(struct sk_buff *skb,
 	return 0;
 }
 
-static int copy_rx_sc_stats(struct sk_buff *skb,
-			    struct pcpu_rx_sc_stats __percpu *pstats)
+static noinline_for_stack int
+copy_rx_sc_stats(struct sk_buff *skb, struct pcpu_rx_sc_stats __percpu *pstats)
 {
 	struct macsec_rx_sc_stats sum = {0, };
 	int cpu;
@@ -2265,8 +2266,8 @@ static int copy_rx_sc_stats(struct sk_buff *skb,
 	return 0;
 }
 
-static int copy_tx_sc_stats(struct sk_buff *skb,
-			    struct pcpu_tx_sc_stats __percpu *pstats)
+static noinline_for_stack int
+copy_tx_sc_stats(struct sk_buff *skb, struct pcpu_tx_sc_stats __percpu *pstats)
 {
 	struct macsec_tx_sc_stats sum = {0, };
 	int cpu;
@@ -2305,8 +2306,8 @@ static int copy_tx_sc_stats(struct sk_buff *skb,
 	return 0;
 }
 
-static int copy_secy_stats(struct sk_buff *skb,
-			   struct pcpu_secy_stats __percpu *pstats)
+static noinline_for_stack int
+copy_secy_stats(struct sk_buff *skb, struct pcpu_secy_stats __percpu *pstats)
 {
 	struct macsec_dev_stats sum = {0, };
 	int cpu;
@@ -2410,8 +2411,9 @@ static int nla_put_secy(struct macsec_secy *secy, struct sk_buff *skb)
 	return 1;
 }
 
-static int dump_secy(struct macsec_secy *secy, struct net_device *dev,
-		     struct sk_buff *skb, struct netlink_callback *cb)
+static noinline_for_stack int
+dump_secy(struct macsec_secy *secy, struct net_device *dev,
+	  struct sk_buff *skb, struct netlink_callback *cb)
 {
 	struct macsec_rx_sc *rx_sc;
 	struct macsec_tx_sc *tx_sc = &secy->tx_sc;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] macsec: add noinline tag to avoid a frame size warning
  2019-04-01  9:37 [PATCH net-next] macsec: add noinline tag to avoid a frame size warning Florian Westphal
@ 2019-04-01 20:51 ` Sabrina Dubroca
  0 siblings, 0 replies; 2+ messages in thread
From: Sabrina Dubroca @ 2019-04-01 20:51 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netdev

2019-04-01, 11:37:50 +0200, Florian Westphal wrote:
> seen with debug config:
> drivers/net/macsec.c: In function 'dump_secy':
> drivers/net/macsec.c:2597: warning: the frame size of 2216 bytes is larger
> than 2048 bytes [-Wframe-larger-than=]
> 
> just mark it with noinline_for_stack, this is netlink dump code.
> 
> Cc: Sabrina Dubroca <sd@queasysnail.net>
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
>  drivers/net/macsec.c | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
> index 947c40f112d1..dbea9452b19a 100644
> --- a/drivers/net/macsec.c
> +++ b/drivers/net/macsec.c
> @@ -2175,8 +2175,9 @@ static int copy_tx_sa_stats(struct sk_buff *skb,
>  	return 0;
>  }
>  
> -static int copy_rx_sa_stats(struct sk_buff *skb,
> -			    struct macsec_rx_sa_stats __percpu *pstats)
> +static int noinline_for_stack

Could you swap int/noinline_for_stack to be consistent with the rest?

static noinline_for_stack int

Other than that, lgtm, thanks.

-- 
Sabrina

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-01 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-01  9:37 [PATCH net-next] macsec: add noinline tag to avoid a frame size warning Florian Westphal
2019-04-01 20:51 ` Sabrina Dubroca

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).