Course contentsShow
← Linux
Lesson 1103 of 1,81910. Network Administration and Kernel StacksFree lesson

Hardware Offloading Capabilities

Enable and verify NIC-level offloading for checksums and segmentation.

In this lesson, you will learn how to shift network processing tasks from the system CPU to the Network Interface Card (NIC) to improve throughput and reduce latency.

The Concept: Offloading

Normally, the Linux kernel handles tasks like calculating TCP/UDP checksums (to verify data integrity) and segmenting large data packets into smaller segments that fit the network MTU. These are computationally expensive. "Hardware Offloading" allows the NIC to take over these responsibilities, effectively letting the hardware do the "heavy lifting" so the CPU can focus on application-level logic.

Verifying Capabilities

We use the ethtool utility to inspect and modify these features. First, identify your interface name (e.g., eth0), then query its current offloading status:

# View all offloading features for eth0
ethtool -k eth0

In the output, look for features like tx-checksumming (sending) or rx-checksumming (receiving), and tso (TCP Segmentation Offload). If a feature is set to off, the kernel is doing the work. If it is on, the NIC is.

Enabling Offloading

If you identify that a performance-critical NIC has these features disabled, you can enable them using ethtool. For example, to enable TCP Segmentation Offload:

# Enable TSO on eth0
sudo ethtool -K eth0 tso on

Why it Matters

When tso is active, the kernel sends a single large buffer (up to 64KB) to the NIC, and the NIC splits it into individual MTU-sized packets. This significantly lowers the number of interrupts the kernel must process, preventing CPU bottlenecks during high-traffic bursts. However, keep in mind that hardware offloading can occasionally complicate network debugging (e.g., if you run tcpdump on an interface with offloading enabled, you might see "large" packets that haven't been segmented yet, which can be misleading).

Key Takeaway: Hardware offloading leverages the NIC’s processing power to handle packet checksums and segmentation, freeing the CPU from repetitive tasks and boosting overall network efficiency.