aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-10-08 22:33:23 -0400
committerDavid S. Miller <davem@davemloft.net>2015-10-12 22:28:22 -0400
commited53d0ab761f5c71d77c8dc05fd19c0a851200db (patch)
treee8020f7b24c958497a92b38fbf0dd89e99b8261e /net/ipv4
parent8e5eb54d303b7cb1174977ca79030e135728c95e (diff)
net: shrink struct sock and request_sock by 8 bytes
One 32bit hole is following skc_refcnt, use it. skc_incoming_cpu can also be an union for request_sock rcv_wnd. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/syncookies.c4
-rw-r--r--net/ipv4/tcp_input.c2
-rw-r--r--net/ipv4/tcp_ipv4.c2
-rw-r--r--net/ipv4/tcp_minisocks.c18
-rw-r--r--net/ipv4/tcp_output.c2
5 files changed, 14 insertions, 14 deletions
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 2dbb11331f6c..4c0892badb8b 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -382,10 +382,10 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
382 } 382 }
383 383
384 /* Try to redo what tcp_v4_send_synack did. */ 384 /* Try to redo what tcp_v4_send_synack did. */
385 req->window_clamp = tp->window_clamp ? :dst_metric(&rt->dst, RTAX_WINDOW); 385 req->rsk_window_clamp = tp->window_clamp ? :dst_metric(&rt->dst, RTAX_WINDOW);
386 386
387 tcp_select_initial_window(tcp_full_space(sk), req->mss, 387 tcp_select_initial_window(tcp_full_space(sk), req->mss,
388 &req->rcv_wnd, &req->window_clamp, 388 &req->rsk_rcv_wnd, &req->rsk_window_clamp,
389 ireq->wscale_ok, &rcv_wscale, 389 ireq->wscale_ok, &rcv_wscale,
390 dst_metric(&rt->dst, RTAX_INITRWND)); 390 dst_metric(&rt->dst, RTAX_INITRWND));
391 391
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index ddadb318e850..3b35c3f4d268 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6022,7 +6022,7 @@ static void tcp_openreq_init(struct request_sock *req,
6022{ 6022{
6023 struct inet_request_sock *ireq = inet_rsk(req); 6023 struct inet_request_sock *ireq = inet_rsk(req);
6024 6024
6025 req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */ 6025 req->rsk_rcv_wnd = 0; /* So that tcp_send_synack() knows! */
6026 req->cookie_ts = 0; 6026 req->cookie_ts = 0;
6027 tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq; 6027 tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq;
6028 tcp_rsk(req)->rcv_nxt = TCP_SKB_CB(skb)->seq + 1; 6028 tcp_rsk(req)->rcv_nxt = TCP_SKB_CB(skb)->seq + 1;
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 34310748a365..ddb198392c7f 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -803,7 +803,7 @@ static void tcp_v4_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb,
803 */ 803 */
804 tcp_v4_send_ack(skb, (sk->sk_state == TCP_LISTEN) ? 804 tcp_v4_send_ack(skb, (sk->sk_state == TCP_LISTEN) ?
805 tcp_rsk(req)->snt_isn + 1 : tcp_sk(sk)->snd_nxt, 805 tcp_rsk(req)->snt_isn + 1 : tcp_sk(sk)->snd_nxt,
806 tcp_rsk(req)->rcv_nxt, req->rcv_wnd, 806 tcp_rsk(req)->rcv_nxt, req->rsk_rcv_wnd,
807 tcp_time_stamp, 807 tcp_time_stamp,
808 req->ts_recent, 808 req->ts_recent,
809 0, 809 0,
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 1079e6ad77fe..41828bdc5d32 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -381,18 +381,18 @@ void tcp_openreq_init_rwin(struct request_sock *req,
381 381
382 window_clamp = READ_ONCE(tp->window_clamp); 382 window_clamp = READ_ONCE(tp->window_clamp);
383 /* Set this up on the first call only */ 383 /* Set this up on the first call only */
384 req->window_clamp = window_clamp ? : dst_metric(dst, RTAX_WINDOW); 384 req->rsk_window_clamp = window_clamp ? : dst_metric(dst, RTAX_WINDOW);
385 385
386 /* limit the window selection if the user enforce a smaller rx buffer */ 386 /* limit the window selection if the user enforce a smaller rx buffer */
387 if (sk_listener->sk_userlocks & SOCK_RCVBUF_LOCK && 387 if (sk_listener->sk_userlocks & SOCK_RCVBUF_LOCK &&
388 (req->window_clamp > full_space || req->window_clamp == 0)) 388 (req->rsk_window_clamp > full_space || req->rsk_window_clamp == 0))
389 req->window_clamp = full_space; 389 req->rsk_window_clamp = full_space;
390 390
391 /* tcp_full_space because it is guaranteed to be the first packet */ 391 /* tcp_full_space because it is guaranteed to be the first packet */
392 tcp_select_initial_window(full_space, 392 tcp_select_initial_window(full_space,
393 mss - (ireq->tstamp_ok ? TCPOLEN_TSTAMP_ALIGNED : 0), 393 mss - (ireq->tstamp_ok ? TCPOLEN_TSTAMP_ALIGNED : 0),
394 &req->rcv_wnd, 394 &req->rsk_rcv_wnd,
395 &req->window_clamp, 395 &req->rsk_window_clamp,
396 ireq->wscale_ok, 396 ireq->wscale_ok,
397 &rcv_wscale, 397 &rcv_wscale,
398 dst_metric(dst, RTAX_INITRWND)); 398 dst_metric(dst, RTAX_INITRWND));
@@ -512,9 +512,9 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,
512 if (sysctl_tcp_fack) 512 if (sysctl_tcp_fack)
513 tcp_enable_fack(newtp); 513 tcp_enable_fack(newtp);
514 } 514 }
515 newtp->window_clamp = req->window_clamp; 515 newtp->window_clamp = req->rsk_window_clamp;
516 newtp->rcv_ssthresh = req->rcv_wnd; 516 newtp->rcv_ssthresh = req->rsk_rcv_wnd;
517 newtp->rcv_wnd = req->rcv_wnd; 517 newtp->rcv_wnd = req->rsk_rcv_wnd;
518 newtp->rx_opt.wscale_ok = ireq->wscale_ok; 518 newtp->rx_opt.wscale_ok = ireq->wscale_ok;
519 if (newtp->rx_opt.wscale_ok) { 519 if (newtp->rx_opt.wscale_ok) {
520 newtp->rx_opt.snd_wscale = ireq->snd_wscale; 520 newtp->rx_opt.snd_wscale = ireq->snd_wscale;
@@ -707,7 +707,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
707 /* RFC793: "first check sequence number". */ 707 /* RFC793: "first check sequence number". */
708 708
709 if (paws_reject || !tcp_in_window(TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq, 709 if (paws_reject || !tcp_in_window(TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq,
710 tcp_rsk(req)->rcv_nxt, tcp_rsk(req)->rcv_nxt + req->rcv_wnd)) { 710 tcp_rsk(req)->rcv_nxt, tcp_rsk(req)->rcv_nxt + req->rsk_rcv_wnd)) {
711 /* Out of window: send ACK and drop. */ 711 /* Out of window: send ACK and drop. */
712 if (!(flg & TCP_FLAG_RST)) 712 if (!(flg & TCP_FLAG_RST))
713 req->rsk_ops->send_ack(sk, skb, req); 713 req->rsk_ops->send_ack(sk, skb, req);
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 55ed3266b05f..6e79fcb0addb 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -3023,7 +3023,7 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst,
3023 th->ack_seq = htonl(tcp_rsk(req)->rcv_nxt); 3023 th->ack_seq = htonl(tcp_rsk(req)->rcv_nxt);
3024 3024
3025 /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */ 3025 /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */
3026 th->window = htons(min(req->rcv_wnd, 65535U)); 3026 th->window = htons(min(req->rsk_rcv_wnd, 65535U));
3027 tcp_options_write((__be32 *)(th + 1), NULL, &opts); 3027 tcp_options_write((__be32 *)(th + 1), NULL, &opts);
3028 th->doff = (tcp_header_size >> 2); 3028 th->doff = (tcp_header_size >> 2);
3029 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_OUTSEGS); 3029 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_OUTSEGS);