tcp: no longer keep around headers in input path
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 4 repliesIn review
- v13 patches 1 replySuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | tcp: use TCP_SKB_CB(skb)->tcp_flags in input pathnet/ net/ net/ +1 more | +17 | 1 reply | |
| 2/3 | tcp: allow segment with FIN in tcp_try_coalesce()net/ net/ | +3 | 1 reply | |
| 3/3 | tcp: do not copy headers in tcp_collapse()net/ | +2 | 1 reply |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Neal Cardwell |
|---|---|
| 1/3 | A-b |
| 2/3 | A-b |
| 3/3 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 net-next 0/3] 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.
Eric Dumazet (3):
tcp: use TCP_SKB_CB(skb)->tcp_flags in input path
tcp: allow segment with FIN in tcp_try_coalesce()
tcp: do not copy headers in tcp_collapse()
net/core/skbuff.c | 3 ++- net/ipv4/tcp.c | 18 ++++++++++-------- net/ipv4/tcp_input.c | 31 ++++++++----------------------- net/ipv4/tcp_ipv4.c | 1 + net/ipv6/tcp_ipv6.c | 1 + 5 files changed, 22 insertions(+), 32 deletions(-)
Signature · 1 line
2.1.0.rc2.206.gedb03e5