lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 14 May 2014 14:08:28 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	panweiping3@...il.com
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH net] tcp: set retransmit_high on loop exit

From: Weiping Pan <panweiping3@...il.com>
Date: Sun, 11 May 2014 20:57:30 +0800

> To save some CPU cycles slightly.
> 
> Signed-off-by: Weiping Pan <panweiping3@...il.com>

Can a TCP expert please review this?

> ---
>  net/ipv4/tcp_input.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index d6b46eb..e431037 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -1941,8 +1941,13 @@ void tcp_enter_loss(struct sock *sk, int how)
>  	tcp_clear_all_retrans_hints(tp);
>  
>  	tcp_for_write_queue(skb, sk) {
> -		if (skb == tcp_send_head(sk))
> +		if (skb == tcp_send_head(sk)) {
> +			if (skb != tcp_write_queue_head(sk)) {
> +				skb = tcp_write_queue_prev(sk, skb);
> +				tp->retransmit_high = TCP_SKB_CB(skb)->end_seq;
> +			}
>  			break;
> +		}
>  
>  		if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS)
>  			tp->undo_marker = 0;
> @@ -1952,7 +1957,6 @@ void tcp_enter_loss(struct sock *sk, int how)
>  			TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_ACKED;
>  			TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
>  			tp->lost_out += tcp_skb_pcount(skb);
> -			tp->retransmit_high = TCP_SKB_CB(skb)->end_seq;
>  		}
>  	}
>  	tcp_verify_left_out(tp);
> -- 
> 1.9.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ