diff mbox series

[net] net: rps: fix error when CONFIG_RFS_ACCEL is off

Message ID 20240530032717.57787-1-kerneljasonxing@gmail.com (mailing list archive)
State Accepted
Commit 8105378c0c02309221b63d15cfe8fe92e7fe1434
Delegated to: Netdev Maintainers
Headers show
Series [net] net: rps: fix error when CONFIG_RFS_ACCEL is off | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 909 this patch: 909
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 906 this patch: 906
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 913 this patch: 913
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 79 this patch: 79
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-05-30--06-00 (tests: 1042)

Commit Message

Jason Xing May 30, 2024, 3:27 a.m. UTC
From: Jason Xing <kernelxing@tencent.com>

John Sperbeck reported that if we turn off CONFIG_RFS_ACCEL, the 'head'
is not defined, which will trigger compile error. So I move the 'head'
out of the CONFIG_RFS_ACCEL scope.

Fixes: 84b6823cd96b ("net: rps: protect last_qtail with rps_input_queue_tail_save() helper")
Reported-by: John Sperbeck <jsperbeck@google.com>
Closes: https://lore.kernel.org/all/20240529203421.2432481-1-jsperbeck@google.com/
Signed-off-by: Jason Xing <kernelxing@tencent.com>
---
 net/core/dev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Eric Dumazet May 30, 2024, 4:44 a.m. UTC | #1
On Thu, May 30, 2024 at 5:28 AM Jason Xing <kerneljasonxing@gmail.com> wrote:
>
> From: Jason Xing <kernelxing@tencent.com>
>
> John Sperbeck reported that if we turn off CONFIG_RFS_ACCEL, the 'head'
> is not defined, which will trigger compile error. So I move the 'head'
> out of the CONFIG_RFS_ACCEL scope.
>
> Fixes: 84b6823cd96b ("net: rps: protect last_qtail with rps_input_queue_tail_save() helper")
> Reported-by: John Sperbeck <jsperbeck@google.com>
> Closes: https://lore.kernel.org/all/20240529203421.2432481-1-jsperbeck@google.com/
> Signed-off-by: Jason Xing <kernelxing@tencent.com>

Reviewed-by: Eric Dumazet <edumazet@google.com>

Thanks John and Jason !
patchwork-bot+netdevbpf@kernel.org June 1, 2024, 11:40 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 30 May 2024 11:27:17 +0800 you wrote:
> From: Jason Xing <kernelxing@tencent.com>
> 
> John Sperbeck reported that if we turn off CONFIG_RFS_ACCEL, the 'head'
> is not defined, which will trigger compile error. So I move the 'head'
> out of the CONFIG_RFS_ACCEL scope.
> 
> Fixes: 84b6823cd96b ("net: rps: protect last_qtail with rps_input_queue_tail_save() helper")
> Reported-by: John Sperbeck <jsperbeck@google.com>
> Closes: https://lore.kernel.org/all/20240529203421.2432481-1-jsperbeck@google.com/
> Signed-off-by: Jason Xing <kernelxing@tencent.com>
> 
> [...]

Here is the summary with links:
  - [net] net: rps: fix error when CONFIG_RFS_ACCEL is off
    https://git.kernel.org/netdev/net/c/8105378c0c02

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/core/dev.c b/net/core/dev.c
index 85fe8138f3e4..e62698c7a0e6 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4516,12 +4516,13 @@  set_rps_cpu(struct net_device *dev, struct sk_buff *skb,
 	    struct rps_dev_flow *rflow, u16 next_cpu)
 {
 	if (next_cpu < nr_cpu_ids) {
+		u32 head;
 #ifdef CONFIG_RFS_ACCEL
 		struct netdev_rx_queue *rxqueue;
 		struct rps_dev_flow_table *flow_table;
 		struct rps_dev_flow *old_rflow;
-		u32 flow_id, head;
 		u16 rxq_index;
+		u32 flow_id;
 		int rc;
 
 		/* Should we steer this flow to a different hardware queue? */