net, rps: fix build failure when CONFIG_RPS isn't set
Subsystems (3)
From: Zhi Yong Wu <[email protected]>
--- include/net/sock.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
include/net/sock.h +4 -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 }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
David Miller
maintainerFrom: 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.
David Miller
maintainerFrom: 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 +0800include/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 ofCONFIG_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_RPSifdef inside of the implementation ofsock_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.
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 +0800include/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 ofCONFIG_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_RPSifdef inside of the implementation ofsock_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_rxhashwhen 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
Hello.
Quoted 17 lines · Zhi Yong Wu
From: Zhi Yong Wu <[email protected]>
Reported-by Fengguang Wu <[email protected]>Signed-off-by Zhi Yong Wu <[email protected]>--- include/net/sock.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)include/net/sock.h +1
-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
include/net/sock.h static inline void sock_rps_reset_flow_hash(__u32 hash) · line 859
Quoted 10 lines
include/net/sock.h +3
-0sock_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
David Miller
maintainerFrom: 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]>
Reported-by Fengguang Wu <[email protected]>Signed-off-by Zhi Yong Wu <[email protected]>--- include/net/sock.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)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 }
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
-0static 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.
David Miller
maintainerFrom: 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]>
Reported-by Fengguang Wu <[email protected]>Signed-off-by Zhi Yong Wu <[email protected]>--- include/net/sock.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)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 }
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
-0static 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.