kernel/kernel-std
M. Vefa Bicakci 19ca0df55a kernel: Backport IRQ affinity patches
This commit backports IRQ affinity commits from the mainline kernel tree
to the StarlingX kernel. (Links to the patch series can be found at the
end of this commit message.) The intent is to be able to let certain
device drivers (such as i40e, iavf, ice, ixgbe and mlx5) use the global
IRQ affinity setting specified by 'irqaffinity=' on the kernel command
line.

In summary, a number of device drivers use the irq_set_affinity_hint
function to provide a hint to the userspace about the ideal affinity to
use with an IRQ. However, this function also sets the IRQ affinity,
which makes the IRQ use the hinted affinity rather than the global IRQ
affinity provided by the irqaffinity= argument. This is problematic for
StarlingX, as interrupts are, in general, expected to be affined
according to irqaffinity=, which is adjusted by Puppet.

The patch series deprecates the kernel function irq_set_affinity_hint,
and provides two replacements: (1) irq_set_affinity_and_hint and (2)
irq_update_affinity_hint. Replacement function (1) sets both the
affinity hint and the actual affinity, whereas (2) only sets the
affinity hint. The original function -- irq_set_affinity_hint -- remains
as a wrapper around (1), likely for backwards compatibility.

The remaining patches in the series modify a number of device drivers to
use the replacement functions. Of these patches, only the patch for the
ixgbe driver is kept, for two reasons:
- This commit aims to fix the IRQ affinities for network device drivers
  only.
- StarlingX has out-of-tree modules for most of the remaining network
  device drivers, and these will be modified with a separate commit.

Note that the first patch in this commit is included as a dependency for
the others: genirq-Export-affinity-setter-for-modules.patch

Finally, we should note that older versions of StarlingX that used
CentOS 7's v3.10-based kernel did not have this issue, because of a
CentOS 7-specific patch in that kernel that allowed the irqaffinity=
kernel command line argument to take precedence over the device
driver-provided IRQ affinity hints.

Testing:
- An ISO image was successfully built using a monolithic build
  procedure.

- The ISO image was installed and bootstrapped successfully with an
  All-in-One simplex system (physical server) in low-latency mode. This
  server has a management/OAM Ethernet controller managed by the ixgbe
  driver, whose operation was observed to not have been negatively
  affected.

- On another physical All-in-One simplex system which had one
  non-management/non-OAM Ethernet controller handled by the ixgbe
  driver, the IRQ affinities were confirmed to be set correctly by the
  changes in this commit.

  This was achieved by modifying two init scripts (affine-platfrom.sh
  and affine-interrupts.sh) so that they do not manipulate IRQ
  affinities, and observing IRQ affinities for ixgbe's interfaces with
  and without this patch.

Change-Id: Ibf47fd301a460638f3bb4c49865adc3b2429e06d
Partial-Bug: 1958417
Link: https://lore.kernel.org/netdev/20210903152430.244937-1-nitesh@redhat.com/
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=147cc5838c0f5c76e908b816e924ca378e0d4735
Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
2022-02-07 17:32:19 -05:00
..
2021-11-30 18:47:40 +00:00