diff options
Diffstat (limited to 'net/ipv4/tcp_offload.c')
-rw-r--r-- | net/ipv4/tcp_offload.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c index 55046ecd083e..f597119fc4e7 100644 --- a/net/ipv4/tcp_offload.c +++ b/net/ipv4/tcp_offload.c | |||
@@ -14,6 +14,21 @@ | |||
14 | #include <net/tcp.h> | 14 | #include <net/tcp.h> |
15 | #include <net/protocol.h> | 15 | #include <net/protocol.h> |
16 | 16 | ||
17 | void tcp_gso_tstamp(struct sk_buff *skb, unsigned int ts_seq, unsigned int seq, | ||
18 | unsigned int mss) | ||
19 | { | ||
20 | while (skb) { | ||
21 | if (ts_seq < (__u64) seq + mss) { | ||
22 | skb_shinfo(skb)->tx_flags = SKBTX_SW_TSTAMP; | ||
23 | skb_shinfo(skb)->tskey = ts_seq; | ||
24 | return; | ||
25 | } | ||
26 | |||
27 | skb = skb->next; | ||
28 | seq += mss; | ||
29 | } | ||
30 | } | ||
31 | |||
17 | struct sk_buff *tcp_gso_segment(struct sk_buff *skb, | 32 | struct sk_buff *tcp_gso_segment(struct sk_buff *skb, |
18 | netdev_features_t features) | 33 | netdev_features_t features) |
19 | { | 34 | { |
@@ -91,6 +106,9 @@ struct sk_buff *tcp_gso_segment(struct sk_buff *skb, | |||
91 | th = tcp_hdr(skb); | 106 | th = tcp_hdr(skb); |
92 | seq = ntohl(th->seq); | 107 | seq = ntohl(th->seq); |
93 | 108 | ||
109 | if (unlikely(skb_shinfo(gso_skb)->tx_flags & SKBTX_SW_TSTAMP)) | ||
110 | tcp_gso_tstamp(segs, skb_shinfo(gso_skb)->tskey, seq, mss); | ||
111 | |||
94 | newcheck = ~csum_fold((__force __wsum)((__force u32)th->check + | 112 | newcheck = ~csum_fold((__force __wsum)((__force u32)th->check + |
95 | (__force u32)delta)); | 113 | (__force u32)delta)); |
96 | 114 | ||