Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5973576imm; Mon, 23 Jul 2018 09:10:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeSLi7po7LwmdbSdEkiUGcgJSlNMw8y3ntNC7jkuDnryLRvKIqZCJn3edQEMT7fMORIjycv X-Received: by 2002:a17:902:564:: with SMTP id 91-v6mr13380947plf.155.1532362216786; Mon, 23 Jul 2018 09:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532362216; cv=none; d=google.com; s=arc-20160816; b=CYhJPQEshshPl7/gindY53TgO8CmhIdHPqzs0NGvVwml7JoSdAx6W/fa8cEt2Gnd9D 8aueRE2Dkv+v54eEFiD6Y8NudorYwtLG2nQzBI6hLlMG3nZnEOtUx4cAW/G5FZ/3IBQo 0fTU5RjfMCtaK/N7m+gT6HhWTBpNOSVgNEb58CYz5iL18T8SYm+CSn2Va5eeJ0Gs/xVT FvnpFBmvmfzOaBx3E9vtUQIR/hAY4yMhaFHwfR7Ybxb0yxRg9poL3eSXY29XLLafXshL /+7iGKN+sO1uoOBROgAcGKUQsTIjijE08xbtB2c+9KDZ1ofV0yed6AkfgXQQLvo+vrt7 Rf1g== 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=+FaZhTyjxN/92SenVZSfHhKMEI5hklI1QL4eVg9RJbs=; b=Id4QBl7mjZ2OhDsO0ivyOQu3D7I5VoF9kFFAyOgAayZSzPvX7r3J65s4tTifLicSay XlfYfcvQ3RMxJ2pVTj7MKm39jq3ouyOJRDyc3qh5HevZexXrpNc3U3i4pVelKesKyGQ6 KSWTucj7zAZ8P2G9PKDODf06ncMwrpiH5OsR+23fgRxZ7TtdFkJCn4dFpMKB4S8y4n1a vM4aHFZZZsnCjNXj71HTb4yC5v4wGsTQQGUhFte/pXksRRN1O8X2BuCc8mHA/CHFO/4h Ba4mskDzHJlzhhxWcs4vDDFeydA68g9isU5eSOK5ddiyAHRf7Kcj1Uo6tLEddyf/7xpF l9Wg== 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 98-v6si8821295pla.20.2018.07.23.09.10.02; Mon, 23 Jul 2018 09:10: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 S2388452AbeGWRJy (ORCPT + 99 others); Mon, 23 Jul 2018 13:09:54 -0400 Received: from ale.deltatee.com ([207.54.116.67]:57702 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388121AbeGWRJy (ORCPT ); Mon, 23 Jul 2018 13:09:54 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1fhdNI-0005it-JI; Mon, 23 Jul 2018 10:07:53 -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> From: Logan Gunthorpe Message-ID: Date: Mon, 23 Jul 2018 10:07:45 -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 23/07/18 08:01 AM, Allen Hubbe wrote: > Does this solve the issue where two of the the port numbers are the > same, because of symmetry over a crosslink? I think the two ports > with the "same" number should be identified as different peer index, > even if the port numbers are the same. I'm not sure if it's that general. It solves it for the case that both peers have port numbers equal to zero. It doesn't solve it for the more general case where you may have multiple partitions, including one or more crosslink partitions. That is _much_ harder to solve and right now I'm only focused on fixing the code to work as it did before. If someone is interested in making a complex setup like that work, they'll have to figure out how and post patches. I don't think you'll ever have a case where two peers have the same index, as the index is really an abstract concept the hardware doesn't really know about. > Maybe the port of any peer connected over the crosslink should be the > local switch's crosslink port. Well, the switches could in theory be configured in any way. But the whole point and benefit of crosslink is for both switches to be configured to be identical. The logical configuration is to configure both hosts to be on port 0 for both switches and there's really no benefit to doing it differently. > The local port number might be needed > to configure translation tables in the local switch. It's not. The crosslink partition between the switches would typically always be "port number" 1. (Though there may be instances where it's a different port number, but that shouldn't effect anything and is handled by the driver.) > If a globally > unique port number is needed, maybe encode a chip number in some high > bits of the port number? With crosslink, we can't figure out a chip number for the same reasons we can't figure out a port number. > If a locally unique port number is needed, > maybe encode a path, that could be useful for configuring address > translations across multiple crosslinks. Encoding a path, then each > port will have a different number, depending on the perspective of the > source port, which could be confusing (already, peer index is local > perspective, so can cause the same kind of confusion). I don't follow this. Any path you might get will be exactly the same for both hosts in a symmetric crosslink configuration. The only way to find a locally unique port number would be for the two hosts to negotiate somehow and that's cumbersome and would introduce some randomness (based on which of two identical machines happened to be first) into the process which I really don't want seeing that makes debugging much more difficult. >IMO port > number can be anything useful for specific ntb driver and devices, or > maybe just be informative, but peer index should be useful for ntb > client drivers. Yes, the port number is commonly used to decide which resource (MW, DB, etc) will be used to point to another peer. This is how Serge has coded the existing clients and makes sense. The problem comes with crosslink which can not provide these port numbers but worked fine in the previous two-host code. These patches fix the clients so that they support crosslink (and other two host systems) in a very similar way to how they were supported before. In theory, we could now rip out the ugly code for the Intel and AMD drivers that assign port numbers based on primary/secondary and such. But I have no interest in doing so. Logan