diff options
author | Bhasker Hariharan <bhaskerh@google.com> | 2019-02-25 15:18:55 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-02-25 15:20:04 -0800 |
commit | 26be25e4ecec2fa66ee819e980de353d657aa1f6 (patch) | |
tree | 957e785875d1198c5c42f22adbbfbe85c18942de /pkg/tcpip/transport/tcp/segment.go | |
parent | 41167e6c508240a127f96bfa519b909c16ee0933 (diff) |
Add a SACK scoreboard to TCP endpoints.
This change does not make use of SACK information but adds support to track
SACK information and store it in the endpoint.
The actual SACK based recovery will be in a separate CL.
Part of commits to add RFC 6675 support to Netstack.
PiperOrigin-RevId: 235612264
Change-Id: I261f94844d7bad5abda803152ce6cc6125a467ff
Diffstat (limited to 'pkg/tcpip/transport/tcp/segment.go')
-rw-r--r-- | pkg/tcpip/transport/tcp/segment.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/tcpip/transport/tcp/segment.go b/pkg/tcpip/transport/tcp/segment.go index 87c6d7d20..bd8017f64 100644 --- a/pkg/tcpip/transport/tcp/segment.go +++ b/pkg/tcpip/transport/tcp/segment.go @@ -16,6 +16,7 @@ package tcp import ( "sync/atomic" + "time" "gvisor.googlesource.com/gvisor/pkg/tcpip/buffer" "gvisor.googlesource.com/gvisor/pkg/tcpip/header" @@ -56,8 +57,10 @@ type segment struct { window seqnum.Size // parsedOptions stores the parsed values from the options in the segment. - parsedOptions header.TCPOptions - options []byte `state:".([]byte)"` + parsedOptions header.TCPOptions + options []byte `state:".([]byte)"` + hasNewSACKInfo bool + rcvdTime time.Time `state:".(unixTime)"` } func newSegment(r *stack.Route, id stack.TransportEndpointID, vv buffer.VectorisedView) *segment { @@ -67,6 +70,7 @@ func newSegment(r *stack.Route, id stack.TransportEndpointID, vv buffer.Vectoris route: r.Clone(), } s.data = vv.Clone(s.views[:]) + s.rcvdTime = time.Now() return s } @@ -78,6 +82,7 @@ func newSegmentFromView(r *stack.Route, id stack.TransportEndpointID, v buffer.V } s.views[0] = v s.data = buffer.NewVectorisedView(len(v), s.views[:1]) + s.rcvdTime = time.Now() return s } @@ -91,6 +96,7 @@ func (s *segment) clone() *segment { window: s.window, route: s.route.Clone(), viewToDeliver: s.viewToDeliver, + rcvdTime: s.rcvdTime, } t.data = s.data.Clone(t.views[:]) return t |