]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Make NVMe compatible with the original API
authorchuck <chuck@FreeBSD.org>
Wed, 22 Aug 2018 04:29:24 +0000 (04:29 +0000)
committerchuck <chuck@FreeBSD.org>
Wed, 22 Aug 2018 04:29:24 +0000 (04:29 +0000)
commitfa895cb8d251d2316caa4fbacba5d4fc4b2d55da
tree6fdb66a56676d2112c97b1dc6282b2632a86dbd6
parent47fa74161cbe1a454aa28e66abed0bcd06657a88
Make NVMe compatible with the original API

The original NVMe API used bit-fields to represent fields in data
structures defined by the specification (e.g. the op-code in the command
data structure). The implementation targeted x86_64 processors and
defined the bit fields for little endian dwords (i.e. 32 bits).

This approach does not work as-is for big endian architectures and was
changed to use a combination of bit shifts and masks to support PowerPC.
Unfortunately, this changed the NVMe API and forces #ifdef's based on
the OS revision level in user space code.

This change reverts to something that looks like the original API, but
it uses bytes instead of bit-fields inside the packed command structure.
As a bonus, this works as-is for both big and little endian CPU
architectures.

Bump __FreeBSD_version to 1200081 due to API change

Reviewed by: imp, kbowling, smh, mav
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D16404
17 files changed:
sbin/nvmecontrol/firmware.c
sbin/nvmecontrol/format.c
sbin/nvmecontrol/logpage.c
sbin/nvmecontrol/ns.c
sbin/nvmecontrol/nvmecontrol.c
sbin/nvmecontrol/power.c
sbin/nvmecontrol/wdc.c
sys/cam/nvme/nvme_all.c
sys/dev/mpr/mpr_sas.c
sys/dev/nvme/nvme.c
sys/dev/nvme/nvme.h
sys/dev/nvme/nvme_ctrlr.c
sys/dev/nvme/nvme_ctrlr_cmd.c
sys/dev/nvme/nvme_ns_cmd.c
sys/dev/nvme/nvme_qpair.c
sys/sys/param.h
usr.sbin/bhyve/pci_nvme.c