This only saves ~32KB in the minimal linux/amd64 binary, but it's a step towards permitting not depending on gvisor for small builds. Updates #17283 Change-Id: Iae8da5e9465127de354dbcaf25e794a6832d891b Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>main
parent
f2b8d37436
commit
b3ae1cb0cc
@ -0,0 +1,13 @@ |
|||||||
|
// Copyright (c) Tailscale Inc & AUTHORS
|
||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
// Code generated by gen.go; DO NOT EDIT.
|
||||||
|
|
||||||
|
//go:build ts_omit_gro
|
||||||
|
|
||||||
|
package buildfeatures |
||||||
|
|
||||||
|
// HasGRO is whether the binary was built with support for modular feature "Generic Receive Offload support (performance)".
|
||||||
|
// Specifically, it's whether the binary was NOT built with the "ts_omit_gro" build tag.
|
||||||
|
// It's a const so it can be used for dead code elimination.
|
||||||
|
const HasGRO = false |
||||||
@ -0,0 +1,13 @@ |
|||||||
|
// Copyright (c) Tailscale Inc & AUTHORS
|
||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
// Code generated by gen.go; DO NOT EDIT.
|
||||||
|
|
||||||
|
//go:build !ts_omit_gro
|
||||||
|
|
||||||
|
package buildfeatures |
||||||
|
|
||||||
|
// HasGRO is whether the binary was built with support for modular feature "Generic Receive Offload support (performance)".
|
||||||
|
// Specifically, it's whether the binary was NOT built with the "ts_omit_gro" build tag.
|
||||||
|
// It's a const so it can be used for dead code elimination.
|
||||||
|
const HasGRO = true |
||||||
@ -1,22 +1,27 @@ |
|||||||
// Copyright (c) Tailscale Inc & AUTHORS
|
// Copyright (c) Tailscale Inc & AUTHORS
|
||||||
// SPDX-License-Identifier: BSD-3-Clause
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
//go:build ios
|
//go:build ios || ts_omit_gro
|
||||||
|
|
||||||
package gro |
package gro |
||||||
|
|
||||||
import ( |
import ( |
||||||
"gvisor.dev/gvisor/pkg/tcpip/stack" |
"runtime" |
||||||
|
|
||||||
"tailscale.com/net/packet" |
"tailscale.com/net/packet" |
||||||
) |
) |
||||||
|
|
||||||
type GRO struct{} |
type GRO struct{} |
||||||
|
|
||||||
func NewGRO() *GRO { |
func NewGRO() *GRO { |
||||||
panic("unsupported on iOS") |
if runtime.GOOS == "ios" { |
||||||
|
panic("unsupported on iOS") |
||||||
|
} |
||||||
|
panic("GRO disabled in build") |
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
func (g *GRO) SetDispatcher(_ stack.NetworkDispatcher) {} |
func (g *GRO) SetDispatcher(any) {} |
||||||
|
|
||||||
func (g *GRO) Enqueue(_ *packet.Parsed) {} |
func (g *GRO) Enqueue(_ *packet.Parsed) {} |
||||||
|
|
||||||
Loading…
Reference in new issue