Linux CXL
 help / color / mirror / Atom feed
From: Alison Schofield <alison.schofield@intel.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ben Widawsky <bwidawsk@kernel.org>,
	Dave Jiang <dave.jiang@intel.com>,
	linux-cxl@vger.kernel.org,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v9 3/3] tools/testing/cxl: Add XOR Math support to cxl_test
Date: Wed, 18 Jan 2023 15:18:55 -0800	[thread overview]
Message-ID: <Y8h+X/XdFYuLLgR1@aschofie-mobl2> (raw)
In-Reply-To: <63c85497274b5_c81f02941e@dwillia2-xfh.jf.intel.com.notmuch>

On Wed, Jan 18, 2023 at 12:20:39PM -0800, Dan Williams wrote:
> alison.schofield@ wrote:
> > From: Alison Schofield <alison.schofield@intel.com>
> > 
> > Expand the cxl_test topology to include CFMWS's that use XOR math
> > for interleave arithmetic, as defined in the CXL Specification 3.0.
> > 
> > With this expanded topology, cxl_test is useful for testing:
> > x1,x2,x4 ways with XOR interleave arithmetic.
> > 
> > Define the additional XOR CFMWS entries to appear only with the
> > module parameter interleave_arithmetic=1. The cxl_test default
> > continues to be modulo math.
> > 
> > modprobe cxl_test interleave_arithmetic=1
> > 
> > Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > ---
> >  tools/testing/cxl/test/cxl.c | 118 ++++++++++++++++++++++++++++++++++-
> >  1 file changed, 115 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
> > index 7edce12fd2ce..c7dba7550106 100644
> > --- a/tools/testing/cxl/test/cxl.c
> > +++ b/tools/testing/cxl/test/cxl.c
> [..]
> > @@ -897,6 +997,16 @@ static __init int cxl_test_init(void)
> >  	if (rc)
> >  		goto err_gen_pool_add;
> >  
> > +	if (interleave_arithmetic == 1) {
> > +		cfmws_start = CFMWS_XOR_ARRAY_START;
> > +		cfmws_end = CFMWS_XOR_ARRAY_END;
> > +		dev_dbg(NULL, "cxl_test loading xor math option\n");
> > +	} else {
> > +		cfmws_start = CFMWS_MOD_ARRAY_START;
> > +		cfmws_end = CFMWS_MOD_ARRAY_END;
> > +		dev_dbg(NULL, "cxl_test loading modulo math option\n");
> > +	}
> > +
> 
> Missed this earlier., but noticed now that I am running it. If no device
> is available then just use pr_debug() instead of dev_dbg(). That said,
> these messages could just be skipped altogher and make the value of
> @interleave_arithmetic readable via sysfs if something really needs to
> recall what mode the test module is running in. I.e.:

Understand (now). I'll send a patch like you suggest.
Thanks!

> 
> diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
> index 14530fe1edc6..b7d7420e74ea 100644
> --- a/tools/testing/cxl/test/cxl.c
> +++ b/tools/testing/cxl/test/cxl.c
> @@ -1265,11 +1265,9 @@ static __init int cxl_test_init(void)
>         if (interleave_arithmetic == 1) {
>                 cfmws_start = CFMWS_XOR_ARRAY_START;
>                 cfmws_end = CFMWS_XOR_ARRAY_END;
> -               dev_dbg(NULL, "cxl_test loading xor math option\n");
>         } else {
>                 cfmws_start = CFMWS_MOD_ARRAY_START;
>                 cfmws_end = CFMWS_MOD_ARRAY_END;
> -               dev_dbg(NULL, "cxl_test loading modulo math option\n");
>         }
>  
>         rc = populate_cedt();
> @@ -1456,7 +1454,7 @@ static __exit void cxl_test_exit(void)
>         unregister_cxl_mock_ops(&cxl_mock_ops);
>  }
>  
> -module_param(interleave_arithmetic, int, 0000);
> +module_param(interleave_arithmetic, int, 0444);
>  MODULE_PARM_DESC(interleave_arithmetic, "Modulo:0, XOR:1");
>  module_init(cxl_test_init);
>  module_exit(cxl_test_exit);
> 
> Otherwise, the current code leads to a concerning:
> 
> "[  111.743246] (NULL device *): cxl_test loading modulo math option"
> 
> ...at startup.

      reply	other threads:[~2023-01-18 23:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 22:47 [PATCH v9 0/3] CXL XOR Interleave Arithmetic alison.schofield
2022-11-30 22:47 ` [PATCH v9 1/3] ACPICA commit 2d8dc0383d3c908389053afbdc329bbd52f009ce alison.schofield
2022-11-30 22:47 ` [PATCH v9 2/3] cxl/acpi: Support CXL XOR Interleave Math (CXIMS) alison.schofield
2022-12-04  1:08   ` Dan Williams
2022-12-04  1:14   ` Dan Williams
2022-11-30 22:47 ` [PATCH v9 3/3] tools/testing/cxl: Add XOR Math support to cxl_test alison.schofield
2023-01-18 20:20   ` Dan Williams
2023-01-18 23:18     ` Alison Schofield [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y8h+X/XdFYuLLgR1@aschofie-mobl2 \
    --to=alison.schofield@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=bwidawsk@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox