Page MenuHomeFreeBSD

ena: Add sysctl support for spreading IRQs
AcceptedPublic

Authored by osamaabb_amazon.com on Nov 17 2023, 5:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 23 2024, 2:20 AM
Unknown Object (File)
Apr 11 2024, 5:16 AM
Unknown Object (File)
Dec 28 2023, 4:16 PM
Unknown Object (File)
Dec 23 2023, 2:15 AM
Unknown Object (File)
Dec 21 2023, 2:50 AM
Unknown Object (File)
Dec 20 2023, 1:38 AM
Unknown Object (File)
Nov 25 2023, 9:23 AM
Unknown Object (File)
Nov 20 2023, 7:22 AM
Subscribers

Details

Summary

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.

MFC after: 2 weeks
Sponsored by: Amazon, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

osamaabb_amazon.com created this object with edit policy "No One".
osamaabb_amazon.com retitled this revision from Add sysctl support for spreading IRQs to ena: Add sysctl support for spreading IRQs.
osamaabb_amazon.com edited the summary of this revision. (Show Details)
osamaabb_amazon.com edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Dec 18 2023, 11:59 AM

Can you add something to the commit message about the #ifdef RSS going away?

Can you add something to the commit message about the #ifdef RSS going away?

Sure, added an explanation of this change