From: "Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>
To: linux-scsi@vger.kernel.org,
James.Bottomley@HansenPartnership.com, nab@linux-iscsi.org,
brking@linux.vnet.ibm.com
Cc: mikey@neuling.org, imunsie@au1.ibm.com
Subject: [PATCH RFC 0/2] IBM CXL Flash Adapter
Date: Sun, 26 Apr 2015 23:50:03 -0500 [thread overview]
Message-ID: <1430110203-13229-1-git-send-email-mrochs@linux.vnet.ibm.com> (raw)
This patch set adds support for the IBM CXL flash (cxlflash) adapter. The
device is presented to the system as a SCSI adapter and may be accessed
and used via the normal filesystem paths. Also included is support for
a special mode that allows direct access from userspace.
The IBM Power processor architecture provides support for CAPI (Coherent
Accelerator Power Interface), which is available to certain PCIe slots
on Power 8 systems. CAPI can be thought of as a special tunneling
protocol through PCIe that allow PCIe adapters to look like special
purpose co-processors which can read or write an application's memory
and generate page faults. As a result, the host interface to an adapter
running in CAPI mode does not require data buffers to be mapped to the
device's memory (IOMMU bypass) nor does it require memory to be pinned.
Application specific accelerators are constructed by burning logic
to either an FPGA or ASIC that accelerates a certain function in
hardware. This logic is referred to as a an Accelerator Function Unit
or AFU. AFUs and their associated software are designed to leverage the
benefits that CAPI provides to reduce the burden on CPUs and achieve
higher performance. Examples of AFUs include compression, encryption,
sorting, etc.
The cxlflash adapter contains an AFU that enhances the performance of
accessing an external flash storage device by allowing userspace
applications to establish a 'superpipe' through which they may directly
access the storage, bypassing the traditional storage stack and reducing
pathlength per-I/O by more than an order of magnitude. The AFU also supports
a translation function that allows users to segment a physical device
into 'n' virtual devices [by programmatic means] and refer to these
segments as if they were a true physical device. This function enables
a more efficient use of a physical device and provides for a secure
multi-tenancy environment.
At a high-level, the cxlflash adapter looks and behaves very much like
a SCSI HBA. Like other SCSI adapters it understands SCSI CDBs and LUN
discovery. It also provides health monitoring, error recovery, and link
event reporting. It is for these reasons that we have decided to situate
support for the cxlflash adapter as a low level SCSI device driver.
At a lower level, the cxlflash adapter requires some additional items not
found in a traditional SCSI HBA driver. These include the following:
- A programmatic API (implemented as ioctls) that user applications
interact with when they desire to take advantage of the superpipe access
from userspace. These ioctls allow the user to gain access to the CAPI
resources (ie: interrupts, MMIO space, etc.) that are required to use
the superpipe. Additionally, they allow applications to use the AFUs
virtual partitioning function. Note that while the ioctls are new, under
the covers they make use of existing functionality found in the cxl
driver (drivers/misc/cxl).
- A block allocation table (implemented as a bitmap) per physical
device attached to the cxlflash adapter that is operating in the virtual
partitioned mode. This table manages the segmentation of the physical
device and is used to derive the entries found in the LUN mapping table.
- A LUN mapping table that is shared with the AFU and used by the AFU
to associate the resource handles referring to a specific virtual device
with blocks on the physical device.
- The ability to send a limited set of SCSI commands directly to the
adapter to determine capacity and identification data as well as wipe
blocks that are no longer in use when a virtual device is released. This
set of commands includes READ_CAPACITY, INQUIRY, and WRITE_SAME.
Accompanying this adapter driver but not included here is a userspace
library (known as the block library) that will hide the interaction
between userspace and the cxlflash driver. Most (if not all) users will
chose to use this library when developing superpipe-aware applications.
The block library can be found on Github:
https://github.com/mikehollinger/ibmcapikv
More technical details can be found within Documentation/powerpc/cxlflash.txt
The following patches are bisectable and are dependent on support that has
not yet been merged in with the mainline.
This code may be found on Github:
https://github.com/mikey/linux/tree/cxl/kernelapi
The forked (from cxl-kernelapi) cxlflash source may also be found on Github:
https://github.com/mikehollinger/linux/tree/cflash/dev
Patch 1 contains support for only filesystem access.
Patch 2 adds support for userspace applications that wish to communicate
using the superpipe in lieu of filesystem access.
Any thoughts on our approach for supporing this adapter/function?
Matthew R. Ochs (2):
cxlflash: Base support for IBM CXL Flash Adapter
cxlflash: Support for superpipe I/O API
Documentation/powerpc/cxlflash.txt | 275 +++++
drivers/scsi/Kconfig | 1 +
drivers/scsi/Makefile | 1 +
drivers/scsi/cxlflash/Kconfig | 11 +
drivers/scsi/cxlflash/Makefile | 4 +
drivers/scsi/cxlflash/common.h | 287 +++++
drivers/scsi/cxlflash/main.c | 2082 ++++++++++++++++++++++++++++++++++++
drivers/scsi/cxlflash/main.h | 125 +++
drivers/scsi/cxlflash/sislite.h | 407 +++++++
drivers/scsi/cxlflash/superpipe.c | 1673 +++++++++++++++++++++++++++++
drivers/scsi/cxlflash/superpipe.h | 67 ++
include/uapi/scsi/Kbuild | 1 +
include/uapi/scsi/cxlflash_ioctl.h | 133 +++
13 files changed, 5067 insertions(+)
create mode 100644 Documentation/powerpc/cxlflash.txt
create mode 100644 drivers/scsi/cxlflash/Kconfig
create mode 100644 drivers/scsi/cxlflash/Makefile
create mode 100644 drivers/scsi/cxlflash/common.h
create mode 100644 drivers/scsi/cxlflash/main.c
create mode 100644 drivers/scsi/cxlflash/main.h
create mode 100755 drivers/scsi/cxlflash/sislite.h
create mode 100644 drivers/scsi/cxlflash/superpipe.c
create mode 100644 drivers/scsi/cxlflash/superpipe.h
create mode 100644 include/uapi/scsi/cxlflash_ioctl.h
--
2.1.0
reply other threads:[~2015-04-27 4:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1430110203-13229-1-git-send-email-mrochs@linux.vnet.ibm.com \
--to=mrochs@linux.vnet.ibm.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=brking@linux.vnet.ibm.com \
--cc=imunsie@au1.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=mikey@neuling.org \
--cc=nab@linux-iscsi.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).