mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-15 17:07:50 +07:00
[TCP]: reduce tcp_output's indentation levels a bit
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4828e7f49a
commit
058dc3342b
@ -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 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
|
||||
* SKB's are still referenced by someone else.
|
||||
*/
|
||||
if (!skb_cloned(skb) && !skb_cloned(next_skb)) {
|
||||
int skb_size = skb->len, next_skb_size = next_skb->len;
|
||||
u16 flags = TCP_SKB_CB(skb)->flags;
|
||||
if (skb_cloned(skb) || skb_cloned(next_skb))
|
||||
return;
|
||||
|
||||
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. */
|
||||
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
|
||||
((skb_size + next_skb_size) > mss_now))
|
||||
return;
|
||||
|
||||
BUG_ON(tcp_skb_pcount(skb) != 1 ||
|
||||
tcp_skb_pcount(next_skb) != 1);
|
||||
BUG_ON(tcp_skb_pcount(skb) != 1 || tcp_skb_pcount(next_skb) != 1);
|
||||
|
||||
tcp_highest_sack_combine(sk, next_skb, skb);
|
||||
|
||||
/* Ok. We will be able to collapse the packet. */
|
||||
tcp_unlink_write_queue(next_skb, sk);
|
||||
|
||||
skb_copy_from_linear_data(next_skb,
|
||||
skb_put(skb, next_skb_size),
|
||||
skb_copy_from_linear_data(next_skb, skb_put(skb, next_skb_size),
|
||||
next_skb_size);
|
||||
|
||||
if (next_skb->ip_summed == CHECKSUM_PARTIAL)
|
||||
@ -1742,7 +1745,6 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
|
||||
|
||||
sk_wmem_free_skb(sk, next_skb);
|
||||
}
|
||||
}
|
||||
|
||||
/* Do a simple retransmit without using the backoff mechanisms in
|
||||
* tcp_timer. This is used for path mtu discovery.
|
||||
@ -2416,10 +2418,12 @@ void tcp_send_delayed_ack(struct sock *sk)
|
||||
/* This routine sends an ack and also updates the window. */
|
||||
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;
|
||||
|
||||
/* 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
|
||||
* tcp_transmit_skb() will set the ownership to this
|
||||
* sock.
|
||||
@ -2447,7 +2451,6 @@ void tcp_send_ack(struct sock *sk)
|
||||
TCP_SKB_CB(buff)->when = tcp_time_stamp;
|
||||
tcp_transmit_skb(sk, buff, 0, GFP_ATOMIC);
|
||||
}
|
||||
}
|
||||
|
||||
/* This routine sends a packet with an out of date sequence
|
||||
* number. It assumes the other end will try to ack it.
|
||||
@ -2491,10 +2494,12 @@ static int tcp_xmit_probe_skb(struct sock *sk, int urgent)
|
||||
|
||||
int tcp_write_wakeup(struct sock *sk)
|
||||
{
|
||||
if (sk->sk_state != TCP_CLOSE) {
|
||||
struct tcp_sock *tp = tcp_sk(sk);
|
||||
struct sk_buff *skb;
|
||||
|
||||
if (sk->sk_state == TCP_CLOSE)
|
||||
return -1;
|
||||
|
||||
if ((skb = tcp_send_head(sk)) != NULL &&
|
||||
before(TCP_SKB_CB(skb)->seq, tcp_wnd_end(tp))) {
|
||||
int err;
|
||||
@ -2530,8 +2535,6 @@ int tcp_write_wakeup(struct sock *sk)
|
||||
return tcp_xmit_probe_skb(sk, 0);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* A window probe timeout has occurred. If window is not closed send
|
||||
* a partial packet else a zero probe.
|
||||
|
Loading…
Reference in New Issue
Block a user