From: Minwoo Im <minwoo.im.dev@gmail.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Klaus Jensen <its@irrelevant.dk>, Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH V6 4/6] hw/block/nvme: support for multi-controller in subsystem
Date: Wed, 27 Jan 2021 05:44:03 +0900 [thread overview]
Message-ID: <20210126204403.GA3564@localhost.localdomain> (raw)
In-Reply-To: <20210126175723.GB1732086@dhcp-10-100-145-180.wdc.com>
On 21-01-26 09:57:23, Keith Busch wrote:
> On Tue, Jan 26, 2021 at 09:52:48AM +0900, Minwoo Im wrote:
> > On 21-01-25 10:11:43, Keith Busch wrote:
> > > On Mon, Jan 25, 2021 at 07:03:32PM +0100, Klaus Jensen wrote:
> > > > On Jan 24 11:54, Minwoo Im wrote:
> > > > > We have nvme-subsys and nvme devices mapped together. To support
> > > > > multi-controller scheme to this setup, controller identifier(id) has to
> > > > > be managed. Earlier, cntlid(controller id) used to be always 0 because
> > > > > we didn't have any subsystem scheme that controller id matters.
> > > > >
> > > > > This patch introduced 'cntlid' attribute to the nvme controller
> > > > > instance(NvmeCtrl) and make it allocated by the nvme-subsys device
> > > > > mapped to the controller. If nvme-subsys is not given to the
> > > > > controller, then it will always be 0 as it was.
> > > > >
> > > > > Added 'ctrls' array in the nvme-subsys instance to manage attached
> > > > > controllers to the subsystem with a limit(32). This patch didn't take
> > > > > list for the controllers to make it seamless with nvme-ns device.
> > > > >
> > > > > Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
> > > > > ---
> > > > > hw/block/nvme-subsys.c | 21 +++++++++++++++++++++
> > > > > hw/block/nvme-subsys.h | 4 ++++
> > > > > hw/block/nvme.c | 29 +++++++++++++++++++++++++++++
> > > > > hw/block/nvme.h | 1 +
> > > > > 4 files changed, 55 insertions(+)
> > > > >
> > > > > diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> > > > > index b525fca14103..7138389be4bd 100644
> > > > > --- a/hw/block/nvme.c
> > > > > +++ b/hw/block/nvme.c
> > > > > @@ -4481,6 +4484,10 @@ static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pci_dev)
> > > > > id->psd[0].enlat = cpu_to_le32(0x10);
> > > > > id->psd[0].exlat = cpu_to_le32(0x4);
> > > > >
> > > > > + if (n->subsys) {
> > > > > + id->cmic |= NVME_CMIC_MULTI_CTRL;
> > > > > + }
> > > >
> > > > Since multiple controllers show up with a PCIe port of their own, do we
> > > > need to set bit 0 (NVME_CMIC_MULTI_PORT?) as well? Or am I
> > > > misunderstanding that bit?
> > >
> > > AIUI, if you report this MULTI_PORT bit, then each PCI device in the
> > > subsystem needs to report a different "Port Number" in their PCIe Link
> > > Capabilities register. I don't think we can manipulate that value from
> > > the nvme "device", but I also don't know what a host should do with this
> > > information even if we could. So, I think it's safe to leave it at 0.
> >
> > AFAIK, If we leave it to 0, kernel will not allocate disk for multi-path
> > case (e.g., nvmeXcYnZ).
>
> Kernel only checks for MULTI_CTRL. It doesn't do anything with MULTI_PORT.
Please forgive me that I took this discussion as MULTI_CTRL rather than
MULTI_PORT. Please ignore this noise ;)
Thanks!
next prev parent reply other threads:[~2021-01-26 20:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-24 2:54 [PATCH V6 0/6] hw/block/nvme: support multi-path for ctrl/ns Minwoo Im
2021-01-24 2:54 ` [PATCH V6 1/6] hw/block/nvme: introduce nvme-subsys device Minwoo Im
2021-01-25 19:58 ` Klaus Jensen
2021-01-24 2:54 ` [PATCH V6 2/6] hw/block/nvme: support to map controller to a subsystem Minwoo Im
2021-01-24 2:54 ` [PATCH V6 3/6] hw/block/nvme: add CMIC enum value for Identify Controller Minwoo Im
2021-01-24 2:54 ` [PATCH V6 4/6] hw/block/nvme: support for multi-controller in subsystem Minwoo Im
2021-01-25 18:03 ` Klaus Jensen
2021-01-25 18:11 ` Keith Busch
2021-01-26 0:52 ` Minwoo Im
2021-01-26 17:57 ` Keith Busch
2021-01-26 20:44 ` Minwoo Im [this message]
2021-01-24 2:54 ` [PATCH V6 5/6] hw/block/nvme: add NMIC enum value for Identify Namespace Minwoo Im
2021-01-24 2:54 ` [PATCH V6 6/6] hw/block/nvme: support for shared namespace in subsystem Minwoo Im
2021-01-25 19:53 ` Klaus Jensen
2021-01-25 20:29 ` [PATCH V6 0/6] hw/block/nvme: support multi-path for ctrl/ns Klaus Jensen
2021-01-26 0:53 ` Minwoo Im
2021-01-26 20:39 ` Keith Busch
2021-01-26 21:41 ` Minwoo Im
2021-02-04 18:31 ` Klaus Jensen
2021-02-04 18:32 ` Klaus Jensen
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=20210126204403.GA3564@localhost.localdomain \
--to=minwoo.im.dev@gmail.com \
--cc=its@irrelevant.dk \
--cc=kbusch@kernel.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.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 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).