Page MenuHomeFreeBSD

Allow iflib drivers to specify the buffer size used for each receive queue
ClosedPublic

Authored by pkelsey on Mar 3 2020, 4:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 14 2024, 6:06 AM
Unknown Object (File)
Dec 23 2023, 7:11 AM
Unknown Object (File)
Dec 3 2023, 5:55 AM
Unknown Object (File)
Nov 23 2023, 3:46 PM
Unknown Object (File)
Nov 9 2023, 4:10 PM
Unknown Object (File)
Nov 7 2023, 5:05 PM
Unknown Object (File)
Nov 2 2023, 5:11 PM
Unknown Object (File)
Oct 8 2023, 3:07 PM
Subscribers

Details

Summary

This patch leaves the existing iflib mechanism for choosing the receive queue buffer size in place, and extends it to allow drivers to specify on a per-queue basis whether iflib should determine the size or a driver-supplied size should be used. 'Per-queue' here uses the iflib terminology where the machinery for a given NIC queue is represented by an iflib queue set, which may itself be composed of multiple iflib queues.

A read-only freelist sysctl is also added to report the buffer size in use for each freelist (and thus for the corresponding receive queue).

The motivation for this change is the vmx driver, for which each NIC receive queue is served by two buffer descriptor rings. The first buffer descriptor ring is used for the first segment of a given packet, and the second buffer descriptor ring is used for any additional segments of a given packet (which cases arises under jumbo frame and LRO configurations). With this receive buffer ring structure and use, there is better memory utilization and throughput performance with jumbo frames and/or LRO when the size of the buffers used in the first descriptor ring are chosen based on the mtu (i.e., by iflib), and the size of the buffers used in the second descriptor ring are always page-sized.

Test Plan

This has been tested on a 12.1 system (with r356932 applied) with em and vmx devices.

This builds for 13-current, but testing on 13-current is waiting for the package system to get fixed.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision is now accepted and ready to land.Mar 3 2020, 6:01 PM

I think this looks okay, but I don't think it'll apply to the Intel drivers, right?

In D23947#526398, @erj wrote:

I think this looks okay, but I don't think it'll apply to the Intel drivers, right?

I would expect that the Intel drivers would stick with the existing approach (where the driver updates the max frame size and iflib then chooses the buffer size).