Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111738
b: refs/heads/master
c: b5afe7b
h: refs/heads/master
v: v3
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed Sep 21, 2008
1 parent 6c318de commit 419a4b8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 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: 184d68b2b0b836587f92887b14baea41033ffeef
refs/heads/master: b5afe7bc71a1689376c9b547376d17568469f3b3
46 changes: 28 additions & 18 deletions trunk/net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1992,6 +1992,33 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
return err;
}

static int tcp_can_forward_retransmit(struct sock *sk)
{
const struct inet_connection_sock *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);

/* Forward retransmissions are possible only during Recovery. */
if (icsk->icsk_ca_state != TCP_CA_Recovery)
return 0;

/* No forward retransmissions in Reno are possible. */
if (tcp_is_reno(tp))
return 0;

/* Yeah, we have to make difficult choice between forward transmission
* and retransmission... Both ways have their merits...
*
* For now we do not retransmit anything, while we have some new
* segments to send. In the other cases, follow rule 3 for
* NextSeg() specified in RFC3517.
*/

if (tcp_may_send_now(sk))
return 0;

return 1;
}

/* This gets called after a retransmit timeout, and the initially
* retransmitted data is acknowledged. It tries to continue
* resending the rest of the retransmit queue, until either
Expand Down Expand Up @@ -2057,24 +2084,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
}

/* OK, demanded retransmission is finished. */

/* Forward retransmissions are possible only during Recovery. */
if (icsk->icsk_ca_state != TCP_CA_Recovery)
return;

/* No forward retransmissions in Reno are possible. */
if (tcp_is_reno(tp))
return;

/* Yeah, we have to make difficult choice between forward transmission
* and retransmission... Both ways have their merits...
*
* For now we do not retransmit anything, while we have some new
* segments to send. In the other cases, follow rule 3 for
* NextSeg() specified in RFC3517.
*/

if (tcp_may_send_now(sk))
if (!tcp_can_forward_retransmit(sk))
return;

/* If nothing is SACKed, highest_sack in the loop won't be valid */
Expand Down

0 comments on commit 419a4b8

Please sign in to comment.