summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/tcpip/stack')
-rw-r--r--pkg/tcpip/stack/linkaddrentry_list.go28
-rw-r--r--pkg/tcpip/stack/neighbor_entry_list.go28
-rw-r--r--pkg/tcpip/stack/packet_buffer_list.go28
-rw-r--r--pkg/tcpip/stack/tuple_list.go28
4 files changed, 112 insertions, 0 deletions
diff --git a/pkg/tcpip/stack/linkaddrentry_list.go b/pkg/tcpip/stack/linkaddrentry_list.go
index 1250b89f8..8ae2ff09c 100644
--- a/pkg/tcpip/stack/linkaddrentry_list.go
+++ b/pkg/tcpip/stack/linkaddrentry_list.go
@@ -38,16 +38,22 @@ func (l *linkAddrEntryList) Reset() {
}
// Empty returns true iff the list is empty.
+//
+//go:nosplit
func (l *linkAddrEntryList) Empty() bool {
return l.head == nil
}
// Front returns the first element of list l or nil.
+//
+//go:nosplit
func (l *linkAddrEntryList) Front() *linkAddrEntry {
return l.head
}
// Back returns the last element of list l or nil.
+//
+//go:nosplit
func (l *linkAddrEntryList) Back() *linkAddrEntry {
return l.tail
}
@@ -55,6 +61,8 @@ func (l *linkAddrEntryList) Back() *linkAddrEntry {
// Len returns the number of elements in the list.
//
// NOTE: This is an O(n) operation.
+//
+//go:nosplit
func (l *linkAddrEntryList) Len() (count int) {
for e := l.Front(); e != nil; e = (linkAddrEntryElementMapper{}.linkerFor(e)).Next() {
count++
@@ -63,6 +71,8 @@ func (l *linkAddrEntryList) Len() (count int) {
}
// PushFront inserts the element e at the front of list l.
+//
+//go:nosplit
func (l *linkAddrEntryList) PushFront(e *linkAddrEntry) {
linker := linkAddrEntryElementMapper{}.linkerFor(e)
linker.SetNext(l.head)
@@ -77,6 +87,8 @@ func (l *linkAddrEntryList) PushFront(e *linkAddrEntry) {
}
// PushBack inserts the element e at the back of list l.
+//
+//go:nosplit
func (l *linkAddrEntryList) PushBack(e *linkAddrEntry) {
linker := linkAddrEntryElementMapper{}.linkerFor(e)
linker.SetNext(nil)
@@ -91,6 +103,8 @@ func (l *linkAddrEntryList) PushBack(e *linkAddrEntry) {
}
// PushBackList inserts list m at the end of list l, emptying m.
+//
+//go:nosplit
func (l *linkAddrEntryList) PushBackList(m *linkAddrEntryList) {
if l.head == nil {
l.head = m.head
@@ -106,6 +120,8 @@ func (l *linkAddrEntryList) PushBackList(m *linkAddrEntryList) {
}
// InsertAfter inserts e after b.
+//
+//go:nosplit
func (l *linkAddrEntryList) InsertAfter(b, e *linkAddrEntry) {
bLinker := linkAddrEntryElementMapper{}.linkerFor(b)
eLinker := linkAddrEntryElementMapper{}.linkerFor(e)
@@ -124,6 +140,8 @@ func (l *linkAddrEntryList) InsertAfter(b, e *linkAddrEntry) {
}
// InsertBefore inserts e before a.
+//
+//go:nosplit
func (l *linkAddrEntryList) InsertBefore(a, e *linkAddrEntry) {
aLinker := linkAddrEntryElementMapper{}.linkerFor(a)
eLinker := linkAddrEntryElementMapper{}.linkerFor(e)
@@ -141,6 +159,8 @@ func (l *linkAddrEntryList) InsertBefore(a, e *linkAddrEntry) {
}
// Remove removes e from l.
+//
+//go:nosplit
func (l *linkAddrEntryList) Remove(e *linkAddrEntry) {
linker := linkAddrEntryElementMapper{}.linkerFor(e)
prev := linker.Prev()
@@ -173,21 +193,29 @@ type linkAddrEntryEntry struct {
}
// Next returns the entry that follows e in the list.
+//
+//go:nosplit
func (e *linkAddrEntryEntry) Next() *linkAddrEntry {
return e.next
}
// Prev returns the entry that precedes e in the list.
+//
+//go:nosplit
func (e *linkAddrEntryEntry) Prev() *linkAddrEntry {
return e.prev
}
// SetNext assigns 'entry' as the entry that follows e in the list.
+//
+//go:nosplit
func (e *linkAddrEntryEntry) SetNext(elem *linkAddrEntry) {
e.next = elem
}
// SetPrev assigns 'entry' as the entry that precedes e in the list.
+//
+//go:nosplit
func (e *linkAddrEntryEntry) SetPrev(elem *linkAddrEntry) {
e.prev = elem
}
diff --git a/pkg/tcpip/stack/neighbor_entry_list.go b/pkg/tcpip/stack/neighbor_entry_list.go
index b732257d2..d78430080 100644
--- a/pkg/tcpip/stack/neighbor_entry_list.go
+++ b/pkg/tcpip/stack/neighbor_entry_list.go
@@ -38,16 +38,22 @@ func (l *neighborEntryList) Reset() {
}
// Empty returns true iff the list is empty.
+//
+//go:nosplit
func (l *neighborEntryList) Empty() bool {
return l.head == nil
}
// Front returns the first element of list l or nil.
+//
+//go:nosplit
func (l *neighborEntryList) Front() *neighborEntry {
return l.head
}
// Back returns the last element of list l or nil.
+//
+//go:nosplit
func (l *neighborEntryList) Back() *neighborEntry {
return l.tail
}
@@ -55,6 +61,8 @@ func (l *neighborEntryList) Back() *neighborEntry {
// Len returns the number of elements in the list.
//
// NOTE: This is an O(n) operation.
+//
+//go:nosplit
func (l *neighborEntryList) Len() (count int) {
for e := l.Front(); e != nil; e = (neighborEntryElementMapper{}.linkerFor(e)).Next() {
count++
@@ -63,6 +71,8 @@ func (l *neighborEntryList) Len() (count int) {
}
// PushFront inserts the element e at the front of list l.
+//
+//go:nosplit
func (l *neighborEntryList) PushFront(e *neighborEntry) {
linker := neighborEntryElementMapper{}.linkerFor(e)
linker.SetNext(l.head)
@@ -77,6 +87,8 @@ func (l *neighborEntryList) PushFront(e *neighborEntry) {
}
// PushBack inserts the element e at the back of list l.
+//
+//go:nosplit
func (l *neighborEntryList) PushBack(e *neighborEntry) {
linker := neighborEntryElementMapper{}.linkerFor(e)
linker.SetNext(nil)
@@ -91,6 +103,8 @@ func (l *neighborEntryList) PushBack(e *neighborEntry) {
}
// PushBackList inserts list m at the end of list l, emptying m.
+//
+//go:nosplit
func (l *neighborEntryList) PushBackList(m *neighborEntryList) {
if l.head == nil {
l.head = m.head
@@ -106,6 +120,8 @@ func (l *neighborEntryList) PushBackList(m *neighborEntryList) {
}
// InsertAfter inserts e after b.
+//
+//go:nosplit
func (l *neighborEntryList) InsertAfter(b, e *neighborEntry) {
bLinker := neighborEntryElementMapper{}.linkerFor(b)
eLinker := neighborEntryElementMapper{}.linkerFor(e)
@@ -124,6 +140,8 @@ func (l *neighborEntryList) InsertAfter(b, e *neighborEntry) {
}
// InsertBefore inserts e before a.
+//
+//go:nosplit
func (l *neighborEntryList) InsertBefore(a, e *neighborEntry) {
aLinker := neighborEntryElementMapper{}.linkerFor(a)
eLinker := neighborEntryElementMapper{}.linkerFor(e)
@@ -141,6 +159,8 @@ func (l *neighborEntryList) InsertBefore(a, e *neighborEntry) {
}
// Remove removes e from l.
+//
+//go:nosplit
func (l *neighborEntryList) Remove(e *neighborEntry) {
linker := neighborEntryElementMapper{}.linkerFor(e)
prev := linker.Prev()
@@ -173,21 +193,29 @@ type neighborEntryEntry struct {
}
// Next returns the entry that follows e in the list.
+//
+//go:nosplit
func (e *neighborEntryEntry) Next() *neighborEntry {
return e.next
}
// Prev returns the entry that precedes e in the list.
+//
+//go:nosplit
func (e *neighborEntryEntry) Prev() *neighborEntry {
return e.prev
}
// SetNext assigns 'entry' as the entry that follows e in the list.
+//
+//go:nosplit
func (e *neighborEntryEntry) SetNext(elem *neighborEntry) {
e.next = elem
}
// SetPrev assigns 'entry' as the entry that precedes e in the list.
+//
+//go:nosplit
func (e *neighborEntryEntry) SetPrev(elem *neighborEntry) {
e.prev = elem
}
diff --git a/pkg/tcpip/stack/packet_buffer_list.go b/pkg/tcpip/stack/packet_buffer_list.go
index 27f15cb15..ce7057d6b 100644
--- a/pkg/tcpip/stack/packet_buffer_list.go
+++ b/pkg/tcpip/stack/packet_buffer_list.go
@@ -38,16 +38,22 @@ func (l *PacketBufferList) Reset() {
}
// Empty returns true iff the list is empty.
+//
+//go:nosplit
func (l *PacketBufferList) Empty() bool {
return l.head == nil
}
// Front returns the first element of list l or nil.
+//
+//go:nosplit
func (l *PacketBufferList) Front() *PacketBuffer {
return l.head
}
// Back returns the last element of list l or nil.
+//
+//go:nosplit
func (l *PacketBufferList) Back() *PacketBuffer {
return l.tail
}
@@ -55,6 +61,8 @@ func (l *PacketBufferList) Back() *PacketBuffer {
// Len returns the number of elements in the list.
//
// NOTE: This is an O(n) operation.
+//
+//go:nosplit
func (l *PacketBufferList) Len() (count int) {
for e := l.Front(); e != nil; e = (PacketBufferElementMapper{}.linkerFor(e)).Next() {
count++
@@ -63,6 +71,8 @@ func (l *PacketBufferList) Len() (count int) {
}
// PushFront inserts the element e at the front of list l.
+//
+//go:nosplit
func (l *PacketBufferList) PushFront(e *PacketBuffer) {
linker := PacketBufferElementMapper{}.linkerFor(e)
linker.SetNext(l.head)
@@ -77,6 +87,8 @@ func (l *PacketBufferList) PushFront(e *PacketBuffer) {
}
// PushBack inserts the element e at the back of list l.
+//
+//go:nosplit
func (l *PacketBufferList) PushBack(e *PacketBuffer) {
linker := PacketBufferElementMapper{}.linkerFor(e)
linker.SetNext(nil)
@@ -91,6 +103,8 @@ func (l *PacketBufferList) PushBack(e *PacketBuffer) {
}
// PushBackList inserts list m at the end of list l, emptying m.
+//
+//go:nosplit
func (l *PacketBufferList) PushBackList(m *PacketBufferList) {
if l.head == nil {
l.head = m.head
@@ -106,6 +120,8 @@ func (l *PacketBufferList) PushBackList(m *PacketBufferList) {
}
// InsertAfter inserts e after b.
+//
+//go:nosplit
func (l *PacketBufferList) InsertAfter(b, e *PacketBuffer) {
bLinker := PacketBufferElementMapper{}.linkerFor(b)
eLinker := PacketBufferElementMapper{}.linkerFor(e)
@@ -124,6 +140,8 @@ func (l *PacketBufferList) InsertAfter(b, e *PacketBuffer) {
}
// InsertBefore inserts e before a.
+//
+//go:nosplit
func (l *PacketBufferList) InsertBefore(a, e *PacketBuffer) {
aLinker := PacketBufferElementMapper{}.linkerFor(a)
eLinker := PacketBufferElementMapper{}.linkerFor(e)
@@ -141,6 +159,8 @@ func (l *PacketBufferList) InsertBefore(a, e *PacketBuffer) {
}
// Remove removes e from l.
+//
+//go:nosplit
func (l *PacketBufferList) Remove(e *PacketBuffer) {
linker := PacketBufferElementMapper{}.linkerFor(e)
prev := linker.Prev()
@@ -173,21 +193,29 @@ type PacketBufferEntry struct {
}
// Next returns the entry that follows e in the list.
+//
+//go:nosplit
func (e *PacketBufferEntry) Next() *PacketBuffer {
return e.next
}
// Prev returns the entry that precedes e in the list.
+//
+//go:nosplit
func (e *PacketBufferEntry) Prev() *PacketBuffer {
return e.prev
}
// SetNext assigns 'entry' as the entry that follows e in the list.
+//
+//go:nosplit
func (e *PacketBufferEntry) SetNext(elem *PacketBuffer) {
e.next = elem
}
// SetPrev assigns 'entry' as the entry that precedes e in the list.
+//
+//go:nosplit
func (e *PacketBufferEntry) SetPrev(elem *PacketBuffer) {
e.prev = elem
}
diff --git a/pkg/tcpip/stack/tuple_list.go b/pkg/tcpip/stack/tuple_list.go
index 0d1b98874..31d0feefa 100644
--- a/pkg/tcpip/stack/tuple_list.go
+++ b/pkg/tcpip/stack/tuple_list.go
@@ -38,16 +38,22 @@ func (l *tupleList) Reset() {
}
// Empty returns true iff the list is empty.
+//
+//go:nosplit
func (l *tupleList) Empty() bool {
return l.head == nil
}
// Front returns the first element of list l or nil.
+//
+//go:nosplit
func (l *tupleList) Front() *tuple {
return l.head
}
// Back returns the last element of list l or nil.
+//
+//go:nosplit
func (l *tupleList) Back() *tuple {
return l.tail
}
@@ -55,6 +61,8 @@ func (l *tupleList) Back() *tuple {
// Len returns the number of elements in the list.
//
// NOTE: This is an O(n) operation.
+//
+//go:nosplit
func (l *tupleList) Len() (count int) {
for e := l.Front(); e != nil; e = (tupleElementMapper{}.linkerFor(e)).Next() {
count++
@@ -63,6 +71,8 @@ func (l *tupleList) Len() (count int) {
}
// PushFront inserts the element e at the front of list l.
+//
+//go:nosplit
func (l *tupleList) PushFront(e *tuple) {
linker := tupleElementMapper{}.linkerFor(e)
linker.SetNext(l.head)
@@ -77,6 +87,8 @@ func (l *tupleList) PushFront(e *tuple) {
}
// PushBack inserts the element e at the back of list l.
+//
+//go:nosplit
func (l *tupleList) PushBack(e *tuple) {
linker := tupleElementMapper{}.linkerFor(e)
linker.SetNext(nil)
@@ -91,6 +103,8 @@ func (l *tupleList) PushBack(e *tuple) {
}
// PushBackList inserts list m at the end of list l, emptying m.
+//
+//go:nosplit
func (l *tupleList) PushBackList(m *tupleList) {
if l.head == nil {
l.head = m.head
@@ -106,6 +120,8 @@ func (l *tupleList) PushBackList(m *tupleList) {
}
// InsertAfter inserts e after b.
+//
+//go:nosplit
func (l *tupleList) InsertAfter(b, e *tuple) {
bLinker := tupleElementMapper{}.linkerFor(b)
eLinker := tupleElementMapper{}.linkerFor(e)
@@ -124,6 +140,8 @@ func (l *tupleList) InsertAfter(b, e *tuple) {
}
// InsertBefore inserts e before a.
+//
+//go:nosplit
func (l *tupleList) InsertBefore(a, e *tuple) {
aLinker := tupleElementMapper{}.linkerFor(a)
eLinker := tupleElementMapper{}.linkerFor(e)
@@ -141,6 +159,8 @@ func (l *tupleList) InsertBefore(a, e *tuple) {
}
// Remove removes e from l.
+//
+//go:nosplit
func (l *tupleList) Remove(e *tuple) {
linker := tupleElementMapper{}.linkerFor(e)
prev := linker.Prev()
@@ -173,21 +193,29 @@ type tupleEntry struct {
}
// Next returns the entry that follows e in the list.
+//
+//go:nosplit
func (e *tupleEntry) Next() *tuple {
return e.next
}
// Prev returns the entry that precedes e in the list.
+//
+//go:nosplit
func (e *tupleEntry) Prev() *tuple {
return e.prev
}
// SetNext assigns 'entry' as the entry that follows e in the list.
+//
+//go:nosplit
func (e *tupleEntry) SetNext(elem *tuple) {
e.next = elem
}
// SetPrev assigns 'entry' as the entry that precedes e in the list.
+//
+//go:nosplit
func (e *tupleEntry) SetPrev(elem *tuple) {
e.prev = elem
}