Skip to content

Commit

Permalink
tcp: fix data delivery rate
Browse files Browse the repository at this point in the history
Now skb->mstamp_skb is updated later, we also need to call
tcp_rate_skb_sent() after the update is done.

Fixes: 8c72c65 ("tcp: update skb->skb_mstamp more carefully")
Signed-off-by: Eric Dumazet <[email protected]>
Acked-by: Soheil Hassas Yeganeh <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed Sep 16, 2017
1 parent e67b8a6 commit fc22579
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,8 +1002,6 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
if (clone_it) {
TCP_SKB_CB(skb)->tx.in_flight = TCP_SKB_CB(skb)->end_seq
- tp->snd_una;
tcp_rate_skb_sent(sk, skb);

oskb = skb;
if (unlikely(skb_cloned(skb)))
skb = pskb_copy(skb, gfp_mask);
Expand Down Expand Up @@ -1128,9 +1126,10 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
tcp_enter_cwr(sk);
err = net_xmit_eval(err);
}
if (!err && oskb)
if (!err && oskb) {
oskb->skb_mstamp = tp->tcp_mstamp;

tcp_rate_skb_sent(sk, oskb);
}
return err;
}

Expand Down

0 comments on commit fc22579

Please sign in to comment.