netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: validate_xmit_vlan() is static
@ 2014-10-06 18:26 Eric Dumazet
  2014-10-06 18:44 ` Joe Perches
  2014-10-06 22:17 ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Eric Dumazet @ 2014-10-06 18:26 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

From: Eric Dumazet <edumazet@google.com>

Marking this as static allows compiler to inline it.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/core/dev.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 7d5691cc1f479ee4f1bb46b06d35fe8c..2702724ce2de5712e13c37321597a314 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2643,7 +2643,8 @@ out:
 	return skb;
 }
 
-struct sk_buff *validate_xmit_vlan(struct sk_buff *skb, netdev_features_t features)
+static struct sk_buff *validate_xmit_vlan(struct sk_buff *skb,
+					  netdev_features_t features)
 {
 	if (vlan_tx_tag_present(skb) &&
 	    !vlan_hw_offload_capable(features, skb->vlan_proto)) {

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

* Re: [PATCH net-next] net: validate_xmit_vlan() is static
  2014-10-06 18:26 [PATCH net-next] net: validate_xmit_vlan() is static Eric Dumazet
@ 2014-10-06 18:44 ` Joe Perches
  2014-10-06 19:07   ` Josh Triplett
  2014-10-06 19:35   ` Eric Dumazet
  2014-10-06 22:17 ` David Miller
  1 sibling, 2 replies; 6+ messages in thread
From: Joe Perches @ 2014-10-06 18:44 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David Miller, netdev, Julia Lawall, Dan Carpenter, Josh Triplett

On Mon, 2014-10-06 at 11:26 -0700, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> Marking this as static allows compiler to inline it.

Found by inspection or another tool?

Wasn't there some tool to look for non-static functions
that are not called externally that could/should be
converted to static?

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

* Re: [PATCH net-next] net: validate_xmit_vlan() is static
  2014-10-06 18:44 ` Joe Perches
@ 2014-10-06 19:07   ` Josh Triplett
  2014-10-06 19:36     ` Joe Perches
  2014-10-06 19:35   ` Eric Dumazet
  1 sibling, 1 reply; 6+ messages in thread
From: Josh Triplett @ 2014-10-06 19:07 UTC (permalink / raw)
  To: Joe Perches
  Cc: Eric Dumazet, David Miller, netdev, Julia Lawall, Dan Carpenter

On Mon, Oct 06, 2014 at 11:44:02AM -0700, Joe Perches wrote:
> On Mon, 2014-10-06 at 11:26 -0700, Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@google.com>
> > 
> > Marking this as static allows compiler to inline it.
> 
> Found by inspection or another tool?
> 
> Wasn't there some tool to look for non-static functions
> that are not called externally that could/should be
> converted to static?

Several: sparse, gcc -Wmissing-prototypes, and findstatic.pl.

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

* Re: [PATCH net-next] net: validate_xmit_vlan() is static
  2014-10-06 18:44 ` Joe Perches
  2014-10-06 19:07   ` Josh Triplett
@ 2014-10-06 19:35   ` Eric Dumazet
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Dumazet @ 2014-10-06 19:35 UTC (permalink / raw)
  To: Joe Perches
  Cc: David Miller, netdev, Julia Lawall, Dan Carpenter, Josh Triplett

On Mon, 2014-10-06 at 11:44 -0700, Joe Perches wrote:
> On Mon, 2014-10-06 at 11:26 -0700, Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@google.com>
> > 
> > Marking this as static allows compiler to inline it.
> 
> Found by inspection or another tool?
> 
> Wasn't there some tool to look for non-static functions
> that are not called externally that could/should be
> converted to static?

Found by inspecting and analyzing performance on real workload.

Note prior commits :

bec3cfdca36bf43cfa3751ad7b56db1a307e0760 net: skb_segment() provides list head and tail
01291202ed4ad548f9a7147d20425cb1d24f49a7 net: do not export skb_gro_receive()
55a93b3ea780908b7d1b3a8cf1976223a9268d78 qdisc: validate skb without holding lock

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

* Re: [PATCH net-next] net: validate_xmit_vlan() is static
  2014-10-06 19:07   ` Josh Triplett
@ 2014-10-06 19:36     ` Joe Perches
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2014-10-06 19:36 UTC (permalink / raw)
  To: Josh Triplett
  Cc: Eric Dumazet, David Miller, netdev, Julia Lawall, Dan Carpenter

On Mon, 2014-10-06 at 12:07 -0700, Josh Triplett wrote:
> On Mon, Oct 06, 2014 at 11:44:02AM -0700, Joe Perches wrote:
> > On Mon, 2014-10-06 at 11:26 -0700, Eric Dumazet wrote:
> > > From: Eric Dumazet <edumazet@google.com>
> > > 
> > > Marking this as static allows compiler to inline it.
> > 
> > Found by inspection or another tool?
> > 
> > Wasn't there some tool to look for non-static functions
> > that are not called externally that could/should be
> > converted to static?
> 
> Several: sparse,

Doesn't find anything for this use case

> gcc -Wmissing-prototypes, and findstatic.pl.

Right, thanks, using "make W=1" adds -Wmissing-prototypes.

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

* Re: [PATCH net-next] net: validate_xmit_vlan() is static
  2014-10-06 18:26 [PATCH net-next] net: validate_xmit_vlan() is static Eric Dumazet
  2014-10-06 18:44 ` Joe Perches
@ 2014-10-06 22:17 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2014-10-06 22:17 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 06 Oct 2014 11:26:27 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> Marking this as static allows compiler to inline it.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied, thanks Eric.

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

end of thread, other threads:[~2014-10-06 22:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-06 18:26 [PATCH net-next] net: validate_xmit_vlan() is static Eric Dumazet
2014-10-06 18:44 ` Joe Perches
2014-10-06 19:07   ` Josh Triplett
2014-10-06 19:36     ` Joe Perches
2014-10-06 19:35   ` Eric Dumazet
2014-10-06 22:17 ` David Miller

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