summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/link/qdisc
diff options
context:
space:
mode:
authorGhanan Gowripalan <ghanan@google.com>2021-05-03 16:38:51 -0700
committergVisor bot <gvisor-bot@google.com>2021-05-03 16:40:47 -0700
commitf0b3298db07df63fa74559d5689008f9de9980a9 (patch)
treee13a8c3813b35e23407236fcd6b47278d893e60d /pkg/tcpip/link/qdisc
parent4218ba6fb4282b4466ddda05c2ea1ffec837e079 (diff)
Convey GSO capabilities through GSOEndpoint
...as all GSO capable endpoints must implement GSOEndpoint. PiperOrigin-RevId: 371804175
Diffstat (limited to 'pkg/tcpip/link/qdisc')
-rw-r--r--pkg/tcpip/link/qdisc/fifo/endpoint.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkg/tcpip/link/qdisc/fifo/endpoint.go b/pkg/tcpip/link/qdisc/fifo/endpoint.go
index bba6a6973..b1a28491d 100644
--- a/pkg/tcpip/link/qdisc/fifo/endpoint.go
+++ b/pkg/tcpip/link/qdisc/fifo/endpoint.go
@@ -25,6 +25,9 @@ import (
"gvisor.dev/gvisor/pkg/tcpip/stack"
)
+var _ stack.LinkEndpoint = (*endpoint)(nil)
+var _ stack.GSOEndpoint = (*endpoint)(nil)
+
// endpoint represents a LinkEndpoint which implements a FIFO queue for all
// outgoing packets. endpoint can have 1 or more underlying queueDispatchers.
// All outgoing packets are consistenly hashed to a single underlying queue
@@ -141,7 +144,7 @@ func (e *endpoint) LinkAddress() tcpip.LinkAddress {
return e.lower.LinkAddress()
}
-// GSOMaxSize returns the maximum GSO packet size.
+// GSOMaxSize implements stack.GSOEndpoint.
func (e *endpoint) GSOMaxSize() uint32 {
if gso, ok := e.lower.(stack.GSOEndpoint); ok {
return gso.GSOMaxSize()
@@ -149,6 +152,14 @@ func (e *endpoint) GSOMaxSize() uint32 {
return 0
}
+// SupportedGSO implements stack.GSOEndpoint.
+func (e *endpoint) SupportedGSO() stack.SupportedGSO {
+ if gso, ok := e.lower.(stack.GSOEndpoint); ok {
+ return gso.SupportedGSO()
+ }
+ return stack.GSONotSupported
+}
+
// WritePacket implements stack.LinkEndpoint.WritePacket.
//
// The packet must have the following fields populated: