nvme-rdma: assign completion vector correctly
authorMax Gurtovoy <maxg@mellanox.com>
Tue, 23 Jun 2020 14:55:25 +0000 (17:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jul 2020 06:16:36 +0000 (08:16 +0200)
commit010f93079a260a8de14d2a58167bdaf3f322419c
treee2f08338bb9d58e1a1a0dd0da893e7447ef1e61e
parent074ae0cd8407a423053bd33feb602108fa3cf4f1
nvme-rdma: assign completion vector correctly

[ Upstream commit 032a9966a22a3596addf81dacf0c1736dfedc32a ]

The completion vector index that is given during CQ creation can't
exceed the number of support vectors by the underlying RDMA device. This
violation currently can accure, for example, in case one will try to
connect with N regular read/write queues and M poll queues and the sum
of N + M > num_supported_vectors. This will lead to failure in establish
a connection to remote target. Instead, in that case, share a completion
vector between queues.

Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/rdma.c