Large Receive Offloading LRO

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Overview

Large Receive Offloading (LRO), is a feature in a suite of offloading features of modern networking interfaces wherein specific work on incoming frames can be performed before it arrives at any software component such as a driver by being handled on the device, or in this case, virtual device of the hypervisor.

Specifically LRO is used to reduce CPU time spent processing incoming TCP frames on the operating system's kernel by having the network card collect many frames, aggregate them into one large frame by combining headers and doing correct calculations to ensure consistancy of the data as well as each protocol header, and passing one very large frame to the kernel instead of many smaller ones. This will in turn require only a single cycle of packet processing for the subsequent data as only one frame with a significantly larger payload can be processed with a single header to the data, requiring less work on the CPU directly and more work on the network card.

The benefit is that we delegate work to the network interface to do this before it is received by the kernel and have a potential for some CPU gain, wherein the kernel can spent that time it would have spent processing headers on other tasks. In reality, although this may be a potential gain, many network card vendors (and virtual network card vendors) have had issues with LRO both in hardware and in driver-space.

The impact of keeping LRO disabled is really the impact of normal operation, without CPU offload benefit. Although it is not possible to provide any numbers on potential gain of CPU time without understanding a traffic profile and doing extensive debugging and testing in a non-production environment, keeping it disabled should not be deleterious as we would process those frames normally on a network interface that had no LRO traffic, so the benefit is usually minimal.