Skip to contentSkip to conversation

net: always inline net_secret_init

PATCH Applied Hannes Frederic Sowa 2 participants 2 messages Oct 23, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: always inline net_secret_init

Currently net_secret_init does not get inlined, so we always have a call to net_secret_init even in the fast path.

Let's specify net_secret_init as __always_inline so we have the nop in the fast-path without the call to net_secret_init and the unlikely path at the epilogue of the function.

jump_labels handle the inlining correctly.

---
 net/core/secure_seq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/secure_seq.c +1 -1
index b02fd16..90e8a82 100644
@@ -15,7 +15,7 @@
 
 static u32 net_secret[NET_SECRET_SIZE] ____cacheline_aligned;
 
-static void net_secret_init(void)
+static __always_inline void net_secret_init(void)
 {
 	net_get_random_once(net_secret, sizeof(net_secret));
 }
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw

From: Hannes Frederic Sowa <[email protected]>
Date: Wed, 23 Oct 2013 08:44:50 +0200

Quoted 10 lines

Currently net_secret_init does not get inlined, so we always have a call to net_secret_init even in the fast path.

Let's specify net_secret_init as __always_inline so we have the nop in the fast-path without the call to net_secret_init and the unlikely path at the epilogue of the function.

jump_labels handle the inlining correctly.

Applied, thanks Hannes.