diff --git a/pkg/tcpip/link/fdbased/endpoint.go b/pkg/tcpip/link/fdbased/endpoint.go index 1e0b9f0cd..e5523c7e9 100644 --- a/pkg/tcpip/link/fdbased/endpoint.go +++ b/pkg/tcpip/link/fdbased/endpoint.go @@ -66,7 +66,7 @@ type linkDispatcher interface { type PacketDispatchMode int // BatchSize is the number of packets to write in each syscall. It is 47 -// because when GvisorGSO is in use then a single 65KB TCP segment can get +// because when GVisorGSO is in use then a single 65KB TCP segment can get // split into 46 segments of 1420 bytes and a single 216 byte segment. const BatchSize = 47 @@ -201,8 +201,8 @@ type Options struct { // disabled. GSOMaxSize uint32 - // GvisorGSOEnabled indicates whether Gvisor GSO is enabled or not. - GvisorGSOEnabled bool + // GVisorGSOEnabled indicates whether Gvisor GSO is enabled or not. + GVisorGSOEnabled bool // PacketDispatchMode specifies the type of inbound dispatcher to be // used for this endpoint. @@ -315,8 +315,8 @@ func New(opts *Options) (stack.LinkEndpoint, error) { e.fds = append(e.fds, fdInfo{fd: fd, isSocket: isSocket}) if isSocket { if opts.GSOMaxSize != 0 { - if opts.GvisorGSOEnabled { - e.gsoKind = stack.GvisorGSOSupported + if opts.GVisorGSOEnabled { + e.gsoKind = stack.GVisorGSOSupported } else { e.gsoKind = stack.HostGSOSupported } diff --git a/pkg/tcpip/link/qdisc/fifo/fifo.go b/pkg/tcpip/link/qdisc/fifo/fifo.go index 1d917f3c1..eb1c22709 100644 --- a/pkg/tcpip/link/qdisc/fifo/fifo.go +++ b/pkg/tcpip/link/qdisc/fifo/fifo.go @@ -29,7 +29,7 @@ var _ stack.QueueingDiscipline = (*discipline)(nil) const ( // BatchSize is the number of packets to write in each syscall. It is 47 - // because when GvisorGSO is in use then a single 65KB TCP segment can get + // because when GVisorGSO is in use then a single 65KB TCP segment can get // split into 46 segments of 1420 bytes and a single 216 byte segment. BatchSize = 47 diff --git a/pkg/tcpip/link/sharedmem/sharedmem.go b/pkg/tcpip/link/sharedmem/sharedmem.go index 7b46c7992..2cf1f82c3 100644 --- a/pkg/tcpip/link/sharedmem/sharedmem.go +++ b/pkg/tcpip/link/sharedmem/sharedmem.go @@ -515,5 +515,5 @@ func (e *endpoint) GSOMaxSize() uint32 { // SupportsGSO implements stack.GSOEndpoint. func (e *endpoint) SupportedGSO() stack.SupportedGSO { - return stack.GvisorGSOSupported + return stack.GVisorGSOSupported } diff --git a/pkg/tcpip/stack/registration.go b/pkg/tcpip/stack/registration.go index eb829b718..8b1003968 100644 --- a/pkg/tcpip/stack/registration.go +++ b/pkg/tcpip/stack/registration.go @@ -1370,9 +1370,9 @@ const ( // non-networking data layer. HostGSOSupported - // GvisorGSOSupported indicates that segmentation offloading may be performed + // GVisorGSOSupported indicates that segmentation offloading may be performed // in gVisor. - GvisorGSOSupported + GVisorGSOSupported ) // GSOEndpoint provides access to GSO properties. @@ -1384,6 +1384,6 @@ type GSOEndpoint interface { SupportedGSO() SupportedGSO } -// GvisorGSOMaxSize is a maximum allowed size of a software GSO segment. +// GVisorGSOMaxSize is a maximum allowed size of a software GSO segment. // This isn't a hard limit, because it is never set into packet headers. -const GvisorGSOMaxSize = 1 << 16 +const GVisorGSOMaxSize = 1 << 16 diff --git a/pkg/tcpip/stack/route.go b/pkg/tcpip/stack/route.go index e386ded72..4fae6c36e 100644 --- a/pkg/tcpip/stack/route.go +++ b/pkg/tcpip/stack/route.go @@ -311,10 +311,10 @@ func (r *Route) RequiresTXTransportChecksum() bool { return r.outgoingNIC.NetworkLinkEndpoint.Capabilities()&CapabilityTXChecksumOffload == 0 } -// HasGvisorGSOCapability returns true if the route supports gVisor GSO. -func (r *Route) HasGvisorGSOCapability() bool { +// HasGVisorGSOCapability returns true if the route supports gVisor GSO. +func (r *Route) HasGVisorGSOCapability() bool { if gso, ok := r.outgoingNIC.NetworkLinkEndpoint.(GSOEndpoint); ok { - return gso.SupportedGSO() == GvisorGSOSupported + return gso.SupportedGSO() == GVisorGSOSupported } return false } diff --git a/pkg/tcpip/transport/tcp/endpoint.go b/pkg/tcpip/transport/tcp/endpoint.go index cf0b0093b..b9ae74eb0 100644 --- a/pkg/tcpip/transport/tcp/endpoint.go +++ b/pkg/tcpip/transport/tcp/endpoint.go @@ -3197,7 +3197,7 @@ func (e *Endpoint) initHostGSO() { func (e *Endpoint) initGSO() { if e.route.HasHostGSOCapability() { e.initHostGSO() - } else if e.route.HasGvisorGSOCapability() { + } else if e.route.HasGVisorGSOCapability() { e.gso = stack.GSO{ MaxSize: e.route.GSOMaxSize(), Type: stack.GSOGvisor, diff --git a/runsc/boot/network.go b/runsc/boot/network.go index 46a8e04d3..685ababf9 100644 --- a/runsc/boot/network.go +++ b/runsc/boot/network.go @@ -98,8 +98,8 @@ type FDBasedLink struct { Addresses []IPWithPrefix Routes []Route GSOMaxSize uint32 - GvisorGSOEnabled bool - GvisorGRO bool + GVisorGSOEnabled bool + GVisorGRO bool TXChecksumOffload bool RXChecksumOffload bool LinkAddress net.HardwareAddr @@ -135,7 +135,7 @@ type XDPLink struct { LinkAddress net.HardwareAddr QDisc config.QueueingDiscipline Neighbors []Neighbor - GvisorGRO bool + GVisorGRO bool Bind BindOpt // NumChannels controls how many underlying FDs are to be used to @@ -148,7 +148,7 @@ type LoopbackLink struct { Name string Addresses []IPWithPrefix Routes []Route - GvisorGRO bool + GVisorGRO bool } // CreateLinksAndRoutesArgs are arguments to CreateLinkAndRoutes. @@ -312,10 +312,10 @@ func (n *Network) CreateLinksAndRoutes(args *CreateLinksAndRoutesArgs, _ *struct Address: mac, PacketDispatchMode: dispatchMode, GSOMaxSize: link.GSOMaxSize, - GvisorGSOEnabled: link.GvisorGSOEnabled, + GVisorGSOEnabled: link.GVisorGSOEnabled, TXChecksumOffload: link.TXChecksumOffload, RXChecksumOffload: link.RXChecksumOffload, - GRO: link.GvisorGRO, + GRO: link.GVisorGRO, }) if err != nil { return err @@ -408,7 +408,7 @@ func (n *Network) CreateLinksAndRoutes(args *CreateLinksAndRoutesArgs, _ *struct RXChecksumOffload: link.RXChecksumOffload, InterfaceIndex: link.InterfaceIndex, Bind: link.Bind == BindSentry, - GRO: link.GvisorGRO, + GRO: link.GVisorGRO, }) if err != nil { return err diff --git a/runsc/config/config.go b/runsc/config/config.go index c0cf4a02c..fe56a5ef9 100644 --- a/runsc/config/config.go +++ b/runsc/config/config.go @@ -121,12 +121,12 @@ type Config struct { // HostGSO indicates that host segmentation offload is enabled. HostGSO bool `flag:"gso"` - // GvisorGSO indicates that gVisor segmentation offload is enabled. The flag + // GVisorGSO indicates that gVisor segmentation offload is enabled. The flag // retains its old name of "software" GSO for API consistency. - GvisorGSO bool `flag:"software-gso"` + GVisorGSO bool `flag:"software-gso"` - // GvisorGRO enables gVisor's generic receive offload. - GvisorGRO bool `flag:"gvisor-gro"` + // GVisorGRO enables gVisor's generic receive offload. + GVisorGRO bool `flag:"gvisor-gro"` // TXChecksumOffload indicates that TX Checksum Offload is enabled. TXChecksumOffload bool `flag:"tx-checksum-offload"` diff --git a/runsc/sandbox/network.go b/runsc/sandbox/network.go index dfbe9322b..b8f402597 100644 --- a/runsc/sandbox/network.go +++ b/runsc/sandbox/network.go @@ -77,7 +77,7 @@ func setupNetwork(conn *urpc.Client, pid int, conf *config.Config) error { func createDefaultLoopbackInterface(conf *config.Config, conn *urpc.Client) error { link := boot.DefaultLoopbackLink - link.GvisorGRO = conf.GvisorGRO + link.GVisorGRO = conf.GVisorGRO if err := conn.Call(boot.NetworkCreateLinksAndRoutes, &boot.CreateLinksAndRoutesArgs{ LoopbackLinks: []boot.LoopbackLink{link}, }, nil); err != nil { @@ -277,7 +277,7 @@ func createInterfacesAndRoutesFromNS(conn *urpc.Client, nsPath string, conf *con Neighbors: neighbors, LinkAddress: linkAddress, Addresses: addresses, - GvisorGRO: conf.GvisorGRO, + GVisorGRO: conf.GVisorGRO, }) } else { link := boot.FDBasedLink{ @@ -312,12 +312,12 @@ func createInterfacesAndRoutesFromNS(conn *urpc.Client, nsPath string, conf *con args.FilePayload.Files = append(args.FilePayload.Files, socketEntry.deviceFile) } - if link.GSOMaxSize == 0 && conf.GvisorGSO { + if link.GSOMaxSize == 0 && conf.GVisorGSO { // Host GSO is disabled. Let's enable gVisor GSO. - link.GSOMaxSize = stack.GvisorGSOMaxSize - link.GvisorGSOEnabled = true + link.GSOMaxSize = stack.GVisorGSOMaxSize + link.GVisorGSOEnabled = true } - link.GvisorGRO = conf.GvisorGRO + link.GVisorGRO = conf.GVisorGRO args.FDBasedLinks = append(args.FDBasedLinks, link) } @@ -430,7 +430,7 @@ func createSocket(iface net.Interface, ifaceLink netlink.Link, enableGSO bool) ( func loopbackLink(conf *config.Config, iface net.Interface, addrs []net.Addr) (boot.LoopbackLink, error) { link := boot.LoopbackLink{ Name: iface.Name, - GvisorGRO: conf.GvisorGRO, + GVisorGRO: conf.GVisorGRO, } for _, addr := range addrs { ipNet, ok := addr.(*net.IPNet) diff --git a/runsc/sandbox/xdp.go b/runsc/sandbox/xdp.go index 22898b5cc..09a1cddc8 100644 --- a/runsc/sandbox/xdp.go +++ b/runsc/sandbox/xdp.go @@ -216,7 +216,7 @@ func prepareRedirectInterfaceArgs(bind boot.BindOpt, conf *config.Config) (boot. Neighbors: neighbors, LinkAddress: linkAddress, Addresses: []boot.IPWithPrefix{addr}, - GvisorGRO: conf.GvisorGRO, + GVisorGRO: conf.GVisorGRO, Bind: bind, } args.XDPLinks = append(args.XDPLinks, xdplink) diff --git a/test/benchmarks/tcp/tcp_proxy.go b/test/benchmarks/tcp/tcp_proxy.go index 7bd04b1b4..540e040f1 100644 --- a/test/benchmarks/tcp/tcp_proxy.go +++ b/test/benchmarks/tcp/tcp_proxy.go @@ -231,7 +231,7 @@ func newNetstackImpl(mode string) (impl, error) { // PacketDispatchMode: fdbased.RecvMMsg, PacketDispatchMode: fdbased.PacketMMap, GSOMaxSize: uint32(*gso), - GvisorGSOEnabled: *swgso, + GVisorGSOEnabled: *swgso, }) } if err != nil {