diff options
author | Eric Dumazet <edumazet@google.com> | 2014-09-15 07:19:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-15 14:41:07 -0400 |
commit | e11ecddf5128011c936cc5360780190cbc901fdc (patch) | |
tree | d7723697219a35e66ae7c1dab9e85832a0d19e11 /net/ipv6 | |
parent | 13bb5180e82349d9fcfa11cd17b3c1e7b558a902 (diff) |
tcp: use TCP_SKB_CB(skb)->tcp_flags in input path
Input path of TCP do not currently uses TCP_SKB_CB(skb)->tcp_flags,
which is only used in output path.
tcp_recvmsg(), looks at tcp_hdr(skb)->syn for every skb found in receive queue,
and its unfortunate because this bit is located in a cache line right before
the payload.
We can simplify TCP by copying tcp flags into TCP_SKB_CB(skb)->tcp_flags.
This patch does so, and avoids the cache line miss in tcp_recvmsg()
Following patches will
- allow a segment with FIN being coalesced in tcp_try_coalesce()
- simplify tcp_collapse() by not copying the headers.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 1835480336ac..de51a88bec6f 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1415,6 +1415,7 @@ static int tcp_v6_rcv(struct sk_buff *skb) | |||
1415 | TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin + | 1415 | TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin + |
1416 | skb->len - th->doff*4); | 1416 | skb->len - th->doff*4); |
1417 | TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); | 1417 | TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); |
1418 | TCP_SKB_CB(skb)->tcp_flags = tcp_flag_byte(th); | ||
1418 | TCP_SKB_CB(skb)->tcp_tw_isn = 0; | 1419 | TCP_SKB_CB(skb)->tcp_tw_isn = 0; |
1419 | TCP_SKB_CB(skb)->ip_dsfield = ipv6_get_dsfield(hdr); | 1420 | TCP_SKB_CB(skb)->ip_dsfield = ipv6_get_dsfield(hdr); |
1420 | TCP_SKB_CB(skb)->sacked = 0; | 1421 | TCP_SKB_CB(skb)->sacked = 0; |