[net-next,1/2] tcp: remove redundant rcv_nxt update

Message ID 1531315019-3553-1-git-send-email-laoar.shao@gmail.com
State Changes Requested
Delegated to: David Miller
Headers show
Series
  • [net-next,1/2] tcp: remove redundant rcv_nxt update
Related show

Commit Message

Yafang Shao July 11, 2018, 1:16 p.m.
tcp_rcv_nxt_update() is already executed in tcp_data_queue().
This line is redundant.

See bellow,
	tcp_queue_rcv
		tcp_rcv_nxt_update(tcp_sk(sk), TCP_SKB_CB(skb)->end_seq);
	tcp_rcv_nxt_update(tp, TCP_SKB_CB(skb)->end_seq); <<<< redundant

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
 net/ipv4/tcp_input.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Eric Dumazet July 11, 2018, 5:01 p.m. | #1
On 07/11/2018 06:16 AM, Yafang Shao wrote:
> tcp_rcv_nxt_update() is already executed in tcp_data_queue().
> This line is redundant.
> 
> See bellow,
> 	tcp_queue_rcv
> 		tcp_rcv_nxt_update(tcp_sk(sk), TCP_SKB_CB(skb)->end_seq);
> 	tcp_rcv_nxt_update(tp, TCP_SKB_CB(skb)->end_seq); <<<< redundant
> 
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> ---

This patch is fine (but not the following)

Signed-off-by: Eric Dumazet <edumazet@google.com>

Thanks.

Patch

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 814ea43..3a54faf 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4695,7 +4695,6 @@  static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
 		}
 
 		eaten = tcp_queue_rcv(sk, skb, 0, &fragstolen);
-		tcp_rcv_nxt_update(tp, TCP_SKB_CB(skb)->end_seq);
 		if (skb->len)
 			tcp_event_data_recv(sk, skb);
 		if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)