netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] tcp: delete redundant calls of tcp_mtup_init() and
@ 2014-01-12  7:54 Weiping Pan
  2014-01-12  7:54 ` [PATCH net 1/2] tcp: delete redundant calls of tcp_mtup_init() Weiping Pan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Weiping Pan @ 2014-01-12  7:54 UTC (permalink / raw)
  To: netdev

I find that both tcp_v4_syn_recv_sock() and tcp_v6_syn_recv_sock() call them
for new sock, so delete redundant calls of them. 

Weiping Pan (2):
  tcp: delete redundant calls of tcp_mtup_init()
  tcp: delete redundant call of tcp_initialize_rcv_mss()

 net/ipv4/tcp_input.c |    2 --
 net/ipv4/tcp_ipv4.c  |    1 -
 2 files changed, 0 insertions(+), 3 deletions(-)

-- 
1.7.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net 1/2] tcp: delete redundant calls of tcp_mtup_init()
  2014-01-12  7:54 [PATCH net 0/2] tcp: delete redundant calls of tcp_mtup_init() and Weiping Pan
@ 2014-01-12  7:54 ` Weiping Pan
  2014-01-12  7:54 ` [PATCH net 2/2] tcp: delete redundant call of tcp_initialize_rcv_mss() Weiping Pan
  2014-01-15  0:41 ` [PATCH net 0/2] tcp: delete redundant calls of tcp_mtup_init() and David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Weiping Pan @ 2014-01-12  7:54 UTC (permalink / raw)
  To: netdev

As both tcp_v4_syn_recv_sock() and tcp_v6_syn_recv_sock() already call
tcp_mtup_init() for new sock, the calls of it in tcp_rcv_state_process() and
tcp_v4_conn_req_fastopen() are redundant.

Signed-off-by: Weiping Pan <panweiping3@gmail.com>
---
 net/ipv4/tcp_input.c |    1 -
 net/ipv4/tcp_ipv4.c  |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index c53b7f3..8add6bc 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5731,7 +5731,6 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
 			icsk->icsk_af_ops->rebuild_header(sk);
 			tcp_init_congestion_control(sk);
 
-			tcp_mtup_init(sk);
 			tp->copied_seq = tp->rcv_nxt;
 			tcp_init_buffer_space(sk);
 		}
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 0672139..6578047 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1410,7 +1410,6 @@ static int tcp_v4_conn_req_fastopen(struct sock *sk,
 	/* Now finish processing the fastopen child socket. */
 	inet_csk(child)->icsk_af_ops->rebuild_header(child);
 	tcp_init_congestion_control(child);
-	tcp_mtup_init(child);
 	tcp_init_metrics(child);
 	tcp_init_buffer_space(child);
 
-- 
1.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net 2/2] tcp: delete redundant call of tcp_initialize_rcv_mss()
  2014-01-12  7:54 [PATCH net 0/2] tcp: delete redundant calls of tcp_mtup_init() and Weiping Pan
  2014-01-12  7:54 ` [PATCH net 1/2] tcp: delete redundant calls of tcp_mtup_init() Weiping Pan
@ 2014-01-12  7:54 ` Weiping Pan
  2014-01-15  0:41 ` [PATCH net 0/2] tcp: delete redundant calls of tcp_mtup_init() and David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Weiping Pan @ 2014-01-12  7:54 UTC (permalink / raw)
  To: netdev

As both tcp_v4_syn_recv_sock() and tcp_v6_syn_recv_sock() already call
tcp_initialize_rcv_mss() for new sock, the call of it in tcp_rcv_state_process()
is redundant.

Signed-off-by: Weiping Pan <panweiping3@gmail.com>
---
 net/ipv4/tcp_input.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 8add6bc..8a2b5c7 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5771,7 +5771,6 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
 		/* Prevent spurious tcp_cwnd_restart() on first data packet */
 		tp->lsndtime = tcp_time_stamp;
 
-		tcp_initialize_rcv_mss(sk);
 		tcp_fast_path_on(tp);
 		break;
 
-- 
1.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net 0/2] tcp: delete redundant calls of tcp_mtup_init() and
  2014-01-12  7:54 [PATCH net 0/2] tcp: delete redundant calls of tcp_mtup_init() and Weiping Pan
  2014-01-12  7:54 ` [PATCH net 1/2] tcp: delete redundant calls of tcp_mtup_init() Weiping Pan
  2014-01-12  7:54 ` [PATCH net 2/2] tcp: delete redundant call of tcp_initialize_rcv_mss() Weiping Pan
@ 2014-01-15  0:41 ` David Miller
  2014-01-19 12:44   ` [PATCH net v2] tcp: delete redundant calls of tcp_mtup_init() Weiping Pan
  2 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2014-01-15  0:41 UTC (permalink / raw)
  To: panweiping3; +Cc: netdev

From: Weiping Pan <panweiping3@gmail.com>
Date: Sun, 12 Jan 2014 15:54:29 +0800

> I find that both tcp_v4_syn_recv_sock() and tcp_v6_syn_recv_sock() call them
> for new sock, so delete redundant calls of them. 
> 
> Weiping Pan (2):
>   tcp: delete redundant calls of tcp_mtup_init()
>   tcp: delete redundant call of tcp_initialize_rcv_mss()

I do not agree with the approach of these two patches.

It is better to have tcp_rcv_state_process() (one location) make these
calls rather than each and every inet sock operations instance.

Therefore you should remove the calls from tcp_v{4,6}_recv_sock() and
keep the one in tcp_rcv_state_process().

Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net v2] tcp: delete redundant calls of tcp_mtup_init()
  2014-01-15  0:41 ` [PATCH net 0/2] tcp: delete redundant calls of tcp_mtup_init() and David Miller
@ 2014-01-19 12:44   ` Weiping Pan
  2014-01-22  0:52     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Weiping Pan @ 2014-01-19 12:44 UTC (permalink / raw)
  To: davem, netdev; +Cc: Weiping Pan

As tcp_rcv_state_process() has already calls tcp_mtup_init() for non-fastopen
sock, we can delete the redundant calls of tcp_mtup_init() in
tcp_{v4,v6}_syn_recv_sock().

Signed-off-by: Weiping Pan <panweiping3@gmail.com>
---
 net/ipv4/tcp_ipv4.c |    1 -
 net/ipv6/tcp_ipv6.c |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 0672139..4176606 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1668,7 +1668,6 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
 	}
 	sk_setup_caps(newsk, dst);
 
-	tcp_mtup_init(newsk);
 	tcp_sync_mss(newsk, dst_mtu(dst));
 	newtp->advmss = dst_metric_advmss(dst);
 	if (tcp_sk(sk)->rx_opt.user_mss &&
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index f67033b..c5b0e1f 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1230,7 +1230,6 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
 		inet_csk(newsk)->icsk_ext_hdr_len = (newnp->opt->opt_nflen +
 						     newnp->opt->opt_flen);
 
-	tcp_mtup_init(newsk);
 	tcp_sync_mss(newsk, dst_mtu(dst));
 	newtp->advmss = dst_metric_advmss(dst);
 	if (tcp_sk(sk)->rx_opt.user_mss &&
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net v2] tcp: delete redundant calls of tcp_mtup_init()
  2014-01-19 12:44   ` [PATCH net v2] tcp: delete redundant calls of tcp_mtup_init() Weiping Pan
@ 2014-01-22  0:52     ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-01-22  0:52 UTC (permalink / raw)
  To: panweiping3; +Cc: netdev

From: Weiping Pan <panweiping3@gmail.com>
Date: Sun, 19 Jan 2014 20:44:46 +0800

> As tcp_rcv_state_process() has already calls tcp_mtup_init() for non-fastopen
> sock, we can delete the redundant calls of tcp_mtup_init() in
> tcp_{v4,v6}_syn_recv_sock().
> 
> Signed-off-by: Weiping Pan <panweiping3@gmail.com>

Looks good, applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-22  0:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-12  7:54 [PATCH net 0/2] tcp: delete redundant calls of tcp_mtup_init() and Weiping Pan
2014-01-12  7:54 ` [PATCH net 1/2] tcp: delete redundant calls of tcp_mtup_init() Weiping Pan
2014-01-12  7:54 ` [PATCH net 2/2] tcp: delete redundant call of tcp_initialize_rcv_mss() Weiping Pan
2014-01-15  0:41 ` [PATCH net 0/2] tcp: delete redundant calls of tcp_mtup_init() and David Miller
2014-01-19 12:44   ` [PATCH net v2] tcp: delete redundant calls of tcp_mtup_init() Weiping Pan
2014-01-22  0:52     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).