diff options
author | Ghanan Gowripalan <ghanan@google.com> | 2021-05-03 16:38:51 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-05-03 16:40:47 -0700 |
commit | f0b3298db07df63fa74559d5689008f9de9980a9 (patch) | |
tree | e13a8c3813b35e23407236fcd6b47278d893e60d /pkg/tcpip/link/channel/channel.go | |
parent | 4218ba6fb4282b4466ddda05c2ea1ffec837e079 (diff) |
Convey GSO capabilities through GSOEndpoint
...as all GSO capable endpoints must implement GSOEndpoint.
PiperOrigin-RevId: 371804175
Diffstat (limited to 'pkg/tcpip/link/channel/channel.go')
-rw-r--r-- | pkg/tcpip/link/channel/channel.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/tcpip/link/channel/channel.go b/pkg/tcpip/link/channel/channel.go index f75ee34ab..ef9126deb 100644 --- a/pkg/tcpip/link/channel/channel.go +++ b/pkg/tcpip/link/channel/channel.go @@ -123,6 +123,9 @@ func (q *queue) RemoveNotify(handle *NotificationHandle) { q.notify = notify } +var _ stack.LinkEndpoint = (*Endpoint)(nil) +var _ stack.GSOEndpoint = (*Endpoint)(nil) + // Endpoint is link layer endpoint that stores outbound packets in a channel // and allows injection of inbound packets. type Endpoint struct { @@ -130,6 +133,7 @@ type Endpoint struct { mtu uint32 linkAddr tcpip.LinkAddress LinkEPCapabilities stack.LinkEndpointCapabilities + SupportedGSOKind stack.SupportedGSO // Outbound packet queue. q *queue @@ -211,11 +215,16 @@ func (e *Endpoint) Capabilities() stack.LinkEndpointCapabilities { return e.LinkEPCapabilities } -// GSOMaxSize returns the maximum GSO packet size. +// GSOMaxSize implements stack.GSOEndpoint. func (*Endpoint) GSOMaxSize() uint32 { return 1 << 15 } +// SupportedGSO implements stack.GSOEndpoint. +func (e *Endpoint) SupportedGSO() stack.SupportedGSO { + return e.SupportedGSOKind +} + // MaxHeaderLength returns the maximum size of the link layer header. Given it // doesn't have a header, it just returns 0. func (*Endpoint) MaxHeaderLength() uint16 { |