Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp7286959imm; Tue, 24 Jul 2018 11:25:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcGAuYUUBn4jvu4Tv9WBb4XDXG2BKvPbFM3fdB0ArpWJIsI+Tiuu9JbGBqsDrTqgUx6UJs1 X-Received: by 2002:a63:4d5:: with SMTP id 204-v6mr17364987pge.129.1532456716439; Tue, 24 Jul 2018 11:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532456716; cv=none; d=google.com; s=arc-20160816; b=Kk6K20U6q3jC/kUYpfOYPGzVIEx+eb7DWIAGbMcmQ7rS1VD5aCItXzLD7oKpphwCg2 /Yu3xYqY/00/6eNxteSkQ4voz1CwQzNmpqtsQSBG84hldGCpFj1a5Dz4+XJ0a7MvG1Hi AA9A63vSlvHUZySYxi70GMYi1y1eBtUd5tFc2oni3FCwoRayyy9F3DSpa5RV9qd8DNrl RSqG9XJYtRtytDgE1BbRG/V7h2A50nMdU7F9ZxgTPmkAErbrU9H9SpdWLrb/SgCZcvlG l0WcSnbO2kBaogR/uGqqXHP0JrAEh4IAS5xig5PzFUEznY/1mz8XYvXOAP1S9HrVXy6C REDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:arc-authentication-results; bh=Jl+hxxT3pGwHW1jxFNJf1nhojVlgSWTtPoqVXxJtz40=; b=JesbSmREPbkLND/L4Es+uWT7jkCzK+Plwh5IuEA2lys//WKzOp8FgiS6vg+W+XkP3d mSEAIybS+CrFEcf9daXqt7dnJTEBcEabO6rQk18+ZcRRZaQnkU5Rk2Hr5jNFgkLF5E/q dMDljIum2uwA8VfFAPWUwrbShUyKLmaNiQ9kOUWMBNsc3mfw48fiUCYZ11YDkDgJC8T+ 07tP1YbSEtMUD4LVkr1AOyPoaqhPqSaOC/CsN++D0BZM0dgmf9KckyP9UAl58xFaJHiW 21B3l33QdNcdNR3+gNxgkK49n+nrKXNzxfvexzU9jnFHmF1vBVR6NEIQDTM6AQxx8zsW uoCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5-v6si1873630plv.19.2018.07.24.11.25.01; Tue, 24 Jul 2018 11:25:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388624AbeGXTbG (ORCPT + 99 others); Tue, 24 Jul 2018 15:31:06 -0400 Received: from ale.deltatee.com ([207.54.116.67]:37802 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388463AbeGXTbG (ORCPT ); Tue, 24 Jul 2018 15:31:06 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1fi1xp-0003VV-Rp; Tue, 24 Jul 2018 12:23:14 -0600 To: Allen Hubbe Cc: linux-kernel@vger.kernel.org, linux-ntb@googlegroups.com, Jon Mason , fancer.lancer@gmail.com, Shyam-sundar.S-k@amd.com, shuah@kernel.org, dmeyer@gigaio.com References: <20180720180034.3964-1-logang@deltatee.com> <20180720180034.3964-5-logang@deltatee.com> <8809f02e-93de-f81a-31e0-90f2c1983b70@deltatee.com> From: Logan Gunthorpe Message-ID: <8bc2ed4f-f032-c969-2e7f-f00135f567ec@deltatee.com> Date: Tue, 24 Jul 2018 12:23:13 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: dmeyer@gigaio.com, shuah@kernel.org, Shyam-sundar.S-k@amd.com, fancer.lancer@gmail.com, jdmason@kudzu.us, linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org, allenbh@gmail.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.1 Subject: Re: [PATCH v2 4/8] NTB: ntb_pingpong: Choose doorbells based on port number X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/07/18 12:12 PM, Allen Hubbe wrote: > On Tue, Jul 24, 2018 at 1:37 PM Logan Gunthorpe wrote: >> Not really. Given that we know there are only two peers, we always use >> the other side's doorbell register. You'd only use the nearby doorbell >> register if you wanted to trigger your own interrupt -- that would be >> weird and we don't really have the API sophistication to do that. >> >> If we wanted to support multiple peers with some number in crosslink >> then we'd need to revamp things _significantly_. In this case we'd have >> multiple doorbell registers which each apply to a different subset of >> peers. This gets _very_ complicated and hurts my head. > > ...huh, looks like peer index was omitted from ntb_peer_db_set and > friends. Adding peer index there would make the interface consistent > with other ntb_peer functions. Peer index would allow the hw driver > to select which doorbell register to use for each peer. Adding a > ntb_peer_db_valid_bits to that would allow a subset of bits in the > shared register to be associated with each peer. The way the switch hardware works (switchtec and I assume IDT) is that there is only one doorbell register for all peers which can trigger any peer that doesn't have the corresponding bit masked. So the way it was designed without the index maxes sense except when we start to add multi-peer crosslink insanity. I don't think adding a peer index would be sufficient as the clients would need to know which peers share which doorbells. If I were to attempt something like this, I'd probably look at introducing a segment index to the entire API. So that each switch in a crosslink topology is it's own segment with it's own set of peers, peer index space, doorbell registers, etc. But that's all very complicated and messy and probably something I wouldn't even look at until we have finished with traditional multi-host setups. > I thought for sure ntb_peer_db_set already had peer index, and I was > wrong. Go ahead with the change as in your patch, I won't force the > issue or that you to do that extra work and touch all the drivers > again for this. It can be addressed when there is renued interest in > making things work more than one peer. > > This patch, and the others in this series: > Acked-by: Allen Hubbe Thanks! Logan