Re: [PATCH 12/23] cxl: Introduce endpoint decoders
flat view
From: Dan Williams <hidden>
Date: 2021-11-25 00:07:36
Also in:
linux-cxl
On Mon, Nov 22, 2021 at 11:38 AM Ben Widawsky [off-list ref] wrote:
On 21-11-22 16:20:39, Jonathan Cameron wrote:quoted
On Fri, 19 Nov 2021 16:02:39 -0800 Ben Widawsky [off-list ref] wrote:quoted
Endpoints have decoders too. It is useful to share the same infrastructure from cxl_core. Endpoints do not have dports (downstream targets), only the underlying physical medium. As a result, some special casing is needed. There is no functional change introduced yet as endpoints don't actually enumerate decoders yet. Signed-off-by: Ben Widawsky <redacted>I'm not a fan of special values like using 0 here to indicate endpoint device. I'd rather see a base cxl_decode_alloc(..., bool ep) and possibly wrappers for the non ep case and ep one. JonathanMy inclination is the opposite. However, I think you and Dan both brought up something to this effect in the previous RFCs. Dan, do you have a preference here?
I was thinking something along the lines of what Jonathan wants, explicit per-type APIs, but internal / private to the core can use heuristics like nr_targets == 0 == endpoint. So unexport cxl_decoder_alloc() and have separate: cxl_root_decoder_alloc() cxl_switch_decoder_alloc() cxl_endpoint_decoder_alloc() ...apis that use a static cxl_decoder_alloc() internally. Probably also wants a cxl_endpoint_decoder_add() that drops the need to pass a NULL @target_map.