Commit 649091ef authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski
Browse files

tcp: reclaim 8 bytes in struct request_sock_queue



synflood_warned had to be u32 for xchg(), but ensuring
atomicity is not really needed.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20250919204856.2977245-9-edumazet@google.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 31c4511b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -185,8 +185,8 @@ struct fastopen_queue {
struct request_sock_queue {
	spinlock_t		rskq_lock;
	u8			rskq_defer_accept;
	u8			synflood_warned;

	u32			synflood_warned;
	atomic_t		qlen;
	atomic_t		young;

+2 −2
Original line number Diff line number Diff line
@@ -7282,8 +7282,8 @@ static bool tcp_syn_flood_action(struct sock *sk, const char *proto)
#endif
		__NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPREQQFULLDROP);

	if (!READ_ONCE(queue->synflood_warned) && syncookies != 2 &&
	    xchg(&queue->synflood_warned, 1) == 0) {
	if (syncookies != 2 && !READ_ONCE(queue->synflood_warned)) {
		WRITE_ONCE(queue->synflood_warned, 1);
		if (IS_ENABLED(CONFIG_IPV6) && sk->sk_family == AF_INET6) {
			net_info_ratelimited("%s: Possible SYN flooding on port [%pI6c]:%u. %s.\n",
					proto, inet6_rcv_saddr(sk),