Re: [NDCTL PATCH 1/5] cxl/test: Add test for extended linear cache support

Alison Schofield
2025-11-16T01:49:14Z

On Fri, Nov 14, 2025 at 06:54:05PM -0800, Alison Schofield wrote:
> On Fri, Oct 31, 2025 at 10:39:59AM -0700, Dave Jiang wrote:
> > Add a unit test that verifies the extended linear cache setup paths
> > in the kernel driver. cxl_test provides a mock'd version. The test
> > verifies the sysfs attribute that indicates extended linear cache support
> > is correctly reported. It also verifies the sizing and offset of the
> > regions and decoders.
> >
> > The expecation is that CFMWS covers the entire extended linear cache
> > region. The first part is DRAM and second part is CXL memory in a 1:1
> > setup. The start base for hardware decoders should be offsetted by the
> > DRAM size.
> >
> > Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> > ---
> > test/cxl-elc.sh | 89 ++++++++++++++++++++++++++++++++++++++++++++++++
> > test/meson.build | 2 ++
> > 2 files changed, 91 insertions(+)
> > create mode 100755 test/cxl-elc.sh
>
> snip
> >
>
> The call to this:
>
> > +find_region()
> > +{
> > + json="$($CXL list -b cxl_test -R)"
> > + region=$(echo "$json" | jq -r '.[] | select(has("extended_linear_cache_size") and .extended_linear_cache_size != null) | .region')
> > + [[ -n "$region" && "$region" != "null" ]] || do_skip "no test extended linear cache region found"
> > +}
> > +
>
> is missing from here. Just found while testing w patches supporting the
> parameter. So you can fix this and ignore my review comment about
> looking up the parameter.

I got that wrong, we do need both checks:
Skip if the param is missing
Fail if the ELC region is not found since that signals cxl-test breakage

>
> > +retrieve_info
> > +compare_sizes
> > +compare_bases
>
>
>