diff mbox series

[net-next] tcp/dccp: complete lockless accesses to sk->sk_max_ack_backlog

Message ID 20240331090521.71965-1-kerneljasonxing@gmail.com (mailing list archive)
State Accepted
Commit 9a79c65f00e2b036e17af3a3a607d7d732b7affb
Delegated to: Netdev Maintainers
Headers show
Series [net-next] tcp/dccp: complete lockless accesses to sk->sk_max_ack_backlog | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2970 this patch: 2970
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 998 this patch: 998
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 No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 3162 this patch: 3162
netdev/checkpatch warning WARNING: line length of 81 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-01--00-00 (tests: 952)

Commit Message

Jason Xing March 31, 2024, 9:05 a.m. UTC
From: Jason Xing <kernelxing@tencent.com>

Since commit 099ecf59f05b ("net: annotate lockless accesses to
sk->sk_max_ack_backlog") decided to handle the sk_max_ack_backlog
locklessly, there is one more function mostly called in TCP/DCCP
cases. So this patch completes it:)

Signed-off-by: Jason Xing <kernelxing@tencent.com>
---
 include/net/inet_connection_sock.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Dumazet April 1, 2024, 4:33 p.m. UTC | #1
On Sun, Mar 31, 2024 at 11:05 AM Jason Xing <kerneljasonxing@gmail.com> wrote:
>
> From: Jason Xing <kernelxing@tencent.com>
>
> Since commit 099ecf59f05b ("net: annotate lockless accesses to
> sk->sk_max_ack_backlog") decided to handle the sk_max_ack_backlog
> locklessly, there is one more function mostly called in TCP/DCCP
> cases. So this patch completes it:)
>
> Signed-off-by: Jason Xing <kernelxing@tencent.com>
>

Reviewed-by: Eric Dumazet <edumazet@google.com>
patchwork-bot+netdevbpf@kernel.org April 3, 2024, 1:40 a.m. UTC | #2
Hello:

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

On Sun, 31 Mar 2024 17:05:21 +0800 you wrote:
> From: Jason Xing <kernelxing@tencent.com>
> 
> Since commit 099ecf59f05b ("net: annotate lockless accesses to
> sk->sk_max_ack_backlog") decided to handle the sk_max_ack_backlog
> locklessly, there is one more function mostly called in TCP/DCCP
> cases. So this patch completes it:)
> 
> [...]

Here is the summary with links:
  - [net-next] tcp/dccp: complete lockless accesses to sk->sk_max_ack_backlog
    https://git.kernel.org/netdev/net-next/c/9a79c65f00e2

You are awesome, thank you!
diff mbox series

Patch

diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index ccf171f7eb60..d94f787fdf40 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -284,7 +284,7 @@  static inline int inet_csk_reqsk_queue_len(const struct sock *sk)
 
 static inline int inet_csk_reqsk_queue_is_full(const struct sock *sk)
 {
-	return inet_csk_reqsk_queue_len(sk) >= sk->sk_max_ack_backlog;
+	return inet_csk_reqsk_queue_len(sk) >= READ_ONCE(sk->sk_max_ack_backlog);
 }
 
 bool inet_csk_reqsk_queue_drop(struct sock *sk, struct request_sock *req);