summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/tcp
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-01-11 21:27:53 +0000
committergVisor bot <gvisor-bot@google.com>2021-01-11 21:27:53 +0000
commite524c21569616484e3209be952dd90636209419e (patch)
treed425976e5c7d7499187b93feb31d97fbd11408bf /pkg/tcpip/transport/tcp
parent3ff3110fcdd696053e8cafc807f2409fe1269cce (diff)
parent4c4de66443174f2ed7f4fa533a1d09c709be9427 (diff)
Merge release-20201216.0-82-g4c4de6644 (automated)
Diffstat (limited to 'pkg/tcpip/transport/tcp')
-rw-r--r--pkg/tcpip/transport/tcp/tcp_endpoint_list.go28
-rw-r--r--pkg/tcpip/transport/tcp/tcp_segment_list.go28
2 files changed, 56 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/tcp/tcp_endpoint_list.go b/pkg/tcpip/transport/tcp/tcp_endpoint_list.go
index 71ae11c81..a7dc5df81 100644
--- a/pkg/tcpip/transport/tcp/tcp_endpoint_list.go
+++ b/pkg/tcpip/transport/tcp/tcp_endpoint_list.go
@@ -38,16 +38,22 @@ func (l *endpointList) Reset() {
}
// Empty returns true iff the list is empty.
+//
+//go:nosplit
func (l *endpointList) Empty() bool {
return l.head == nil
}
// Front returns the first element of list l or nil.
+//
+//go:nosplit
func (l *endpointList) Front() *endpoint {
return l.head
}
// Back returns the last element of list l or nil.
+//
+//go:nosplit
func (l *endpointList) Back() *endpoint {
return l.tail
}
@@ -55,6 +61,8 @@ func (l *endpointList) Back() *endpoint {
// Len returns the number of elements in the list.
//
// NOTE: This is an O(n) operation.
+//
+//go:nosplit
func (l *endpointList) Len() (count int) {
for e := l.Front(); e != nil; e = (endpointElementMapper{}.linkerFor(e)).Next() {
count++
@@ -63,6 +71,8 @@ func (l *endpointList) Len() (count int) {
}
// PushFront inserts the element e at the front of list l.
+//
+//go:nosplit
func (l *endpointList) PushFront(e *endpoint) {
linker := endpointElementMapper{}.linkerFor(e)
linker.SetNext(l.head)
@@ -77,6 +87,8 @@ func (l *endpointList) PushFront(e *endpoint) {
}
// PushBack inserts the element e at the back of list l.
+//
+//go:nosplit
func (l *endpointList) PushBack(e *endpoint) {
linker := endpointElementMapper{}.linkerFor(e)
linker.SetNext(nil)
@@ -91,6 +103,8 @@ func (l *endpointList) PushBack(e *endpoint) {
}
// PushBackList inserts list m at the end of list l, emptying m.
+//
+//go:nosplit
func (l *endpointList) PushBackList(m *endpointList) {
if l.head == nil {
l.head = m.head
@@ -106,6 +120,8 @@ func (l *endpointList) PushBackList(m *endpointList) {
}
// InsertAfter inserts e after b.
+//
+//go:nosplit
func (l *endpointList) InsertAfter(b, e *endpoint) {
bLinker := endpointElementMapper{}.linkerFor(b)
eLinker := endpointElementMapper{}.linkerFor(e)
@@ -124,6 +140,8 @@ func (l *endpointList) InsertAfter(b, e *endpoint) {
}
// InsertBefore inserts e before a.
+//
+//go:nosplit
func (l *endpointList) InsertBefore(a, e *endpoint) {
aLinker := endpointElementMapper{}.linkerFor(a)
eLinker := endpointElementMapper{}.linkerFor(e)
@@ -141,6 +159,8 @@ func (l *endpointList) InsertBefore(a, e *endpoint) {
}
// Remove removes e from l.
+//
+//go:nosplit
func (l *endpointList) Remove(e *endpoint) {
linker := endpointElementMapper{}.linkerFor(e)
prev := linker.Prev()
@@ -173,21 +193,29 @@ type endpointEntry struct {
}
// Next returns the entry that follows e in the list.
+//
+//go:nosplit
func (e *endpointEntry) Next() *endpoint {
return e.next
}
// Prev returns the entry that precedes e in the list.
+//
+//go:nosplit
func (e *endpointEntry) Prev() *endpoint {
return e.prev
}
// SetNext assigns 'entry' as the entry that follows e in the list.
+//
+//go:nosplit
func (e *endpointEntry) SetNext(elem *endpoint) {
e.next = elem
}
// SetPrev assigns 'entry' as the entry that precedes e in the list.
+//
+//go:nosplit
func (e *endpointEntry) SetPrev(elem *endpoint) {
e.prev = elem
}
diff --git a/pkg/tcpip/transport/tcp/tcp_segment_list.go b/pkg/tcpip/transport/tcp/tcp_segment_list.go
index fcd0c7ec1..a14cff27e 100644
--- a/pkg/tcpip/transport/tcp/tcp_segment_list.go
+++ b/pkg/tcpip/transport/tcp/tcp_segment_list.go
@@ -38,16 +38,22 @@ func (l *segmentList) Reset() {
}
// Empty returns true iff the list is empty.
+//
+//go:nosplit
func (l *segmentList) Empty() bool {
return l.head == nil
}
// Front returns the first element of list l or nil.
+//
+//go:nosplit
func (l *segmentList) Front() *segment {
return l.head
}
// Back returns the last element of list l or nil.
+//
+//go:nosplit
func (l *segmentList) Back() *segment {
return l.tail
}
@@ -55,6 +61,8 @@ func (l *segmentList) Back() *segment {
// Len returns the number of elements in the list.
//
// NOTE: This is an O(n) operation.
+//
+//go:nosplit
func (l *segmentList) Len() (count int) {
for e := l.Front(); e != nil; e = (segmentElementMapper{}.linkerFor(e)).Next() {
count++
@@ -63,6 +71,8 @@ func (l *segmentList) Len() (count int) {
}
// PushFront inserts the element e at the front of list l.
+//
+//go:nosplit
func (l *segmentList) PushFront(e *segment) {
linker := segmentElementMapper{}.linkerFor(e)
linker.SetNext(l.head)
@@ -77,6 +87,8 @@ func (l *segmentList) PushFront(e *segment) {
}
// PushBack inserts the element e at the back of list l.
+//
+//go:nosplit
func (l *segmentList) PushBack(e *segment) {
linker := segmentElementMapper{}.linkerFor(e)
linker.SetNext(nil)
@@ -91,6 +103,8 @@ func (l *segmentList) PushBack(e *segment) {
}
// PushBackList inserts list m at the end of list l, emptying m.
+//
+//go:nosplit
func (l *segmentList) PushBackList(m *segmentList) {
if l.head == nil {
l.head = m.head
@@ -106,6 +120,8 @@ func (l *segmentList) PushBackList(m *segmentList) {
}
// InsertAfter inserts e after b.
+//
+//go:nosplit
func (l *segmentList) InsertAfter(b, e *segment) {
bLinker := segmentElementMapper{}.linkerFor(b)
eLinker := segmentElementMapper{}.linkerFor(e)
@@ -124,6 +140,8 @@ func (l *segmentList) InsertAfter(b, e *segment) {
}
// InsertBefore inserts e before a.
+//
+//go:nosplit
func (l *segmentList) InsertBefore(a, e *segment) {
aLinker := segmentElementMapper{}.linkerFor(a)
eLinker := segmentElementMapper{}.linkerFor(e)
@@ -141,6 +159,8 @@ func (l *segmentList) InsertBefore(a, e *segment) {
}
// Remove removes e from l.
+//
+//go:nosplit
func (l *segmentList) Remove(e *segment) {
linker := segmentElementMapper{}.linkerFor(e)
prev := linker.Prev()
@@ -173,21 +193,29 @@ type segmentEntry struct {
}
// Next returns the entry that follows e in the list.
+//
+//go:nosplit
func (e *segmentEntry) Next() *segment {
return e.next
}
// Prev returns the entry that precedes e in the list.
+//
+//go:nosplit
func (e *segmentEntry) Prev() *segment {
return e.prev
}
// SetNext assigns 'entry' as the entry that follows e in the list.
+//
+//go:nosplit
func (e *segmentEntry) SetNext(elem *segment) {
e.next = elem
}
// SetPrev assigns 'entry' as the entry that precedes e in the list.
+//
+//go:nosplit
func (e *segmentEntry) SetPrev(elem *segment) {
e.prev = elem
}