]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
iflib: Improve mapping of TX/RX queues to CPUs
authorPatrick Kelsey <pkelsey@FreeBSD.org>
Mon, 26 Apr 2021 04:25:59 +0000 (00:25 -0400)
committerKevin Bowling <kbowling@FreeBSD.org>
Fri, 27 Aug 2021 16:08:27 +0000 (09:08 -0700)
commita436245ccf1ab7accd234b7f75904e24a44b8be6
tree8926003c11fff733624eadddbbe289b72cc85f11
parent74ef8d180fb0f063fffc63b7100073c1a43f8bf6
iflib: Improve mapping of TX/RX queues to CPUs

iflib now supports mapping each (TX,RX) queue pair to the same CPU
(default), to separate CPUs, or to a pair of physical and logical CPUs
that share the same L2 cache.  The mapping mechanism supports unequal
numbers of TX and RX queues, with the excess queues always being
mapped to consecutive physical CPUs.  When the platform cannot
distinguish between physical and logical CPUs, all are treated as
physical CPUs.  See the comment on get_cpuid_for_queue() for the
entire matrix.

The following device-specific tunables influence the mapping process:
dev.<device>.<unit>.iflib.core_offset       (existing)
dev.<device>.<unit>.iflib.separate_txrx     (existing)
dev.<device>.<unit>.iflib.use_logical_cores (new)

The following new, read-only sysctls provide visibility of the mapping
results:
dev.<device>.<unit>.iflib.{t,r}xq<n>.cpu

When an iflib driver allocates TX softirqs without providing reference
RX IRQs, iflib now binds those TX softirqs to CPUs using the above
mapping mechanism (that is, treats them as if they were TX IRQs).
Previously, such bindings were left up to the grouptaskqueue code and
thus fell outside of the iflib CPU mapping strategy.

Reviewed by: kbowling
Tested by: olivier, pkelsey
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D24094

(cherry picked from commit ca7005f1893d199b7c28d5b159e1bdbb55e74543)
sys/net/iflib.c
sys/sys/cpuset.h