From: David S. Miller Date: Mon, 15 Sep 2014 18:41:12 +0000 (-0400) Subject: Merge branch 'tcpflags' X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=437024067ac1fbda7bb3a795e75922f9034672fb;p=openwrt%2Fstaging%2Fblogic.git 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 --- 437024067ac1fbda7bb3a795e75922f9034672fb