gro

package
v1.104.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: BSD-3-Clause Imports: 11 Imported by: 1 module, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gro implements GRO for the receive (write) path into gVisor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RXChecksumOffload

func RXChecksumOffload(p *packet.Parsed) *stack.PacketBuffer

RXChecksumOffload validates IPv4, TCP, and UDP header checksums in p, returning an equivalent *stack.PacketBuffer if they are valid, otherwise nil. The set of headers validated covers where gVisor would perform validation if !stack.PacketBuffer.RXChecksumValidated, i.e. it satisfies stack.CapabilityRXChecksumOffload. Other protocols with checksum fields, e.g. ICMP{v6}, are still validated by gVisor regardless of rx checksum offloading capabilities. IPv4 fragments cannot have their L4 checksums validated before reassembly, so only their IPv4 header checksum is validated here.

Types

type GRO

type GRO struct {
	// contains filtered or unexported fields
}

GRO coalesces incoming packets to increase throughput. It is NOT thread-safe.

func NewGRO

func NewGRO() *GRO

NewGRO returns a new instance of *GRO from a sync.Pool. It can be returned to the pool with GRO.Flush().

func (*GRO) Enqueue

func (g *GRO) Enqueue(p *packet.Parsed)

Enqueue enqueues the provided packet for GRO. It may immediately deliver it to the underlying stack.NetworkDispatcher depending on its contents. To explicitly flush previously enqueued packets see Flush().

func (*GRO) Flush

func (g *GRO) Flush()

Flush flushes previously enqueued packets to the underlying stack.NetworkDispatcher, and returns GRO to a pool for later re-use. Callers MUST NOT use GRO once it has been Flush()'d.

func (*GRO) SetDispatcher

func (g *GRO) SetDispatcher(d stack.NetworkDispatcher)

SetDispatcher sets the underlying stack.NetworkDispatcher where packets are delivered.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL