Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753863AbdFVWTY (ORCPT ); Thu, 22 Jun 2017 18:19:24 -0400 Received: from ale.deltatee.com ([207.54.116.67]:55058 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752429AbdFVWTX (ORCPT ); Thu, 22 Jun 2017 18:19:23 -0400 To: Allen Hubbe , "'Jon Mason'" References: <20170615203729.9009-1-logang@deltatee.com> <20170619200659.GA20437@kudzu.us> <9615f074-5b81-210b-eb88-218a59d65198@deltatee.com> <000001d2eb85$daecdea0$90c69be0$@dell.com> <8a1ff94c-8689-0d4c-cc33-7b495daa065a@deltatee.com> <000101d2eba4$b45b1e40$1d115ac0$@dell.com> Cc: linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org, "'Dave Jiang'" , "'Serge Semin'" , "'Kurt Schwemmer'" , "'Stephen Bates'" , "'Greg Kroah-Hartman'" From: Logan Gunthorpe Message-ID: Date: Thu, 22 Jun 2017 16:19:09 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <000101d2eba4$b45b1e40$1d115ac0$@dell.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.111 X-SA-Exim-Rcpt-To: gregkh@linuxfoundation.org, sbates@raithlin.com, kurt.schwemmer@microsemi.com, fancer.lancer@gmail.com, dave.jiang@intel.com, linux-kernel@vger.kernel.org, linux-ntb@googlegroups.com, jdmason@kudzu.us, Allen.Hubbe@dell.com X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: New NTB API Issue 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: 1411 Lines: 21 On 6/22/2017 4:12 PM, Allen Hubbe wrote: > The resource size given by peer_mw_get_addr might be different than the max_size given by ntb_mw_get_align. > > I am most familiar with the ntb_hw_intel driver and that type of ntb hardware. The peer_mw_get_addr size is of the primary bar on the side to be the source of the translated writes (or reads). In b2b topology, at least, the first translation of that write lands it on the secondary bar of the peer ntb. That size of that bar could different than the first. The second translation lands the write in memory (eg). So, the end-to-end translation is limited by the first AND second sizes. > > The first point is, the *max_size returned by intel_ntb_mw_get_align looks wrong. That should be the size of the secondary bar, not the resource size of the primary bar, of that device. > > The second point is, because the sizes returned by peer_mw_get_addr, and ntb_mw_get_align, may be different, the two sides should communicate and reconcile the address and size information when setting up the translations. Ok, that makes some sense. So drivers that don't need this should return -1 or something like that? Though, I'd still suggest that until a driver actually needs this, and it's implemented correctly in the clients, we should leave it out. Any thoughts on changing the semantics of mw_get_align so it must be called with the link up? Logan