All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: Jens Axboe <axboe@kernel.dk>,
	Bart Van Assche <Bart.VanAssche@wdc.com>,
	"hch@infradead.org" <hch@infradead.org>
Cc: "keith.busch@intel.com" <keith.busch@intel.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [GIT PULL] nvme update for Linux 4.14, take 2
Date: Wed, 30 Aug 2017 19:05:36 +0300	[thread overview]
Message-ID: <0ca15e8f-fc04-7694-a471-379103c6428d@grimberg.me> (raw)
In-Reply-To: <30e386a2-aac7-e9b7-59e2-52c481247e4e@kernel.dk>


>>>> Hello Sagi,
>>>>
>>>> Sorry but I doubt that that patch makes it "impossible" to move controller
>>>> reset flow to the NVMe core. There are already several function pointers in
>>>> the nvme_ctrl_ops data structure and there is one such data structure per
>>>> transport. Had you already considered to add a function pointer to that
>>>> structure?
>>>
>>> I have, that's the trampoline function that I was referring to, it feels
>>> a bit funny to have aa nvme core function that would look like:
>>>
>>> int nvme_reinit_request()
>>> {
>>> 	return ctrl->ops->reinit_request()
>>> }
>>>
>>> I can easily do that, but doesn't it defeat the purpose of blk_mq_ops?
>>
>> I don't think so. Request reinitialization is an NVMe concept that is
>> not used by any other block driver, so why should the pointer to the
>> reinitialization function exist in blk_mq_ops?
> 
> The point of blk-mq is to provide all the functionality that drivers
> need, even if it is for just a single driver. Functionality that can be
> removed from drivers is good. The smaller/simpler we can make the
> driver, the better off we are, even if that means adding a bit of
> complexity to the core.
> 
> Obviously this is a case-by-case decision. For this particular case, I'm
> happy with either solution.

If we get to choose, my preference would be to restore the old behavior
because currently existing nvme transports keep their internal ctrl
representation in the tagset->driver_data as they implement
init/exit_request. Bouncing in nvme core would require to change that
and always keep struct nvme_ctrl as the tagset->driver_data and convert
it on every handler...

Everything is doable but it seems like an unneeded hassle to me...

WARNING: multiple messages have this Message-ID (diff)
From: sagi@grimberg.me (Sagi Grimberg)
Subject: [GIT PULL] nvme update for Linux 4.14, take 2
Date: Wed, 30 Aug 2017 19:05:36 +0300	[thread overview]
Message-ID: <0ca15e8f-fc04-7694-a471-379103c6428d@grimberg.me> (raw)
In-Reply-To: <30e386a2-aac7-e9b7-59e2-52c481247e4e@kernel.dk>


>>>> Hello Sagi,
>>>>
>>>> Sorry but I doubt that that patch makes it "impossible" to move controller
>>>> reset flow to the NVMe core. There are already several function pointers in
>>>> the nvme_ctrl_ops data structure and there is one such data structure per
>>>> transport. Had you already considered to add a function pointer to that
>>>> structure?
>>>
>>> I have, that's the trampoline function that I was referring to, it feels
>>> a bit funny to have aa nvme core function that would look like:
>>>
>>> int nvme_reinit_request()
>>> {
>>> 	return ctrl->ops->reinit_request()
>>> }
>>>
>>> I can easily do that, but doesn't it defeat the purpose of blk_mq_ops?
>>
>> I don't think so. Request reinitialization is an NVMe concept that is
>> not used by any other block driver, so why should the pointer to the
>> reinitialization function exist in blk_mq_ops?
> 
> The point of blk-mq is to provide all the functionality that drivers
> need, even if it is for just a single driver. Functionality that can be
> removed from drivers is good. The smaller/simpler we can make the
> driver, the better off we are, even if that means adding a bit of
> complexity to the core.
> 
> Obviously this is a case-by-case decision. For this particular case, I'm
> happy with either solution.

If we get to choose, my preference would be to restore the old behavior
because currently existing nvme transports keep their internal ctrl
representation in the tagset->driver_data as they implement
init/exit_request. Bouncing in nvme core would require to change that
and always keep struct nvme_ctrl as the tagset->driver_data and convert
it on every handler...

Everything is doable but it seems like an unneeded hassle to me...

  reply	other threads:[~2017-08-30 16:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29 15:05 [GIT PULL] nvme update for Linux 4.14, take 2 Christoph Hellwig
2017-08-29 15:05 ` Christoph Hellwig
2017-08-29 15:10 ` Jens Axboe
2017-08-29 15:10   ` Jens Axboe
2017-08-30 15:10   ` Sagi Grimberg
2017-08-30 15:10     ` Sagi Grimberg
2017-08-30 15:28     ` Bart Van Assche
2017-08-30 15:28       ` Bart Van Assche
2017-08-30 15:33       ` Sagi Grimberg
2017-08-30 15:33         ` Sagi Grimberg
2017-08-30 15:46         ` Bart Van Assche
2017-08-30 15:46           ` Bart Van Assche
2017-08-30 15:53           ` Jens Axboe
2017-08-30 15:53             ` Jens Axboe
2017-08-30 16:05             ` Sagi Grimberg [this message]
2017-08-30 16:05               ` Sagi Grimberg
2017-08-30 16:11               ` Bart Van Assche
2017-08-30 16:11                 ` Bart Van Assche
2017-08-30 16:47                 ` Sagi Grimberg
2017-08-30 16:47                   ` Sagi Grimberg
2017-08-30 16:56                   ` Bart Van Assche
2017-08-30 16:56                     ` Bart Van Assche
2017-08-30 20:59                     ` Sagi Grimberg
2017-08-30 20:59                       ` Sagi Grimberg
2017-08-31 13:10                     ` hch
2017-08-31 13:10                       ` hch

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=0ca15e8f-fc04-7694-a471-379103c6428d@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=Bart.VanAssche@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=keith.busch@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /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.