mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
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>
This commit is contained in:
parent
77dc4a72b0
commit
d5c5391554
3 changed files with 9 additions and 26 deletions
|
|
@ -196,8 +196,6 @@ struct request_sock_queue {
|
|||
*/
|
||||
};
|
||||
|
||||
void reqsk_queue_alloc(struct request_sock_queue *queue);
|
||||
|
||||
void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req,
|
||||
bool reset);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,30 +16,6 @@
|
|||
|
||||
#include <net/request_sock.h>
|
||||
|
||||
/*
|
||||
* Maximum number of SYN_RECV sockets in queue per LISTEN socket.
|
||||
* One SYN_RECV socket costs about 80bytes on a 32bit machine.
|
||||
* It would be better to replace it with a global counter for all sockets
|
||||
* but then some measure against one socket starving all other sockets
|
||||
* would be needed.
|
||||
*
|
||||
* The minimum value of it is 128. Experiments with real servers show that
|
||||
* it is absolutely not enough even at 100conn/sec. 256 cures most
|
||||
* of problems.
|
||||
* This value is adjusted to 128 for low memory machines,
|
||||
* and it will increase in proportion to the memory of machine.
|
||||
* Note : Dont forget somaxconn that may limit backlog too.
|
||||
*/
|
||||
|
||||
void reqsk_queue_alloc(struct request_sock_queue *queue)
|
||||
{
|
||||
queue->fastopenq.rskq_rst_head = NULL;
|
||||
queue->fastopenq.rskq_rst_tail = NULL;
|
||||
queue->fastopenq.qlen = 0;
|
||||
|
||||
queue->rskq_accept_head = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is called to set a Fast Open socket's "fastopen_rsk" field
|
||||
* to NULL when a TFO socket no longer needs to access the request_sock.
|
||||
|
|
|
|||
|
|
@ -1314,6 +1314,15 @@ static int inet_ulp_can_listen(const struct sock *sk)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void reqsk_queue_alloc(struct request_sock_queue *queue)
|
||||
{
|
||||
queue->fastopenq.rskq_rst_head = NULL;
|
||||
queue->fastopenq.rskq_rst_tail = NULL;
|
||||
queue->fastopenq.qlen = 0;
|
||||
|
||||
queue->rskq_accept_head = NULL;
|
||||
}
|
||||
|
||||
int inet_csk_listen_start(struct sock *sk)
|
||||
{
|
||||
struct inet_connection_sock *icsk = inet_csk(sk);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue