RDMA/efa: Limit EQs to available MSI-X vectors
authorYonatan Nachum <ynachum@amazon.com>
Wed, 31 Jan 2024 09:34:03 +0000 (09:34 +0000)
committerLeon Romanovsky <leon@kernel.org>
Wed, 31 Jan 2024 12:32:26 +0000 (14:32 +0200)
commit809c9c3bd6997edf2dcee4e1eb856425263be4f3
tree9a44a7e832362bba26ec9f838f377db4c4d5967c
parenta400073ce3dd3dbdf843e6c9c0a0a7f6ca9f05d7
RDMA/efa: Limit EQs to available MSI-X vectors

When creating EQs we take into consideration the max number of EQs the
device reported it can support and the number of available CPUs. There
are situations where the number of EQs the device reported it can
support and the PCI configuration of MSI-X is different, take it in
account as well when creating EQs.
Also request at least 1 MSI-X vector for the management queue and allow
the kernel to return a number of vectors in a range between 1 and the
max supported MSI-X vectors according to the PCI config.

Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Reviewed-by: Yonatan Goldhirsh <ygold@amazon.com>
Signed-off-by: Yonatan Nachum <ynachum@amazon.com>
Link: https://lore.kernel.org/r/20240131093403.18624-1-ynachum@amazon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/efa/efa.h
drivers/infiniband/hw/efa/efa_main.c