IRQ affinity issue

Hi,

Does the Unmatched board’s IRQ controller support CPU affinity settings?

root@OpenWrt:/proc/irq/66# echo 1 > smp_affinity
ash: write error: Invalid argument

I am using OpenWrt 23.05.3, r23809-234f1a2efa, the IRQ 66 is attached to a RX/TX channel of Intel 82599es NIC, which is plugged in the PCIe slot.

Thanks,
dsw

The primary interrupt controller in the Unmatched’s SoC (the PLIC) does support setting per-IRQ CPU affinity. That is why you are able to write to the smp_affinity file for other interrupts, like those for the onboard UARTs and Ethernet controller. The limitation you are facing applies only to PCIe interrupts (MSIs). The PCIe controller in the FU740 SoC is configured/integrated in such a way that all MSIs are aggregated to a single IRQ input to the PLIC. So at the hardware level, it is possible to change the CPU affinity of all MSIs as a group, but not to split MSIs across multiple CPUs by setting the affinity of a single MSI. That is why Linux does not allow writing to that specific smp_affinity file.

Furthermore, Linux does not expose an interface to change the affinity of the intermediate (in kernel terms, “chained”) interrupt that forwards MSIs to the PLIC for architectural reasons. This is purely a software limitation. For more information, see at least the following discussions on the LKML:

https://lore.kernel.org/all/87fslr7ygl.wl-maz@kernel.org/
https://lore.kernel.org/all/d3b32b23c79f78ea99316bae77fab2064833d8e7.camel@redhat.com/