From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46204C4167D for ; Mon, 29 Nov 2021 20:18:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235137AbhK2UV0 (ORCPT ); Mon, 29 Nov 2021 15:21:26 -0500 Received: from mga03.intel.com ([134.134.136.65]:34090 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232484AbhK2UR2 (ORCPT ); Mon, 29 Nov 2021 15:17:28 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10183"; a="236011259" X-IronPort-AV: E=Sophos;i="5.87,273,1631602800"; d="scan'208";a="236011259" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2021 12:05:16 -0800 X-IronPort-AV: E=Sophos;i="5.87,273,1631602800"; d="scan'208";a="594818378" Received: from ajsteine-mobl13.amr.corp.intel.com (HELO intel.com) ([10.252.141.244]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2021 12:05:15 -0800 Date: Mon, 29 Nov 2021 12:05:14 -0800 From: Ben Widawsky To: Dan Williams Cc: Jonathan Cameron , linux-cxl@vger.kernel.org, Linux PCI , Alison Schofield , Ira Weiny , Vishal Verma Subject: Re: [PATCH 12/23] cxl: Introduce endpoint decoders Message-ID: <20211129200514.2o2zmjelfl3nahyt@intel.com> References: <20211120000250.1663391-1-ben.widawsky@intel.com> <20211120000250.1663391-13-ben.widawsky@intel.com> <20211122162039.000022c1@Huawei.com> <20211122193751.gipqgs5ap24dacm3@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org On 21-11-24 16:07:23, Dan Williams wrote: > On Mon, Nov 22, 2021 at 11:38 AM Ben Widawsky wrote: > > > > On 21-11-22 16:20:39, Jonathan Cameron wrote: > > > On Fri, 19 Nov 2021 16:02:39 -0800 > > > Ben Widawsky wrote: > > > > > > > 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 > > > > > > 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. > > > > > > Jonathan > > > > > > > My 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. Would you a like a prep patch to set up the APIs first, or just do it all in one?