nvme-rdma: remove race conditions from IB signalling
authorMarta Rybczynska <mrybczyn@kalray.eu>
Tue, 6 Jun 2017 11:27:21 +0000 (13:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2017 22:08:03 +0000 (15:08 -0700)
commitd17cc7b7a7522c908636b32beee7537f64e3c043
tree0b6b1f608812048bfc4e74a750f961f35778205c
parent8f9dec0c2dbb99aa36fa2d242828d853abde8eb0
nvme-rdma: remove race conditions from IB signalling

commit 5e599d73c1c1816af07f94ddba879499aa39b43c upstream.

This patch improves the way the RDMA IB signalling is done by using atomic
operations for the signalling variable. This avoids race conditions on
sig_count.

The signalling interval changes slightly and is now the largest power of
two not larger than queue depth / 2.

ilog() usage idea by Bart Van Assche.

Signed-off-by: Marta Rybczynska <marta.rybczynska@kalray.eu>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvme/host/rdma.c