summaryrefslogtreecommitdiff
path: root/include/net/request_sock.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-10-02 11:43:36 -0700
committerDavid S. Miller <davem@davemloft.net>2015-10-03 04:32:43 -0700
commit10cbc8f179177c1a6d5f56a46ebddc8f602ce5ac (patch)
treebf85cccd8ce732549605df96d909908d03e5932d /include/net/request_sock.h
parentca6fb06518836ef9b65dc0aac02ff97704d52a05 (diff)
tcp/dccp: remove struct listen_sock
It is enough to check listener sk_state, no need for an extra condition. max_qlen_log can be moved into struct request_sock_queue We can remove syn_wait_lock and the alignment it enforced. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/request_sock.h')
-rw-r--r--include/net/request_sock.h26
1 files changed, 4 insertions, 22 deletions
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index 353cb61bb399..a66ab1345373 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -119,14 +119,6 @@ static inline void reqsk_put(struct request_sock *req)
extern int sysctl_max_syn_backlog;
-/** struct listen_sock - listen state
- *
- * @max_qlen_log - log_2 of maximal queued SYNs/REQUESTs
- */
-struct listen_sock {
- u32 max_qlen_log;
-};
-
/*
* For a TCP Fast Open listener -
* lock - protects the access to all the reqsk, which is co-owned by
@@ -160,36 +152,26 @@ struct fastopen_queue {
* @rskq_accept_head - FIFO head of established children
* @rskq_accept_tail - FIFO tail of established children
* @rskq_defer_accept - User waits for some data after accept()
- * @syn_wait_lock - serializer
- *
- * %syn_wait_lock is necessary only to avoid proc interface having to grab the main
- * lock sock while browsing the listening hash (otherwise it's deadlock prone).
*
*/
struct request_sock_queue {
spinlock_t rskq_lock;
u8 rskq_defer_accept;
+ u8 max_qlen_log;
u32 synflood_warned;
-
atomic_t qlen;
atomic_t young;
struct request_sock *rskq_accept_head;
struct request_sock *rskq_accept_tail;
- struct listen_sock *listen_opt;
struct fastopen_queue fastopenq; /* Check max_qlen != 0 to determine
* if TFO is enabled.
*/
-
- /* temporary alignment, our goal is to get rid of this lock */
- spinlock_t syn_wait_lock ____cacheline_aligned_in_smp;
};
-int reqsk_queue_alloc(struct request_sock_queue *queue,
- unsigned int nr_table_entries);
+void reqsk_queue_alloc(struct request_sock_queue *queue,
+ unsigned int nr_table_entries);
-void __reqsk_queue_destroy(struct request_sock_queue *queue);
-void reqsk_queue_destroy(struct request_sock_queue *queue);
void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req,
bool reset);
@@ -260,7 +242,7 @@ static inline int reqsk_queue_len_young(const struct request_sock_queue *queue)
static inline int reqsk_queue_is_full(const struct request_sock_queue *queue)
{
- return reqsk_queue_len(queue) >> queue->listen_opt->max_qlen_log;
+ return reqsk_queue_len(queue) >> queue->max_qlen_log;
}
#endif /* _REQUEST_SOCK_H */