tcp: fill shinfo->gso_size at last moment
In commit cd7d8498c9
("tcp: change tcp_skb_pcount() location") we stored
gso_segs in a temporary cache hot location.
This patch does the same for gso_size.
This allows to save 2 cache line misses in tcp xmit path for
the last packet that is considered but not sent because of
various conditions (cwnd, tso defer, receiver window, TSQ...)
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
5bbb432c89
commit
f69ad292cf
@@ -1316,12 +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)
|
||||
skb_shinfo(prev)->gso_size = mss;
|
||||
if (!TCP_SKB_CB(prev)->tcp_gso_size)
|
||||
TCP_SKB_CB(prev)->tcp_gso_size = mss;
|
||||
|
||||
/* CHECKME: To clear or not to clear? Mimics normal skb currently */
|
||||
if (tcp_skb_pcount(skb) <= 1)
|
||||
skb_shinfo(skb)->gso_size = 0;
|
||||
TCP_SKB_CB(skb)->tcp_gso_size = 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);
|
||||
@@ -2248,7 +2248,7 @@ static void tcp_mark_head_lost(struct sock *sk, int packets, int mark_head)
|
||||
(oldcnt >= packets))
|
||||
break;
|
||||
|
||||
mss = skb_shinfo(skb)->gso_size;
|
||||
mss = tcp_skb_mss(skb);
|
||||
err = tcp_fragment(sk, skb, (packets - oldcnt) * mss,
|
||||
mss, GFP_ATOMIC);
|
||||
if (err < 0)
|
||||
|
Reference in New Issue
Block a user