Skip to contentSkip to conversation

net, rps: fix build failure when CONFIG_RPS isn't set

net-next bugfix Zhi Yong Wu 3 participants 7 messages Dec 31, 2013 – Jan 1, 2014

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

From: Zhi Yong Wu <[email protected]>

---
 include/net/sock.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/net/sock.h +4 -0
index 8ee90ad..bd716b6 100644
@@ -846,12 +846,16 @@ static inline void sock_rps_reset_flow_hash(__u32 hash)
 
 static inline void sock_rps_record_flow(const struct sock *sk)
 {
+#ifdef CONFIG_RPS
 	sock_rps_record_flow_hash(sk->sk_rxhash);
+#endif
 }
 
 static inline void sock_rps_reset_flow(const struct sock *sk)
 {
+#ifdef CONFIG_RPS
 	sock_rps_reset_flow_hash(sk->sk_rxhash);
+#endif
 }
 
 static inline void sock_rps_save_rxhash(struct sock *sk,
Signature · 1 line
1.7.6.5
maintainer
#1 lore raw

From: Zhi Yong Wu <[email protected]>
Date: Wed, 1 Jan 2014 04:31:01 +0800

include/net/sock.h static inline void sock_rps_reset_flow_hash(__u32 hash) · line 852

Quoted 8 lines
include/net/sock.h +2 -0
@@ -846,12 +846,16 @@ static inline void sock_rps_reset_flow_hash(__u32 hash)
 
 static inline void sock_rps_record_flow(const struct sock *sk)
 {
+#ifdef CONFIG_RPS
 	sock_rps_record_flow_hash(sk->sk_rxhash);
+#endif
 }

Why is this necessary? sock_rps_record_flow_hash() is provided unconditionally, regardless of CONFIG_RPS.

I'm not applying this, it doesn't make any sense. Either there is no build failure, or the existing CONFIG_RPS ifdef inside of the implementation of sock_rps_record_flow_hash() is bogus.

maintainer
#2 lore raw

From: David Miller <[email protected]>
Date: Tue, 31 Dec 2013 15:54:59 -0500 (EST)

Quoted 15 lines

From: Zhi Yong Wu <[email protected]>
Date: Wed, 1 Jan 2014 04:31:01 +0800

include/net/sock.h static inline void sock_rps_reset_flow_hash(__u32 hash) · line 852

Quoted 8 lines
include/net/sock.h +2 -0
@@ -846,12 +846,16 @@ static inline void sock_rps_reset_flow_hash(__u32 hash)
 
 static inline void sock_rps_record_flow(const struct sock *sk)
 {
+#ifdef CONFIG_RPS
 	sock_rps_record_flow_hash(sk->sk_rxhash);
+#endif
 }

Why is this necessary? sock_rps_record_flow_hash() is provided unconditionally, regardless of CONFIG_RPS.

Quoted 3 lines

I'm not applying this, it doesn't make any sense. Either there is no build failure, or the existing CONFIG_RPS ifdef inside of the implementation of sock_rps_record_flow_hash() is bogus.

Ok, if you had actually provided the build failure log message I'd be able to evaluate this patch much better.

The real issue is the lack of sk_rxhash when RPS is not enabled.

I'm going to apply this with the build failure message mentioned.

#4 lore raw
In reply to Zhi Yong Wu

Hello.

Quoted 17 lines · Zhi Yong Wu

From: Zhi Yong Wu <[email protected]>

---
  include/net/sock.h |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)
include/net/sock.h +1 -0
index 8ee90ad..bd716b6 100644
@@ -846,12 +846,16 @@ static inline void sock_rps_reset_flow_hash(__u32 hash)
 
  static inline void sock_rps_record_flow(const struct sock *sk)
  {
+#ifdef CONFIG_RPS

include/net/sock.h static inline void sock_rps_reset_flow_hash(__u32 hash) · line 859

Quoted 10 lines
include/net/sock.h +3 -0
  	sock_rps_record_flow_hash(sk->sk_rxhash);
+#endif
  }
 
  static inline void sock_rps_reset_flow(const struct sock *sk)
  {
+#ifdef CONFIG_RPS
  	sock_rps_reset_flow_hash(sk->sk_rxhash);
+#endif
  }

A lot better style would be:

+#ifdef CONFIG_RPS
static inline void sock_rps_reset_flow(const struct sock *sk) {
sock_rps_reset_flow_hash(sk->sk_rxhash);
}
#else
static inline void sock_rps_reset_flow(const struct sock *sk) {}
+#endif

WBR, Sergei

maintainer
#5 lore raw

From: Sergei Shtylyov <[email protected]>
Date: Wed, 01 Jan 2014 01:03:18 +0300

Quoted 26 lines

Hello.

Quoted 22 lines · Zhi Yong Wu

From: Zhi Yong Wu <[email protected]>

---
  include/net/sock.h |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)
include/net/sock.h +2 -0
index 8ee90ad..bd716b6 100644
@@ -846,12 +846,16 @@ static inline void
 sock_rps_reset_flow_hash(__u32 hash)
 
  static inline void sock_rps_record_flow(const struct sock *sk)
  {
+#ifdef CONFIG_RPS
  	sock_rps_record_flow_hash(sk->sk_rxhash);
+#endif
  }
 
Quoted 8 lines

include/net/sock.h static inline void sock_rps_reset_flow_hash(__u32 hash) · line 859

Quoted 6 lines
include/net/sock.h +2 -0
  static inline void sock_rps_reset_flow(const struct sock *sk)
  {
+#ifdef CONFIG_RPS
  	sock_rps_reset_flow_hash(sk->sk_rxhash);
+#endif
  }

A lot better style would be:

No, the functions have to be available, but have a NOP implementation.

maintainer
#6 lore raw
In reply to Sergei Shtylyov

From: Sergei Shtylyov <[email protected]>
Date: Wed, 01 Jan 2014 01:03:18 +0300

Quoted 26 lines

Hello.

Quoted 22 lines · Zhi Yong Wu

From: Zhi Yong Wu <[email protected]>

---
  include/net/sock.h |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)
include/net/sock.h +2 -0
index 8ee90ad..bd716b6 100644
@@ -846,12 +846,16 @@ static inline void
 sock_rps_reset_flow_hash(__u32 hash)
 
  static inline void sock_rps_record_flow(const struct sock *sk)
  {
+#ifdef CONFIG_RPS
  	sock_rps_record_flow_hash(sk->sk_rxhash);
+#endif
  }
 
Quoted 8 lines

include/net/sock.h static inline void sock_rps_reset_flow_hash(__u32 hash) · line 859

Quoted 6 lines
include/net/sock.h +2 -0
  static inline void sock_rps_reset_flow(const struct sock *sk)
  {
+#ifdef CONFIG_RPS
  	sock_rps_reset_flow_hash(sk->sk_rxhash);
+#endif
  }

A lot better style would be:

Sorry, I meant to say, this is consistent with how the other functions dependent upon RPS are handled.

#3 lore raw
In reply to David Miller
Quoted 22 lines · David Miller

From: David Miller <[email protected]>
Date: Tue, 31 Dec 2013 15:54:59 -0500 (EST)

Quoted 15 lines

From: Zhi Yong Wu <[email protected]>
Date: Wed, 1 Jan 2014 04:31:01 +0800

include/net/sock.h static inline void sock_rps_reset_flow_hash(__u32 hash) · line 852

Quoted 8 lines
include/net/sock.h +2 -0
@@ -846,12 +846,16 @@ static inline void sock_rps_reset_flow_hash(__u32 hash)
 
 static inline void sock_rps_record_flow(const struct sock *sk)
 {
+#ifdef CONFIG_RPS
     sock_rps_record_flow_hash(sk->sk_rxhash);
+#endif
 }

Why is this necessary? sock_rps_record_flow_hash() is provided unconditionally, regardless of CONFIG_RPS.

Quoted 3 lines

I'm not applying this, it doesn't make any sense. Either there is no build failure, or the existing CONFIG_RPS ifdef inside of the implementation of sock_rps_record_flow_hash() is bogus.

Quoted 6 lines

Ok, if you had actually provided the build failure log message I'd be able to evaluate this patch much better.

The real issue is the lack of sk_rxhash when RPS is not enabled.

I'm going to apply this with the build failure message mentioned.

I noticed that you have added the build failure log message in your net-next tree.
That is, i needn't do anything now, thanks.

Signature · 3 lines
Regards,

Zhi Yong Wu