Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5663
b: refs/heads/master
c: b68e9f8
h: refs/heads/master
i:
  5661: 9fb6ed1
  5659: cd11f1c
  5655: ddd5205
  5647: 9de3f90
  5631: 7db0fbd
v: v3
  • Loading branch information
Herbert Xu authored and Linus Torvalds committed Aug 5, 2005
1 parent ba070fa commit 73bc119
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 846998ae87a80b0fd45b4cf5cf001a159d746f27
refs/heads/master: b68e9f857271189bd7a59b74c99890de9195b0e1
34 changes: 9 additions & 25 deletions trunk/net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,19 +972,18 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle)
if (unlikely(sk->sk_state == TCP_CLOSE))
return 0;

skb = sk->sk_send_head;
if (unlikely(!skb))
return 0;

tso_segs = tcp_init_tso_segs(sk, skb, mss_now);
cwnd_quota = tcp_cwnd_test(tp, skb);
if (unlikely(!cwnd_quota))
goto out;

sent_pkts = 0;
while (likely(tcp_snd_wnd_test(tp, skb, mss_now))) {
while ((skb = sk->sk_send_head)) {
tso_segs = tcp_init_tso_segs(sk, skb, mss_now);
BUG_ON(!tso_segs);

cwnd_quota = tcp_cwnd_test(tp, skb);
if (!cwnd_quota)
break;

if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now)))
break;

if (tso_segs == 1) {
if (unlikely(!tcp_nagle_test(tp, skb, mss_now,
(tcp_skb_is_last(sk, skb) ?
Expand Down Expand Up @@ -1026,27 +1025,12 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle)

tcp_minshall_update(tp, mss_now, skb);
sent_pkts++;

/* Do not optimize this to use tso_segs. If we chopped up
* the packet above, tso_segs will no longer be valid.
*/
cwnd_quota -= tcp_skb_pcount(skb);

BUG_ON(cwnd_quota < 0);
if (!cwnd_quota)
break;

skb = sk->sk_send_head;
if (!skb)
break;
tso_segs = tcp_init_tso_segs(sk, skb, mss_now);
}

if (likely(sent_pkts)) {
tcp_cwnd_validate(sk, tp);
return 0;
}
out:
return !tp->packets_out && sk->sk_send_head;
}

Expand Down

0 comments on commit 73bc119

Please sign in to comment.