@@ -428,7 +428,9 @@ util_cxl_decoder_filter_by_memdev(struct cxl_decoder *decoder,
const char *ident, const char *serial)
{
struct cxl_ctx *ctx = cxl_decoder_get_ctx(decoder);
+ struct cxl_endpoint *endpoint;
struct cxl_memdev *memdev;
+ struct cxl_port *port;
if (!ident && !serial)
return decoder;
@@ -438,6 +440,12 @@ util_cxl_decoder_filter_by_memdev(struct cxl_decoder *decoder,
continue;
if (cxl_decoder_get_target_by_memdev(decoder, memdev))
return decoder;
+ port = cxl_decoder_get_port(decoder);
+ if (!port || !cxl_port_is_endpoint(port))
+ continue;
+ endpoint = cxl_port_to_endpoint(port);
+ if (cxl_endpoint_get_memdev(endpoint) == memdev)
+ return decoder;
}
return NULL;
For example, dump all the endpoint decoders from memdev 'mem8'. cxl list -Di -m 8 -d endpoint Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- cxl/filter.c | 8 ++++++++ 1 file changed, 8 insertions(+)