From: John Groves <[email protected]>

This series adds famfs mode support to daxctl, alongside the existing
devdax and system-ram modes.  A daxdev is in famfs mode when it is bound
to fsdev_dax.ko (drivers/dax/fsdev.c).  famfs is a shared,
memory-mappable filesystem for disaggregated and CXL memory; see
https://famfs.org for more information.

Patch 1 adds the library plumbing: mode detection helpers, an enable
function, and the device.c reconfigure-device wiring.  Patch 2 adds a test
that exercises mode transitions on the nfit_test emulated backend.

This series depends on the fsdev_dax kernel driver (which provides famfs
mode) and on the famfs kernel patch series.

Changes since V5 (addressing Alison's review):

Patch 1 (daxctl: Add support for famfs mode):
- Commit message: add an intro paragraph describing what famfs is, with a
  link to https://famfs.org.
- Documentation: document famfs mode in
  Documentation/daxctl/daxctl-reconfigure-device.txt (DESCRIPTION, the
  -m/--mode option list, and a reconfigure example).
- Rename the local 'enum dev_mode' to 'enum reconfig_mode'
  (RECONFIG_MODE_*) so it no longer shares member names with
  enum daxctl_dev_mode.
- Add daxctl_dev_get_mode(), which reports a device's current mode; the
  three reconfig_mode_*() functions and json.c now switch on it instead
  of repeating an if-else mode chain.  enum daxctl_dev_mode moves to the
  public header and gains a DAXCTL_DEV_MODE_UNKNOWN sentinel;
  daxctl_dev_get_mode() is exported.
- Collapse disable_devdax_device() and disable_famfs_device() into a
  single disable_mode_device() (the caller has already matched the mode).
- Add daxctl_dev_is_system_ram_mode() as the preferred name for the
  consistency with daxctl_dev_is_{famfs,devdax}_mode();
  daxctl_dev_is_system_ram_capable() becomes a compatibility wrapper so
  the existing ABI is preserved.
- Move the "returns false for a disabled device" note onto the shared
  daxctl_dev_bound_to_module() helper and drop the redundant per-predicate
  comments.
- Fix daxctl_dev_enable() to range-check mode before indexing
  dax_modules[]; the lookup previously ran before the bounds check.
- Remove the stray double space in the --mode=famfs parse branch.
- Drop the Reviewed-by: Dave Jiang tag, given the amount of rework since
  V5.

Patch 2 (test):
- Replace the V5 device-scanning test with test/daxctl-famfs-nfit.sh, which
  builds its own dax device from the emulated ACPI.NFIT bus (nfit_test) so
  it runs in the ndctl unit-test model.  Real DRAM backing means kmem
  onlining works and the full devdax/famfs/system-ram matrix runs
  end-to-end, including the system-ram -> famfs rejection.  Follows the
  existing test style (set -x logging, err/cleanup traps, check_dmesg,
  fixture teardown).  Based on a rewrite from Alison Schofield.
- Per Alison's "pick a lane to start" feedback, only the nfit_test backend
  is upstreamed here; a cxl_test-backed variant is held for a later
  revision.

John Groves (2):
  daxctl: Add support for famfs mode
  Add nfit_test famfs mode-transition test

 .../daxctl/daxctl-reconfigure-device.txt      |  22 +-
 daxctl/device.c                               | 113 ++++++---
 daxctl/json.c                                 |  18 +-
 daxctl/lib/libdaxctl-private.h                |   9 +-
 daxctl/lib/libdaxctl.c                        |  73 +++++-
 daxctl/lib/libdaxctl.sym                      |   9 +
 daxctl/libdaxctl.h                            |  14 ++
 test/daxctl-famfs-nfit.sh                     | 215 ++++++++++++++++++
 test/meson.build                              |   2 +
 9 files changed, 432 insertions(+), 43 deletions(-)
 create mode 100755 test/daxctl-famfs-nfit.sh

-- 
2.53.0


Reply via email to