[PATCH v3] net/af_packet: add multi-segment mbuf support for jumbo frames

Stephen Hemminger stephen at networkplumber.org
Thu Mar 12 17:06:18 CET 2026


On Thu, 12 Mar 2026 08:34:03 +0100
Sriram Yagnaraman <sriram.yagnaraman at ericsson.com> wrote:

> Enable jumbo frame reception with default mbuf data room size by
> chaining multiple mbufs when packet exceeds single mbuf tailroom.
> 
> Scatter Rx is only enabled when RTE_ETH_RX_OFFLOAD_SCATTER is
> requested. Packets are dropped if they exceed single mbuf size
> and scatter is not enabled, or if mbuf allocation fails during
> chaining. Error counter rx_dropped_pkts tracks all drops.
> 
> This allows receiving 9KB jumbo frames using standard 2KB mbufs,
> chaining ~5 segments per jumbo packet.
> ---

Scatter is good, but additional checks are necessary to validate
mbuf pool and buffer constraints. See virtio configure for example.

bool
virtio_rx_check_scatter(uint16_t max_rx_pkt_len, uint16_t rx_buf_size,
			bool rx_scatter_enabled, const char **error)
{
	if (!rx_scatter_enabled && max_rx_pkt_len > rx_buf_size) {
		*error = "Rx scatter is disabled and RxQ mbuf pool object size is too small";
		return false;
	}

	return true;
}


More information about the dev mailing list