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

[TCP]: reduce tcp_output's indentation levels a bit

Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4828e7f4
...@@ -1673,13 +1673,18 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m ...@@ -1673,13 +1673,18 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
{ {
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *next_skb = tcp_write_queue_next(sk, skb); struct sk_buff *next_skb = tcp_write_queue_next(sk, skb);
int skb_size, next_skb_size;
u16 flags;
/* The first test we must make is that neither of these two /* The first test we must make is that neither of these two
* SKB's are still referenced by someone else. * SKB's are still referenced by someone else.
*/ */
if (!skb_cloned(skb) && !skb_cloned(next_skb)) { if (skb_cloned(skb) || skb_cloned(next_skb))
int skb_size = skb->len, next_skb_size = next_skb->len; return;
u16 flags = TCP_SKB_CB(skb)->flags;
skb_size = skb->len;
next_skb_size = next_skb->len;
flags = TCP_SKB_CB(skb)->flags;
/* Also punt if next skb has been SACK'd. */ /* Also punt if next skb has been SACK'd. */
if (TCP_SKB_CB(next_skb)->sacked & TCPCB_SACKED_ACKED) if (TCP_SKB_CB(next_skb)->sacked & TCPCB_SACKED_ACKED)
...@@ -1697,16 +1702,14 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m ...@@ -1697,16 +1702,14 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
((skb_size + next_skb_size) > mss_now)) ((skb_size + next_skb_size) > mss_now))
return; return;
BUG_ON(tcp_skb_pcount(skb) != 1 || BUG_ON(tcp_skb_pcount(skb) != 1 || tcp_skb_pcount(next_skb) != 1);
tcp_skb_pcount(next_skb) != 1);
tcp_highest_sack_combine(sk, next_skb, skb); tcp_highest_sack_combine(sk, next_skb, skb);
/* Ok. We will be able to collapse the packet. */ /* Ok. We will be able to collapse the packet. */
tcp_unlink_write_queue(next_skb, sk); tcp_unlink_write_queue(next_skb, sk);
skb_copy_from_linear_data(next_skb, skb_copy_from_linear_data(next_skb, skb_put(skb, next_skb_size),
skb_put(skb, next_skb_size),
next_skb_size); next_skb_size);
if (next_skb->ip_summed == CHECKSUM_PARTIAL) if (next_skb->ip_summed == CHECKSUM_PARTIAL)
...@@ -1726,9 +1729,9 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m ...@@ -1726,9 +1729,9 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
* packet counting does not break. * packet counting does not break.
*/ */
TCP_SKB_CB(skb)->sacked |= TCP_SKB_CB(next_skb)->sacked & TCPCB_EVER_RETRANS; TCP_SKB_CB(skb)->sacked |= TCP_SKB_CB(next_skb)->sacked & TCPCB_EVER_RETRANS;
if (TCP_SKB_CB(next_skb)->sacked&TCPCB_SACKED_RETRANS) if (TCP_SKB_CB(next_skb)->sacked & TCPCB_SACKED_RETRANS)
tp->retrans_out -= tcp_skb_pcount(next_skb); tp->retrans_out -= tcp_skb_pcount(next_skb);
if (TCP_SKB_CB(next_skb)->sacked&TCPCB_LOST) if (TCP_SKB_CB(next_skb)->sacked & TCPCB_LOST)
tp->lost_out -= tcp_skb_pcount(next_skb); tp->lost_out -= tcp_skb_pcount(next_skb);
/* Reno case is special. Sigh... */ /* Reno case is special. Sigh... */
if (tcp_is_reno(tp) && tp->sacked_out) if (tcp_is_reno(tp) && tp->sacked_out)
...@@ -1741,7 +1744,6 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m ...@@ -1741,7 +1744,6 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
tcp_clear_retrans_hints_partial(tp); tcp_clear_retrans_hints_partial(tp);
sk_wmem_free_skb(sk, next_skb); sk_wmem_free_skb(sk, next_skb);
}
} }
/* Do a simple retransmit without using the backoff mechanisms in /* Do a simple retransmit without using the backoff mechanisms in
...@@ -2416,10 +2418,12 @@ void tcp_send_delayed_ack(struct sock *sk) ...@@ -2416,10 +2418,12 @@ void tcp_send_delayed_ack(struct sock *sk)
/* This routine sends an ack and also updates the window. */ /* This routine sends an ack and also updates the window. */
void tcp_send_ack(struct sock *sk) void tcp_send_ack(struct sock *sk)
{ {
/* If we have been reset, we may not send again. */
if (sk->sk_state != TCP_CLOSE) {
struct sk_buff *buff; struct sk_buff *buff;
/* If we have been reset, we may not send again. */
if (sk->sk_state == TCP_CLOSE)
return;
/* We are not putting this on the write queue, so /* We are not putting this on the write queue, so
* tcp_transmit_skb() will set the ownership to this * tcp_transmit_skb() will set the ownership to this
* sock. * sock.
...@@ -2446,7 +2450,6 @@ void tcp_send_ack(struct sock *sk) ...@@ -2446,7 +2450,6 @@ void tcp_send_ack(struct sock *sk)
TCP_SKB_CB(buff)->seq = TCP_SKB_CB(buff)->end_seq = tcp_acceptable_seq(sk); TCP_SKB_CB(buff)->seq = TCP_SKB_CB(buff)->end_seq = tcp_acceptable_seq(sk);
TCP_SKB_CB(buff)->when = tcp_time_stamp; TCP_SKB_CB(buff)->when = tcp_time_stamp;
tcp_transmit_skb(sk, buff, 0, GFP_ATOMIC); tcp_transmit_skb(sk, buff, 0, GFP_ATOMIC);
}
} }
/* This routine sends a packet with an out of date sequence /* This routine sends a packet with an out of date sequence
...@@ -2491,10 +2494,12 @@ static int tcp_xmit_probe_skb(struct sock *sk, int urgent) ...@@ -2491,10 +2494,12 @@ static int tcp_xmit_probe_skb(struct sock *sk, int urgent)
int tcp_write_wakeup(struct sock *sk) int tcp_write_wakeup(struct sock *sk)
{ {
if (sk->sk_state != TCP_CLOSE) {
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb; struct sk_buff *skb;
if (sk->sk_state == TCP_CLOSE)
return -1;
if ((skb = tcp_send_head(sk)) != NULL && if ((skb = tcp_send_head(sk)) != NULL &&
before(TCP_SKB_CB(skb)->seq, tcp_wnd_end(tp))) { before(TCP_SKB_CB(skb)->seq, tcp_wnd_end(tp))) {
int err; int err;
...@@ -2525,12 +2530,10 @@ int tcp_write_wakeup(struct sock *sk) ...@@ -2525,12 +2530,10 @@ int tcp_write_wakeup(struct sock *sk)
return err; return err;
} else { } else {
if (tp->urg_mode && if (tp->urg_mode &&
between(tp->snd_up, tp->snd_una+1, tp->snd_una+0xFFFF)) between(tp->snd_up, tp->snd_una + 1, tp->snd_una + 0xFFFF))
tcp_xmit_probe_skb(sk, 1); tcp_xmit_probe_skb(sk, 1);
return tcp_xmit_probe_skb(sk, 0); return tcp_xmit_probe_skb(sk, 0);
} }
}
return -1;
} }
/* A window probe timeout has occurred. If window is not closed send /* A window probe timeout has occurred. If window is not closed send
......
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