From: maxg@mellanox.com (Max Gurtovoy)
Subject: [PATCH 2/2] nvme-rdma: Don't flush delete_wq by default during remove_one
Date: Thu, 22 Feb 2018 20:17:22 +0200 [thread overview]
Message-ID: <1519323442-30819-2-git-send-email-maxg@mellanox.com> (raw)
In-Reply-To: <1519323442-30819-1-git-send-email-maxg@mellanox.com>
The .remove_one function is called for any ib_device removal.
In case the removed device has no reference in our driver, there
is no need to flush the work queue.
Reviewed-by: Israel Rukshin <israelr at mellanox.com>
Signed-off-by: Max Gurtovoy <maxg at mellanox.com>
---
Changes from v1:
- check for the ib_device in the device list
---
drivers/nvme/host/rdma.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 3a51ed5..22dd752 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -2025,6 +2025,22 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev,
static void nvme_rdma_remove_one(struct ib_device *ib_device, void *client_data)
{
struct nvme_rdma_ctrl *ctrl;
+ struct nvme_rdma_device *ndev;
+ bool found = false;
+
+ mutex_lock(&device_list_mutex);
+ list_for_each_entry(ndev, &device_list, entry) {
+ if (ndev->dev == ib_device) {
+ found = true;
+ break;
+ }
+ }
+ mutex_unlock(&device_list_mutex);
+
+ if (!found) {
+ WARN_ON_ONCE(!list_empty(&nvme_rdma_ctrl_list));
+ return;
+ }
/* Delete all controllers using this device */
mutex_lock(&nvme_rdma_ctrl_mutex);
--
1.8.3.1
prev parent reply other threads:[~2018-02-22 18:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 18:17 [PATCH v2 1/2] nvmet-rdma: Don't flush system_wq by default during remove_one Max Gurtovoy
2018-02-22 18:17 ` Max Gurtovoy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1519323442-30819-2-git-send-email-maxg@mellanox.com \
--to=maxg@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).