From: Dave Jiang <dave.jiang@intel.com>
To: Dan Williams <dan.j.williams@intel.com>, vishal.l.verma@intel.com
Cc: linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev
Subject: Re: [PATCH 1/4] cxl/list: Fix filtering RCDs
Date: Fri, 28 Apr 2023 08:54:49 -0700 [thread overview]
Message-ID: <30c92901-48e3-61d8-5865-632af4a5fb97@intel.com> (raw)
In-Reply-To: <168236637746.1027628.14674251843014155022.stgit@dwillia2-xfh.jf.intel.com>
On 4/24/23 12:59 PM, Dan Williams wrote:
> Attempts to filter by memdev fail when the memdev is an RCD (RCH topology):
>
> # cxl list -BEM -m 11
> Warning: no matching devices found
>
> [
> ]
>
> This is caused by VH topology assumption where an intervening host-bridge
> port is expected between the root CXL port and the endpoint. In an RCH
> topology an endpoint is integrated in the host-bridge.
>
> Search for endpoints directly attached to the root:
>
> # cxl list -BEMu -m 11
> {
> "bus":"root3",
> "provider":"cxl_test",
> "endpoints:root3":[
> {
> "endpoint":"endpoint22",
> "host":"mem11",
> "depth":1,
> "memdev":{
> "memdev":"mem11",
> "ram_size":"2.00 GiB (2.15 GB)",
> "serial":"0xa",
> "numa_node":0,
> "host":"cxl_rcd.10"
> }
> }
> ]
> }
>
>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
> cxl/lib/libcxl.c | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/cxl/lib/libcxl.c b/cxl/lib/libcxl.c
> index 59e5bdbcc750..e6c94d623303 100644
> --- a/cxl/lib/libcxl.c
> +++ b/cxl/lib/libcxl.c
> @@ -1457,8 +1457,9 @@ CXL_EXPORT int cxl_memdev_enable(struct cxl_memdev *memdev)
> return 0;
> }
>
> -static struct cxl_endpoint *cxl_port_find_endpoint(struct cxl_port *parent_port,
> - struct cxl_memdev *memdev)
> +static struct cxl_endpoint *
> +cxl_port_recurse_endpoint(struct cxl_port *parent_port,
> + struct cxl_memdev *memdev)
> {
> struct cxl_endpoint *endpoint;
> struct cxl_port *port;
> @@ -1468,7 +1469,7 @@ static struct cxl_endpoint *cxl_port_find_endpoint(struct cxl_port *parent_port,
> if (strcmp(cxl_endpoint_get_host(endpoint),
> cxl_memdev_get_devname(memdev)) == 0)
> return endpoint;
> - endpoint = cxl_port_find_endpoint(port, memdev);
> + endpoint = cxl_port_recurse_endpoint(port, memdev);
> if (endpoint)
> return endpoint;
> }
> @@ -1476,6 +1477,18 @@ static struct cxl_endpoint *cxl_port_find_endpoint(struct cxl_port *parent_port,
> return NULL;
> }
>
> +static struct cxl_endpoint *cxl_port_find_endpoint(struct cxl_port *parent_port,
> + struct cxl_memdev *memdev)
> +{
> + struct cxl_endpoint *endpoint;
> +
> + cxl_endpoint_foreach(parent_port, endpoint)
> + if (strcmp(cxl_endpoint_get_host(endpoint),
> + cxl_memdev_get_devname(memdev)) == 0)
> + return endpoint;
> + return cxl_port_recurse_endpoint(parent_port, memdev);
> +}
> +
> CXL_EXPORT struct cxl_endpoint *
> cxl_memdev_get_endpoint(struct cxl_memdev *memdev)
> {
>
>
next prev parent reply other threads:[~2023-04-28 15:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-24 19:59 [ndctl PATCH 0/4] cxl list and test fixes Dan Williams
2023-04-24 19:59 ` [PATCH 1/4] cxl/list: Fix filtering RCDs Dan Williams
2023-04-28 15:54 ` Dave Jiang [this message]
2023-04-24 19:59 ` [PATCH 2/4] cxl/list: Filter root decoders by region Dan Williams
2023-04-28 16:03 ` Dave Jiang
2023-04-24 19:59 ` [PATCH 3/4] test: Support test modules located in 'updates' instead of 'extra' Dan Williams
2023-04-28 16:05 ` Dave Jiang
2023-04-24 19:59 ` [PATCH 4/4] test: Fix dangling pointer warning Dan Williams
2023-04-28 16:06 ` Dave Jiang
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=30c92901-48e3-61d8-5865-632af4a5fb97@intel.com \
--to=dave.jiang@intel.com \
--cc=dan.j.williams@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--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