Receive Side ScalingBCM5718 Programmer’s Guide
Broadcom®
January 29, 2016 • 5718-PG108-R Page 101
6. The BD used for the received packet is DMAed from the Ethernet controller to one of the receive return rings,
and the Receive Return Ring Producer Index register in the host status block is updated by the Ethernet
controller.
The host software must create an array of BD structures in host memory, referred to as a receive producer ring.
Each receive buffer descriptor within a producer ring describes, among other things, the location of a host
memory buffer that is used to store the packets received from the network. When the host software (as the
producer) updates the mailbox register’s producer ring index that corresponds to the receive producer ring, the
Ethernet controller automatically DMAs the BD to itself from the host. When the DMA is completed, the Ethernet
controller (as the consumer) updates the status block’s receive consumer ring index to signal it successfully
consumed the BD. The Ethernet controller keeps this BD in internal memory to know where to put a packet that
is received from the network.
When a packet is received from the network, a BD gets updated with information regarding the received packet
and the packet is DMAed to a location in host memory described by the BD. The Ethernet controller (as the
producer) then updates the receive return ring producer index in the Status Block register corresponding to one
of host memory’s receive return rings, and DMAs the BD to that receive return ring.
It is the responsibility of the host software to setup, initialize, and manage the data structures in host memory,
namely, the receive producer rings and the receive return rings. The producer/consumer indices in the mailbox
and status block are read and updated by the host and Ethernet controller for this purpose.
Receive Side Scaling
Overview
RSS is a scalable networking technology that enables receive packet processing to be balanced across multiple
processors in the system while maintaining in-order delivery of the data. The RSS enables packets from a single
network adapter to be processed in parallel on multiple CPUs/cores while preserving in-order delivery to TCP
connections.
Functional Description
The figure below shows the processing of received packets when RSS is enabled. The RSS algorithm is based
on a load-sharing algorithm and performs the following steps.
• Computes a hash on the incoming packet to produce a 32-bit Hash result.
• Performs a lookup in the load balancing table (also called indirection table) using the one to seven least
significant bits of the Hash result to determine which of the n CPUs are processing the packet, where n is
the number of CPUs assigned to process received packets.
• Adds a Base CPU Number to determine the exact CPU that will process the packet.