All of lore.kernel.org
 help / color / mirror / Atom feed
From: maxg@mellanox.com (Max Gurtovoy)
Subject: [PATCH 1/1] nvme-rdma: Add association between ctrl and transport dev
Date: Fri, 24 May 2019 22:30:50 +0300	[thread overview]
Message-ID: <ceb1744a-cc68-9588-bd07-d3060630e857@mellanox.com> (raw)
In-Reply-To: <da6603ee-4a71-e057-5c88-656455956eba@grimberg.me>


On 5/24/2019 10:05 AM, Sagi Grimberg wrote:
>
>> @@ -758,23 +777,26 @@ static void 
>> nvme_rdma_destroy_admin_queue(struct nvme_rdma_ctrl *ctrl,
>> ? static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl 
>> *ctrl,
>> ????????? bool new)
>> ? {
>> +??? struct ib_device *ibdev;
>> ????? int error;
>> ? ????? error = nvme_rdma_alloc_queue(ctrl, 0, NVME_AQ_DEPTH);
>> ????? if (error)
>> ????????? return error;
>> ? -??? ctrl->device = ctrl->queues[0].device;
>> -??? ctrl->ctrl.numa_node = dev_to_node(ctrl->device->dev->dma_device);
>> +??? ibdev = ctrl->queues[0].device->dev;
>> +??? ctrl->ctrl.numa_node = dev_to_node(ibdev->dma_device);
>> +??? ctrl->max_fr_pages = nvme_rdma_get_max_fr_pages(ibdev);
>> ? -??? ctrl->max_fr_pages = 
>> nvme_rdma_get_max_fr_pages(ctrl->device->dev);
>> -
>> -??? error = nvme_rdma_alloc_qe(ctrl->device->dev, 
>> &ctrl->async_event_sqe,
>> +??? error = nvme_rdma_alloc_qe(ibdev, &ctrl->async_event_sqe,
>> ????????????? sizeof(struct nvme_command), DMA_TO_DEVICE);
>> ????? if (error)
>> ????????? goto out_free_queue;
>> ? ????? if (new) {
>> +??????? /* ctrl takes refcount on device */
>> +??????? nvme_rdma_ctrl_dev_get(ctrl, ctrl->queues[0].device);
>> +
>
> Do you actually need the extra reference on the device? why doesn't just
> the set/clear of ctrl->device sufficient? these routines should be
> serialized..

Yes we need this reference since the queues are freed during 
reconnection. And without ctrl reference, also the device will be freed.

And when you disconnect during reconnection, the block layer will call 
exit_request for each request (but the device is freed) and we will do 
the need unmapping from the device..

Not so plesent..

  reply	other threads:[~2019-05-24 19:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-21 13:19 [PATCH 1/1] nvme-rdma: Add association between ctrl and transport dev Max Gurtovoy
2019-05-23  8:13 ` [Suspected-Phishing][PATCH " Max Gurtovoy
2019-05-23 10:22 ` [PATCH " Christoph Hellwig
2019-05-23 11:05   ` Max Gurtovoy
2019-05-23 15:33     ` Christoph Hellwig
2019-05-24 19:36       ` Max Gurtovoy
2019-05-24  7:05 ` Sagi Grimberg
2019-05-24 19:30   ` Max Gurtovoy [this message]
2019-05-24 23:05     ` Sagi Grimberg
2019-05-28 11:50       ` Max Gurtovoy
2019-05-28 19:36         ` Sagi Grimberg

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=ceb1744a-cc68-9588-bd07-d3060630e857@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.