Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752265AbdHBRDd (ORCPT ); Wed, 2 Aug 2017 13:03:33 -0400 Received: from ale.deltatee.com ([207.54.116.67]:37599 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752158AbdHBRCT (ORCPT ); Wed, 2 Aug 2017 13:02:19 -0400 To: Jon Mason , Allen Hubbe Cc: linux-ntb@googlegroups.com, "linux-pci@vger.kernel.org" , linux-kernel , Dave Jiang , Bjorn Helgaas , Greg Kroah-Hartman , Kurt Schwemmer , Stephen Bates , Serge Semin References: <20170725205753.4735-1-logang@deltatee.com> <20170725205753.4735-15-logang@deltatee.com> <20170801191050.GJ4186@kudzu.us> <000001d30b90$31697f70$943c7e50$@dell.com> From: Logan Gunthorpe Message-ID: <95cd95ef-cd83-bd31-ddcb-1fcc0f7fbe51@deltatee.com> Date: Wed, 2 Aug 2017 11:02:06 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: fancer.lancer@gmail.com, sbates@raithlin.com, kurt.schwemmer@microsemi.com, gregkh@linuxfoundation.org, bhelgaas@google.com, dave.jiang@intel.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-ntb@googlegroups.com, Allen.Hubbe@dell.com, jdmason@kudzu.us X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH v3 14/16] switchtec_ntb: implement scratchpad registers X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2160 Lines: 43 On 02/08/17 10:32 AM, Jon Mason wrote: > After a long-ish conversation on IRC, the way we want to go forward > would be to provide 2 ways of communicating prior to the MW's being > setup: SPADs and Message Registers. The HW driver would make > available whichever ones are supported by the hardware. The transport > can see which of those are available in the HW driver, select the > appropriate one, and use it to setup the NTB connection, MW, etc. > similar to how the SPADs are being used today. This would allow for > any current clients to work unmodified, and would require minimal > changes to the existing transport layer. I'm open to this, but I have a couple points: 1) I think there needs to be an ntb library or similar so the client just has to say "communicate this setup data to the peer X". We don't need every client replicating the decision to use spads or msgs or whatever. 2) In my experience, message registers are a bit of a pain to send chunks of data like is being done with spads in the existing clients. (Some time ago, I originally tried emulating spads with message registers and it did not work well.) You can only send 32bits at a time and you have to have a signal indicating the other side is finished with it before sending another message. I think they are best used just for signaling infrequent events where if you loose a message it's not an issue. One thought I had was that maybe we need to just push this decision into the drivers. ie if there's an ntb api just for communicating setup data, the driver could then determine the most appropriate way to communicate it for the hardware (whether via spads, messages or a special memory window). However, the difficulty with this is that the driver would have to communicate if it's using spad resources it would otherwise advertise to the clients. Though, maybe we don't need spads in the ntb api. Maybe they are the wrong abstraction. All the existing clients only use them for setup data, so if we dropped the spad api in favor of a setup data api, the driver could then just make the decision on how best to communicate it. Anyway, just my thoughts. Logan