Commit 72018835 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by David S. Miller

[TCP]: Cleanup local variables of clean_rtx_queue

Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ea60658c
...@@ -2765,8 +2765,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p, ...@@ -2765,8 +2765,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
u32 now = tcp_time_stamp; u32 now = tcp_time_stamp;
int fully_acked = 1; int fully_acked = 1;
int flag = 0; int flag = 0;
int prior_packets = tp->packets_out; u32 pkts_acked = 0;
u32 cnt = 0;
u32 reord = tp->packets_out; u32 reord = tp->packets_out;
s32 seq_rtt = -1; s32 seq_rtt = -1;
s32 ca_seq_rtt = -1; s32 ca_seq_rtt = -1;
...@@ -2775,7 +2774,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p, ...@@ -2775,7 +2774,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
while ((skb = tcp_write_queue_head(sk)) && skb != tcp_send_head(sk)) { while ((skb = tcp_write_queue_head(sk)) && skb != tcp_send_head(sk)) {
struct tcp_skb_cb *scb = TCP_SKB_CB(skb); struct tcp_skb_cb *scb = TCP_SKB_CB(skb);
u32 end_seq; u32 end_seq;
u32 packets_acked; u32 acked_pcount;
u8 sacked = scb->sacked; u8 sacked = scb->sacked;
/* Determine how many packets and what bytes were acked, tso and else */ /* Determine how many packets and what bytes were acked, tso and else */
...@@ -2784,14 +2783,14 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p, ...@@ -2784,14 +2783,14 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
!after(tp->snd_una, scb->seq)) !after(tp->snd_una, scb->seq))
break; break;
packets_acked = tcp_tso_acked(sk, skb); acked_pcount = tcp_tso_acked(sk, skb);
if (!packets_acked) if (!acked_pcount)
break; break;
fully_acked = 0; fully_acked = 0;
end_seq = tp->snd_una; end_seq = tp->snd_una;
} else { } else {
packets_acked = tcp_skb_pcount(skb); acked_pcount = tcp_skb_pcount(skb);
end_seq = scb->end_seq; end_seq = scb->end_seq;
} }
...@@ -2803,12 +2802,12 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p, ...@@ -2803,12 +2802,12 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
if (sacked & TCPCB_RETRANS) { if (sacked & TCPCB_RETRANS) {
if (sacked & TCPCB_SACKED_RETRANS) if (sacked & TCPCB_SACKED_RETRANS)
tp->retrans_out -= packets_acked; tp->retrans_out -= acked_pcount;
flag |= FLAG_RETRANS_DATA_ACKED; flag |= FLAG_RETRANS_DATA_ACKED;
ca_seq_rtt = -1; ca_seq_rtt = -1;
seq_rtt = -1; seq_rtt = -1;
if ((flag & FLAG_DATA_ACKED) || if ((flag & FLAG_DATA_ACKED) ||
(packets_acked > 1)) (acked_pcount > 1))
flag |= FLAG_NONHEAD_RETRANS_ACKED; flag |= FLAG_NONHEAD_RETRANS_ACKED;
} else { } else {
ca_seq_rtt = now - scb->when; ca_seq_rtt = now - scb->when;
...@@ -2817,20 +2816,20 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p, ...@@ -2817,20 +2816,20 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
seq_rtt = ca_seq_rtt; seq_rtt = ca_seq_rtt;
} }
if (!(sacked & TCPCB_SACKED_ACKED)) if (!(sacked & TCPCB_SACKED_ACKED))
reord = min(cnt, reord); reord = min(pkts_acked, reord);
} }
if (sacked & TCPCB_SACKED_ACKED) if (sacked & TCPCB_SACKED_ACKED)
tp->sacked_out -= packets_acked; tp->sacked_out -= acked_pcount;
if (sacked & TCPCB_LOST) if (sacked & TCPCB_LOST)
tp->lost_out -= packets_acked; tp->lost_out -= acked_pcount;
if (unlikely((sacked & TCPCB_URG) && tp->urg_mode && if (unlikely((sacked & TCPCB_URG) && tp->urg_mode &&
!before(end_seq, tp->snd_up))) !before(end_seq, tp->snd_up)))
tp->urg_mode = 0; tp->urg_mode = 0;
tp->packets_out -= packets_acked; tp->packets_out -= acked_pcount;
cnt += packets_acked; pkts_acked += acked_pcount;
/* Initial outgoing SYN's get put onto the write_queue /* Initial outgoing SYN's get put onto the write_queue
* just like anything else we transmit. It is not * just like anything else we transmit. It is not
...@@ -2855,7 +2854,6 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p, ...@@ -2855,7 +2854,6 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
} }
if (flag & FLAG_ACKED) { if (flag & FLAG_ACKED) {
u32 pkts_acked = prior_packets - tp->packets_out;
const struct tcp_congestion_ops *ca_ops const struct tcp_congestion_ops *ca_ops
= inet_csk(sk)->icsk_ca_ops; = inet_csk(sk)->icsk_ca_ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment