HomeFreeBSD

ena: Add sysctl support for spreading IRQs

Description

ena: Add sysctl support for spreading IRQs

This commit allows spreading IO IRQs over different CPUs through sysctl.
Two sysctl nodes are introduced:
1- base_cpu: servers as the first CPU to which the first IO IRQ
will be bound.
2- cpu_stride: sets the distance between every two CPUs to which every
two consecutive IO IRQs are bound.

For example for doing the following IO IRQs / CPU binding:

IRQ idx | CPU

1    |   0
2    |   2
3    |   4
4    |   6

Run the following commands:
sysctl dev.ena.<device index>.irq_affinity.base_cpu=0
sysctl dev.ena.<device_index>.irq_affinity.cpu_stride=2

Also introduced rss_enabled field, which is intended to replace
'#ifdef RSS' in multiple places, in order to prevent code duplication.

We want to bind interrupts to CPUs in case of rss set OR in case
the newly defined sysctl paremeter is set. This requires to remove a
couple of '#ifdef RSS' as well in the structs, since we'll be using the
relevant parameters in the CPU binding code.

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

Details

Provenance
osamaabb_amazon.comAuthored on Oct 30 2023, 11:27 AM
akiyano_amazon.comCommitted on Dec 28 2023, 1:55 PM
Parents
rGadfed2d835a7: ena: Upgrade ena-com to freebsd v2.7.0
Branches
Unknown
Tags
Unknown