diff options
author | Eric Dumazet <edumazet@google.com> | 2015-06-11 12:15:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-11 19:33:11 -0400 |
commit | f69ad292cfd13aa7ee00847320c6bb9ba2154e87 (patch) | |
tree | 7158b39eda3c315797407b0d558f7d301196499e /include/net/tcp.h | |
parent | 5bbb432c896d23ce8f41f38e88dbd38982df99f9 (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 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 978cebedd3fc..950cfecaad3c 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -730,11 +730,14 @@ struct tcp_skb_cb { | |||
730 | /* Note : tcp_tw_isn is used in input path only | 730 | /* Note : tcp_tw_isn is used in input path only |
731 | * (isn chosen by tcp_timewait_state_process()) | 731 | * (isn chosen by tcp_timewait_state_process()) |
732 | * | 732 | * |
733 | * tcp_gso_segs is used in write queue only, | 733 | * tcp_gso_segs/size are used in write queue only, |
734 | * cf tcp_skb_pcount() | 734 | * cf tcp_skb_pcount()/tcp_skb_mss() |
735 | */ | 735 | */ |
736 | __u32 tcp_tw_isn; | 736 | __u32 tcp_tw_isn; |
737 | __u32 tcp_gso_segs; | 737 | struct { |
738 | u16 tcp_gso_segs; | ||
739 | u16 tcp_gso_size; | ||
740 | }; | ||
738 | }; | 741 | }; |
739 | __u8 tcp_flags; /* TCP header flags. (tcp[13]) */ | 742 | __u8 tcp_flags; /* TCP header flags. (tcp[13]) */ |
740 | 743 | ||
@@ -790,10 +793,10 @@ static inline void tcp_skb_pcount_add(struct sk_buff *skb, int segs) | |||
790 | TCP_SKB_CB(skb)->tcp_gso_segs += segs; | 793 | TCP_SKB_CB(skb)->tcp_gso_segs += segs; |
791 | } | 794 | } |
792 | 795 | ||
793 | /* This is valid iff tcp_skb_pcount() > 1. */ | 796 | /* This is valid iff skb is in write queue and tcp_skb_pcount() > 1. */ |
794 | static inline int tcp_skb_mss(const struct sk_buff *skb) | 797 | static inline int tcp_skb_mss(const struct sk_buff *skb) |
795 | { | 798 | { |
796 | return skb_shinfo(skb)->gso_size; | 799 | return TCP_SKB_CB(skb)->tcp_gso_size; |
797 | } | 800 | } |
798 | 801 | ||
799 | /* Events passed to congestion control interface */ | 802 | /* Events passed to congestion control interface */ |