aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-06-11 12:15:18 -0400
committerDavid S. Miller <davem@davemloft.net>2015-06-11 19:33:11 -0400
commitf69ad292cfd13aa7ee00847320c6bb9ba2154e87 (patch)
tree7158b39eda3c315797407b0d558f7d301196499e /net/ipv4/tcp_input.c
parent5bbb432c896d23ce8f41f38e88dbd38982df99f9 (diff)
tcp: fill shinfo->gso_size at last moment
In commit cd7d8498c9a5 ("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>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 70a6fa8ecbd3..684f095d196e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1316,12 +1316,12 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
1316 * code can come after this skb later on it's better to keep 1316 * code can come after this skb later on it's better to keep
1317 * setting gso_size to something. 1317 * setting gso_size to something.
1318 */ 1318 */
1319 if (!skb_shinfo(prev)->gso_size) 1319 if (!TCP_SKB_CB(prev)->tcp_gso_size)
1320 skb_shinfo(prev)->gso_size = mss; 1320 TCP_SKB_CB(prev)->tcp_gso_size = mss;
1321 1321
1322 /* CHECKME: To clear or not to clear? Mimics normal skb currently */ 1322 /* CHECKME: To clear or not to clear? Mimics normal skb currently */
1323 if (tcp_skb_pcount(skb) <= 1) 1323 if (tcp_skb_pcount(skb) <= 1)
1324 skb_shinfo(skb)->gso_size = 0; 1324 TCP_SKB_CB(skb)->tcp_gso_size = 0;
1325 1325
1326 /* Difference in this won't matter, both ACKed by the same cumul. ACK */ 1326 /* Difference in this won't matter, both ACKed by the same cumul. ACK */
1327 TCP_SKB_CB(prev)->sacked |= (TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS); 1327 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)
2248 (oldcnt >= packets)) 2248 (oldcnt >= packets))
2249 break; 2249 break;
2250 2250
2251 mss = skb_shinfo(skb)->gso_size; 2251 mss = tcp_skb_mss(skb);
2252 err = tcp_fragment(sk, skb, (packets - oldcnt) * mss, 2252 err = tcp_fragment(sk, skb, (packets - oldcnt) * mss,
2253 mss, GFP_ATOMIC); 2253 mss, GFP_ATOMIC);
2254 if (err < 0) 2254 if (err < 0)