]> www.infradead.org Git - users/sagi/libnvme.git/commit
libnvme-mi: Introduce NVMe Managament Interface library
authorJeremy Kerr <jk@codeconstruct.com.au>
Thu, 29 Jul 2021 05:32:51 +0000 (13:32 +0800)
committerJeremy Kerr <jk@codeconstruct.com.au>
Thu, 9 Jun 2022 11:06:45 +0000 (19:06 +0800)
commitf7bd7717c0eab470a413295414f672f1e36aafff
tree3d0dd184870a484e87c22b58514480d053a0e16e
parentaacaeea8e2753478fa196d6846c7b85aa9ee6043
libnvme-mi: Introduce NVMe Managament Interface library

This change adds support for the NVMe-MI protocol, as a secondary
library: libnvme-mi.{a,so,h}. This allows management of NVMe devices,
typically through NVMe Admin Channel commands, transmitted over a
side-band channel - typically MCTP over SMBus.

There's a fair amount of shared structure between the direct-ioctl and
MI channel implementations; for example, the Admin command set is used
mostly as-is over the MI transport. The library is built as separate
.so/.a objects as client applications would typically either use one or
the other. MI-specific functions are added with a 'nvme_mi' prefix.

This change introduces a small set of MI commands using this channel.
We'll extend this to further MI commands in subsequent changes, as well
as implement Admin Channel commands too.

We currently assume a MCTP transport for NVMe-commands, using the new
AF_MCTP socket support in Linux. However, the transport-specific code is
kept somewhat separate, through the internal struct nvme_mi_transport
interface. This allows potential alternative transports in future - for
example in-band PCIe.

Finally, we start a new example application, mi-mctp, which provides
a reference application using the new library.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
examples/meson.build
examples/mi-mctp.c [new file with mode: 0644]
meson.build
src/libnvme-mi.h [new file with mode: 0644]
src/libnvme-mi.map [new file with mode: 0644]
src/meson.build
src/nvme/mi-mctp.c [new file with mode: 0644]
src/nvme/mi.c [new file with mode: 0644]
src/nvme/mi.h [new file with mode: 0644]
src/nvme/private.h