Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Apr 2017 07:30:30 -0700
From:      Chuck Tuffli <chuck@tuffli.net>
To:        freebsd-scsi <freebsd-scsi@freebsd.org>
Cc:        Warner Losh <imp@bsdimp.com>
Subject:   [RFC] CAM pass(4) patch for NVMe
Message-ID:  <CAM0tzX2b1NU=y1Vr=XeU63D5=3FJVHPD9e9fLSFaNvQhLtQa=A@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi

I posted a patch on Phabricator[1] which adds IO pass-through support
for NVMe and would like some feedback on it. The bulk of the change is
pretty straight forward, but there was one part I'm not sure is the
best approach. The driver needs to know what type of command the
application is submitting in order to place it on the correct type of
NVMe queue. The patch uses bit 5 (i.e. 0x10) in the xflags variable of
the ccb header for this purpose. xflags was convenient to use, but
since other drivers don't use it, my guess is this is "the wrong way".
If it is OK to use xflags for this, cool, otherwise I'm open to
suggestions.

As background, NVMe has two categories of commands: administrative and
NVM (sometimes referred to as "IO"). I don't think it is possible for
the driver to guess the command category based on the cmd bytes as:
 - the command opcode values alias. E.g. Flush (NVM) and Delete
Submission queue (Admin) use opcode 0x0
 - both categories have commands which use a non-zero Namespace ID
(like a LUN). so filtering on NSID wouldn't work

--chuck

[1] https://reviews.freebsd.org/D10247



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAM0tzX2b1NU=y1Vr=XeU63D5=3FJVHPD9e9fLSFaNvQhLtQa=A>