Verma, Vishal L wrote: > On Tue, 2022-07-12 at 12:08 -0700, Dan Williams wrote: > > Exercise the fundamental region provisioning sysfs mechanisms of discovering > > available DPA capacity, allocating DPA to a region, and programming HDM > > decoders. > > > > Signed-off-by: Dan Williams <dan.j.willi...@intel.com> > > --- > > test/cxl-region-create.sh | 122 > > +++++++++++++++++++++++++++++++++++++++++++++ > > test/meson.build | 2 + > > 2 files changed, 124 insertions(+) > > create mode 100644 test/cxl-region-create.sh > > Since this isn't actually creating a region, should this be named > cxl-reserve-dpa.sh ?
The test goes all the way to the point of registering a new region with libnvdimm, so it is region creation. > Alternatively - I guess this test could just be extended to do actual > region creation once that is available in cxl-cli? I was thinking that's a separate test that moves from just one hardcoded pmem region via sysfs toggling to permuting all the possible cxl_test region configurations across both modes via 'cxl create-region'. One is a sysfs smoke test the other is a create-region unit test. > > > > > diff --git a/test/cxl-region-create.sh b/test/cxl-region-create.sh > > new file mode 100644 > > index 000000000000..389988759b08 > > --- /dev/null > > +++ b/test/cxl-region-create.sh > > @@ -0,0 +1,122 @@ > > +#!/bin/bash > > +# SPDX-License-Identifier: GPL-2.0 > > +# Copyright (C) 2022 Intel Corporation. All rights reserved. > > + > > +. $(dirname $0)/common > > + > > +rc=1 > > + > > +set -ex > > + > > +trap 'err $LINENO' ERR > > + > > +check_prereq "jq" > > + > > +modprobe -r cxl_test > > +modprobe cxl_test > > +udevadm settle > > + > > +# THEORY OF OPERATION: Create a x8 interleave across the pmem capacity > > +# of the 8 endpoints defined by cxl_test, commit the decoders (which > > +# just stubs out the actual hardware programming aspect, but updates the > > +# driver state), and then tear it all down again. As with other cxl_test > > +# tests if the CXL topology in tools/testing/cxl/test/cxl.c ever changes > > +# then the paired update must be made to this test. > > + > > +# find the root decoder that spans both test host-bridges and support pmem > > +decoder=$(cxl list -b cxl_test -D -d root | jq -r ".[] | > > This and all following 'cxl' invocations should be "$CXL" which we get > from test/common Ah, yeah, missed that.