]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cxl/pmem: Translate NVDIMM label commands to CXL label commands
authorDan Williams <dan.j.williams@intel.com>
Tue, 24 Aug 2021 16:07:18 +0000 (09:07 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 24 Aug 2021 19:08:30 +0000 (12:08 -0700)
commit0a0eaf6b4a6cf2accb496cb61046211fc66482f2
tree9ae55a2d73f6ec909c523ac05edad692eb239ff0
parent4a199edd83ba0121d721aaee9cc391b4c4d4a764
cxl/pmem: Translate NVDIMM label commands to CXL label commands

The LIBNVDIMM IOCTL UAPI calls back to the nvdimm-bus-provider to
translate the Linux command payload to the device native command format.
The LIBNVDIMM commands get-config-size, get-config-data, and
set-config-data, map to the CXL memory device commands device-identify,
get-lsa, and set-lsa. Recall that the label-storage-area (LSA) on an
NVDIMM device arranges for the provisioning of namespaces. Additionally
for CXL the LSA is used for provisioning regions as well.

The data from device-identify is already cached in the 'struct cxl_mem'
instance associated with @cxl_nvd, so that payload return is simply
crafted and no CXL command is issued. The conversion for get-lsa is
straightforward, but the conversion for set-lsa requires an allocation
to append the set-lsa header in front of the payload.

Acked-by: Ben Widawsky <ben.widawsky@intel.com>
Link: https://lore.kernel.org/r/162982123813.1124374.3721946437291753388.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/pmem.c