aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvme/target/nvmet.h
diff options
context:
space:
mode:
authorJames Smart <jsmart2021@gmail.com>2017-10-18 14:33:59 -0700
committerChristoph Hellwig <hch@lst.de>2017-10-19 09:16:12 +0200
commitf9cf2a64912d67c9cf49c316a0a0ada0ea7ed1da (patch)
treeda4512b8c99a0924534dacbf9706aac0b501609a /drivers/nvme/target/nvmet.h
parentnvme-fc: retry initial controller connections 3 times (diff)
downloadlinux-dev-f9cf2a64912d67c9cf49c316a0a0ada0ea7ed1da.tar.xz
linux-dev-f9cf2a64912d67c9cf49c316a0a0ada0ea7ed1da.zip
nvmet: synchronize sqhd update
In testing target io in read write mix, we did indeed get into cases where sqhd didn't update properly and slowly missed enough updates to shutdown the queue. Protect the updating sqhd by using cmpxchg, and for that turn the sqhd field into a u32 so that cmpxchg works on it for all architectures. Signed-off-by: James Smart <james.smart@broadcom.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to '')
-rw-r--r--drivers/nvme/target/nvmet.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
index 7b8e20adf760..87e429bfcd8a 100644
--- a/drivers/nvme/target/nvmet.h
+++ b/drivers/nvme/target/nvmet.h
@@ -74,7 +74,7 @@ struct nvmet_sq {
struct percpu_ref ref;
u16 qid;
u16 size;
- u16 sqhd;
+ u32 sqhd;
struct completion free_done;
struct completion confirm_done;
};