Skip to content

Commit d5c5391

Browse files
edumazetkuba-moo
authored andcommitted
inet: move reqsk_queue_alloc() to net/ipv4/inet_connection_sock.c
Only called once from inet_csk_listen_start(), it can be static. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20260204055147.1682705-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 77dc4a7 commit d5c5391

3 files changed

Lines changed: 9 additions & 26 deletions

File tree

include/net/request_sock.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@ struct request_sock_queue {
196196
*/
197197
};
198198

199-
void reqsk_queue_alloc(struct request_sock_queue *queue);
200-
201199
void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req,
202200
bool reset);
203201

net/core/request_sock.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,6 @@
1616

1717
#include <net/request_sock.h>
1818

19-
/*
20-
* Maximum number of SYN_RECV sockets in queue per LISTEN socket.
21-
* One SYN_RECV socket costs about 80bytes on a 32bit machine.
22-
* It would be better to replace it with a global counter for all sockets
23-
* but then some measure against one socket starving all other sockets
24-
* would be needed.
25-
*
26-
* The minimum value of it is 128. Experiments with real servers show that
27-
* it is absolutely not enough even at 100conn/sec. 256 cures most
28-
* of problems.
29-
* This value is adjusted to 128 for low memory machines,
30-
* and it will increase in proportion to the memory of machine.
31-
* Note : Dont forget somaxconn that may limit backlog too.
32-
*/
33-
34-
void reqsk_queue_alloc(struct request_sock_queue *queue)
35-
{
36-
queue->fastopenq.rskq_rst_head = NULL;
37-
queue->fastopenq.rskq_rst_tail = NULL;
38-
queue->fastopenq.qlen = 0;
39-
40-
queue->rskq_accept_head = NULL;
41-
}
42-
4319
/*
4420
* This function is called to set a Fast Open socket's "fastopen_rsk" field
4521
* to NULL when a TFO socket no longer needs to access the request_sock.

net/ipv4/inet_connection_sock.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,15 @@ static int inet_ulp_can_listen(const struct sock *sk)
13141314
return 0;
13151315
}
13161316

1317+
static void reqsk_queue_alloc(struct request_sock_queue *queue)
1318+
{
1319+
queue->fastopenq.rskq_rst_head = NULL;
1320+
queue->fastopenq.rskq_rst_tail = NULL;
1321+
queue->fastopenq.qlen = 0;
1322+
1323+
queue->rskq_accept_head = NULL;
1324+
}
1325+
13171326
int inet_csk_listen_start(struct sock *sk)
13181327
{
13191328
struct inet_connection_sock *icsk = inet_csk(sk);

0 commit comments

Comments
 (0)