GRO

GRO (Generic Receive Offload) reassembles TCP segments in the kernel network stack to reduce CPU overhead. Learn how GRO works and how it differs from LRO.

Jul 23rd 2026 66
in f X Link
Home / Glossary / GRO
GRO
Related Terms
Recommended Products
Previous
LRO

What Is GRO?

GRO (Generic Receive Offload) is a Linux kernel feature that reassembles incoming TCP segments into larger buffers within the network stack. Unlike LRO, which runs on the NIC hardware, GRO operates between the NIC driver and the transport layer. This means GRO works with any interface, including virtual NICs, bridges, and VLANs. The kernel merged GRO in version 2.6.29 (Linux kernel documentation, net/core/gro.c).

How Does GRO Work?

GRO coalesces TCP segments at a defined point in the Linux network stack:

  • NAPI Poll Entry: The NIC driver receives frames via NAPI polling. Instead of one interrupt per frame, the driver collects a batch and passes them to the GRO layer.
  • Flow Lookup: GRO extracts the TCP 5-tuple from each segment and searches a per-device coalescing table. If no match exists, GRO creates a new entry and holds the segment.
  • Sequential Merge: When a segment matches an existing flow, GRO checks for in-order sequence numbers and appends the payload to the held buffer. Out-of-order or FIN/RST segments flush the buffer.
  • Buffer Flush: The coalesced buffer moves upward when the NAPI poll batch ends, the buffer reaches maximum size, or a non-data segment arrives.
  • Upper Stack Delivery: The TCP layer receives one large sk_buff instead of many small ones. No application or protocol changes are needed.

GRO runs above the driver, so it handles virtual interfaces and tunnels where hardware LRO has no visibility.

gro principle diagram

Key Benefits

  • Universal Compatibility: GRO works on physical NICs, virtio-net, veth, bridges, bonds, and VLAN interfaces. LRO requires NIC hardware support and only works on physical adapters (Linux kernel documentation, 2009).
  • Reduced Stack Traversals: GRO cuts the packets entering the upper stack by a factor of 10 to 40, reducing per-packet cost for netfilter, routing lookups, and TCP processing (Red Hat Enterprise Linux Networking Guide, 2023).
  • Virtualization Without LRO Limits: KVM hosts use virtio-net for guest traffic where hardware LRO cannot reach. GRO coalesces guest traffic in the host stack, reducing CPU overhead for hosts running dozens of VMs.
  • Safe for Routing and Firewalls: Unlike LRO, GRO operates before the forwarding decision, making it safe for Linux routers, firewall workloads, and Kubernetes container networking with veth pairs and bridge networks.
  • Lower Softirq Load: On a 25GbE link at line rate, GRO reduces softirq invocations from 1.96 million per second to under 50,000, matching LRO-level efficiency in software (Intel E810 datasheet, 2023).

gro scenario

Related Technologies

  • LRO performs the same coalescing on the NIC hardware. LRO is faster because it reduces DMA transfers before packets reach the kernel, but it cannot handle virtual or routed traffic. Most Linux systems disable hardware LRO and rely on GRO.
  • TSO is the transmit-path counterpart. TSO segments large buffers into MTU-sized frames on send; GRO reassembles frames into large buffers on receive.
  • VLAN tagging adds a 4-byte 802.1Q header. GRO strips the tag before coalescing and reconstructs correct headers on flush, so tagged traffic benefits without special configuration.
Related Terms:LRO, TSO, NIC, VLAN
联系我们