summaryrefslogtreecommitdiff
path: root/drivers/nvme/target
diff options
context:
space:
mode:
authorSagi Grimberg <sagi@grimberg.me>2019-05-29 08:49:05 +0300
committerSagi Grimberg <sagi@grimberg.me>2019-05-30 21:07:37 +0300
commit6486199378a505c58fddc47459631235c9fb7638 (patch)
tree9ff33ff8845855161cf117e79dd6038211c7975a /drivers/nvme/target
parent5651cd3c43368873d0787b52acb2e0e08f3c5da4 (diff)
downloadlinux-6486199378a505c58fddc47459631235c9fb7638.tar.xz
nvme-tcp: fix queue mapping when queue count is limited
When the controller supports less queues than requested, we should make sure that queue mapping does the right thing and not assume that all queues are available. This fixes a crash when the controller supports less queues than requested. The rules are: 1. if no write queues are requested, we assign the available queues to the default queue map. The default and read queue maps share the existing queues. 2. if write queues are requested: - first make sure that read queue map gets the requested nr_io_queues count - then grant the default queue map the minimum between the requested nr_write_queues and the remaining queues. If there are no available queues to dedicate to the default queue map, fallback to (1) and share all the queues in the existing queue map. Also, provide a log indication on how we constructed the different queue maps. Reported-by: Harris, James R <james.r.harris@intel.com> Tested-by: Jim Harris <james.r.harris@intel.com> Cc: <stable@vger.kernel.org> # v5.0+ Suggested-by: Roy Shterman <roys@lightbitslabs.com> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Diffstat (limited to 'drivers/nvme/target')
0 files changed, 0 insertions, 0 deletions