diff options
author | Eric Dumazet <edumazet@google.com> | 2015-06-11 16:15:16 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-11 23:33:11 (GMT) |
commit | 51466a7545b73b7ad7bcfb33410d2823ccfaa501 (patch) | |
tree | f12fe132349a599b567efc45a092bbf2f591ea3d /net/ipv4/tcp_input.c | |
parent | a7eea416cb08a514f94c0ca5ff30c18783fab054 (diff) | |
download | linux-51466a7545b73b7ad7bcfb33410d2823ccfaa501.tar.xz |
tcp: fill shinfo->gso_type at last moment
Our goal is to touch skb_shinfo(skb) only when absolutely needed,
to avoid two cache line misses in TCP output path for last skb
that is considered but not sent because of various conditions
(cwnd, tso defer, receiver window, TSQ...)
A packet is GSO only when skb_shinfo(skb)->gso_size is not zero.
We can set skb_shinfo(skb)->gso_type to sk->sk_gso_type even for
non GSO packets.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index d4f76ab..70a6fa8 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -1316,16 +1316,12 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *skb, * code can come after this skb later on it's better to keep * setting gso_size to something. */ - if (!skb_shinfo(prev)->gso_size) { + if (!skb_shinfo(prev)->gso_size) skb_shinfo(prev)->gso_size = mss; - skb_shinfo(prev)->gso_type = sk->sk_gso_type; - } /* CHECKME: To clear or not to clear? Mimics normal skb currently */ - if (tcp_skb_pcount(skb) <= 1) { + if (tcp_skb_pcount(skb) <= 1) skb_shinfo(skb)->gso_size = 0; - skb_shinfo(skb)->gso_type = 0; - } /* Difference in this won't matter, both ACKed by the same cumul. ACK */ TCP_SKB_CB(prev)->sacked |= (TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS); |