]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'tcpflags'
authorDavid S. Miller <davem@davemloft.net>
Mon, 15 Sep 2014 18:41:12 +0000 (14:41 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Sep 2014 18:41:12 +0000 (14:41 -0400)
commit369f9b7fcf69191a6b5c1740e511707cbb191799
treec0686708da032f9f6f842903163fa6da23ef649f
parent8fead89823c7a284369c58504336d84a69fcd748
parenta09c0e21cc236ad4c5ba97cd4fa16ea5a5e6fedd
Merge branch 'tcpflags'

Eric Dumazet says:

====================
tcp: no longer keep around headers in input path

Looking at tcp_try_coalesce() I was wondering why I did :

if (tcp_hdr(from)->fin)
     return false;

The answer would be to allow the aggregation, if we simply OR the FIN and PSH
flags eventually present in @from to @to packet. (Note a change is also
needed in skb_try_coalesce() to avoid calling skb_put() with 0 len)

Then, looking at tcp_recvmsg(), I realized we access tcp_hdr(skb)->syn
(and maybe tcp_hdr(skb)->fin) for every packet we process from socket
receive queue.

We have to understand TCP flags are cold in cpu caches most of the time
(assuming TCP timestamps, and that application calls recvmsg() a long
time after incoming packet was processed), and bringing a whole
cache line only to access one bit is not very nice.

It would make sense to use in TCP input path TCP_SKB_CB(skb)->tcp_flags
as we do in output path.

This saves one cache line miss, and TCP tcp_collapse() can avoid dealing
with the headers.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>