linux_dsm_epyc7002/drivers/nvme/host
Ming Lei 612b72862b nvme-pci: Simplify interrupt allocation
The NVME PCI driver contains a tedious mechanism for interrupt
allocation, which is necessary to adjust the number and size of interrupt
sets to the maximum available number of interrupts which depends on the
underlying PCI capabilities and the available CPU resources.

It works around the former short comings of the PCI and core interrupt
allocation mechanims in combination with interrupt sets.

The PCI interrupt allocation function allows to provide a maximum and a
minimum number of interrupts to be allocated and tries to allocate as
many as possible. This worked without driver interaction as long as there
was only a single set of interrupts to handle.

With the addition of support for multiple interrupt sets in the generic
affinity spreading logic, which is invoked from the PCI interrupt
allocation, the adaptive loop in the PCI interrupt allocation did not
work for multiple interrupt sets. The reason is that depending on the
total number of interrupts which the PCI allocation adaptive loop tries
to allocate in each step, the number and the size of the interrupt sets
need to be adapted as well. Due to the way the interrupt sets support was
implemented there was no way for the PCI interrupt allocation code or the
core affinity spreading mechanism to invoke a driver specific function
for adapting the interrupt sets configuration.

As a consequence the driver had to implement another adaptive loop around
the PCI interrupt allocation function and calling that with maximum and
minimum interrupts set to the same value. This ensured that the
allocation either succeeded or immediately failed without any attempt to
adjust the number of interrupts in the PCI code.

The core code now allows drivers to provide a callback to recalculate the
number and the size of interrupt sets during PCI interrupt allocation,
which in turn allows the PCI interrupt allocation function to be called
in the same way as with a single set of interrupts. The PCI code handles
the adaptive loop and the interrupt affinity spreading mechanism invokes
the driver callback to adapt the interrupt set configuration to the
current loop value. This replaces the adaptive loop in the driver
completely.

Implement the NVME specific callback which adjusts the interrupt sets
configuration and remove the adaptive allocation loop.

[ tglx: Simplify the callback further and restore the dropped adjustment of
  	number of sets ]

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Bjorn Helgaas <helgaas@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: linux-nvme@lists.infradead.org
Cc: linux-pci@vger.kernel.org
Cc: Keith Busch <keith.busch@intel.com>
Cc: Sumit Saxena <sumit.saxena@broadcom.com>
Cc: Kashyap Desai <kashyap.desai@broadcom.com>
Cc: Shivasharan Srikanteshwara <shivasharan.srikanteshwara@broadcom.com>
Link: https://lkml.kernel.org/r/20190216172228.602546658@linutronix.de
2019-02-18 11:21:28 +01:00
..
core.c nvme: don't initlialize ctrl->cntlid twice 2019-01-09 13:47:08 -05:00
fabrics.c nvme-fabrics: unset write/poll queues for discovery controllers 2019-01-09 13:47:06 -05:00
fabrics.h nvme-fabrics: allow user to pass in nr_poll_queues 2018-12-18 17:50:49 +01:00
fault_inject.c nvme: Add fault injection feature 2018-03-26 08:53:43 -06:00
fc.c nvme-fabrics: allow nvmf_connect_io_queue to poll 2018-12-18 17:50:48 +01:00
Kconfig nvme-tcp: add NVMe over TCP host driver 2018-12-13 09:58:58 +01:00
lightnvm.c nvme: remove nvme_common command cdw10 array 2018-12-13 09:59:01 +01:00
Makefile nvme-tcp: add NVMe over TCP host driver 2018-12-13 09:58:58 +01:00
multipath.c nvme-multipath: drop optimization for static ANA group IDs 2019-01-23 17:16:59 -07:00
nvme.h nvme: introduce NVME_QUIRK_IGNORE_DEV_SUBNQN 2019-01-09 13:47:08 -05:00
pci.c nvme-pci: Simplify interrupt allocation 2019-02-18 11:21:28 +01:00
rdma.c nvme-rdma: rework queue maps handling 2019-01-23 17:16:59 -07:00
tcp.c nvme-tcp: fix timeout handler 2019-01-23 17:16:59 -07:00
trace.c nvme-pci: trace SQ status on completions 2018-12-19 08:35:36 +01:00
trace.h nvme-pci: trace SQ status on completions 2018-12-19 08:35:36 +01:00