Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1197929imm; Fri, 15 Jun 2018 12:51:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKOX1pGPkYvC3tfzdpGSvt6z0jocx7KgIXCePpF/OGbLNgNAY3JkyVBPuHUwj3rN8t0p9ER X-Received: by 2002:a65:51c9:: with SMTP id i9-v6mr2875175pgq.202.1529092302543; Fri, 15 Jun 2018 12:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529092302; cv=none; d=google.com; s=arc-20160816; b=cMIPY0mozwY3NLgKZ41pkeCr7tIEGyTrSd5jrl3BMB0L7S4Aj40AJkaMjHj01XSEFY oi/ltYr4adqHcr4tABOMXIuakx1xNTsKExwNrUFolMJrs3AosYGU0XpYZdMTJpaxlyHH 2o3icfdtts1gHahboHroSX6LY2RK+yr8OGvpFtBIRzp11RETZwS8vPmuxtN5j6YqZ2NP aFTfEGcSUJZmaSm/JNqFaG1sMp8gZJWY/pt0MOtDHHhmohcIWoJAsvq63UGR5jVzvl7l wbIWRKWbpOXdwLrKXq25dpUC95oVw6np33FTUMGETiG8ySFEpd/iMNdzUXoTQH/M0d2A 8aMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=w1CdjnphkZpTq8rLRemD5itPBV0qo8DLvweSHwEutd4=; b=UJIZmxeVxx8RXvV50mz/FpD+MSm13y+QXo+ICvD8kmcHeaRq+MgaIIo3g8ZO3cR6zt +izkcq1rGXpXdimPggOTRgME5TtXhrdjQF6vEXW/JK+m4OZ4moX6DBEvf33Z3TKrEPFq dxT8iOXnIVEsv95YwNGvh0zULDNzsZFfEHYghoYqMBCH22203zdlVUaIb845CskFRgoW GlmcfVmC9XRJnpAOwhq7wJdvxAuc1DEy7KxE/cksFmERh9t+PUh6sfl9jDWJeh6yetjQ JuCoEREiCwcw9e9P3euVMaCVVSQiQgeJBNSLp9LsQqgcUj7OUPhCdGgEzRvPAjk0fOZv Xp0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ppAvu+27; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y27-v6si8657152pfa.181.2018.06.15.12.51.28; Fri, 15 Jun 2018 12:51:42 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ppAvu+27; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966360AbeFOTuZ (ORCPT + 99 others); Fri, 15 Jun 2018 15:50:25 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:42844 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965768AbeFOTuX (ORCPT ); Fri, 15 Jun 2018 15:50:23 -0400 Received: by mail-lf0-f66.google.com with SMTP id v135-v6so16236883lfa.9 for ; Fri, 15 Jun 2018 12:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=w1CdjnphkZpTq8rLRemD5itPBV0qo8DLvweSHwEutd4=; b=ppAvu+271nXjWaT1GzYwSs92qXNpbuJhqj3VwpD/rEKZldWPGNNAqr9Hc0vShPqPak kPhaS8HBBP68RDvzLq/wWK0/MOnXrvz/gAlyL/EbCuDvbGYua3/xTrlLXO0OAph8Tamj 5tBOS3K97GJHQUI4A87HPJjua+umfsGKpXsSLu+M6zNGlsEhvlqPjJEG4ptkzf0mou2G SLuQW5+n9uWndOdJCJd4OUCUfp1LFPFtk4jb8SwYjD+hVEXVLMYmmGR0JJYBa1IDnBA6 ZxHhzckcjUQwRofgWx1rRpEUIKtnyu8InVnaaAusMIV9A+MCaiJUjdiurpT8D2fIbsN3 QzUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=w1CdjnphkZpTq8rLRemD5itPBV0qo8DLvweSHwEutd4=; b=CuMe1I18rEBkcggqWwAJcmmpZnvtrYYul/uqxrG3uxgNSoGGV6sRlGhvN5G8lWufJ9 bBzIbEdAkFkByYiDOlSD6DGlzfC8ed2myvjcbsz1k4+lH6YI6yJ5g0FDC+gaUFX0/wXI 7OZC7mhdoitklUKRTJL1hrLoUezBrJA5Ib4bgXLY7zxSLgew9Ij5FGkMsyBq6DoryaNk VIy2SZqSdMHMoawVRWY5etR0BWPRj3NFduZOBX/7yau8BXkoxVlhr/TZEUmG0hRj5oA1 of1320dRCHVupxol2TIXMuoIJEqmTzXP1iMOVuGltcfr4nfP2/zIHp8NkM4SDWinm4qi rcZA== X-Gm-Message-State: APt69E2XrGcMQxy6EMxwnzN6ZVWwfzwVLfeyDDbu2k3eSmq1CerrFlVs OxLpNSr8l2EYosYQYcYO15w= X-Received: by 2002:a2e:428e:: with SMTP id h14-v6mr2271676ljf.136.1529092222494; Fri, 15 Jun 2018 12:50:22 -0700 (PDT) Received: from mobilestation ([5.166.218.73]) by smtp.gmail.com with ESMTPSA id q5-v6sm1583908ljj.68.2018.06.15.12.50.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 12:50:21 -0700 (PDT) Date: Fri, 15 Jun 2018 22:50:30 +0300 From: Serge Semin To: Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-ntb@googlegroups.com, Jon Mason , Dave Jiang , Allen Hubbe , Shyam Sundar S K , Shuah Khan Subject: Re: [PATCH 6/8] NTB: perf: Fix support for hardware that doesn't have port numbers Message-ID: <20180615195030.GA25303@mobilestation> References: <20180609000819.13883-1-logang@deltatee.com> <20180609000819.13883-8-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180609000819.13883-8-logang@deltatee.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 08, 2018 at 06:08:17PM -0600, Logan Gunthorpe wrote: > Legacy drivers do not have port numbers (but is reliably only two ports) > and was broken by the recent commit that added mult-port support to > ntb_perf. This is especially important to support the cross link > topology which is perfectly symmetric and cannot assign unique port > numbers easily. > Please, see the comment to the patch 3/8. I explained everything there including the fact, that the Intel/AMD drivers do have unique port numbers assigned. Regards, -Sergey > Hardware that returns zero for both the local port and the peer should > just always use gidx=0 for the only peer. > > Fixes: 5648e56d03fa ("NTB: ntb_perf: Add full multi-port NTB API support") > Signed-off-by: Logan Gunthorpe > --- > drivers/ntb/test/ntb_perf.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c > index fe27412ffe91..6285cb8515ac 100644 > --- a/drivers/ntb/test/ntb_perf.c > +++ b/drivers/ntb/test/ntb_perf.c > @@ -1417,6 +1417,16 @@ static int perf_init_peers(struct perf_ctx *perf) > if (perf->gidx == -1) > perf->gidx = pidx; > > + /* > + * Hardware with only two ports may not have unique port > + * numbers. In this case, the gidxs should all be zero. > + */ > + if (perf->pcnt == 1 && ntb_port_number(perf->ntb) == 0 && > + ntb_peer_port_number(perf->ntb, 0) == 0) { > + perf->gidx = 0; > + perf->peers[0].gidx = 0; > + } > + > for (pidx = 0; pidx < perf->pcnt; pidx++) { > ret = perf_setup_peer_mw(&perf->peers[pidx]); > if (ret) > -- > 2.11.0 > > -- > You received this message because you are subscribed to the Google Groups "linux-ntb" group. > To unsubscribe from this group and stop receiving emails from it, send an email to linux-ntb+unsubscribe@googlegroups.com. > To post to this group, send email to linux-ntb@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/linux-ntb/20180609000819.13883-8-logang%40deltatee.com. > For more options, visit https://groups.google.com/d/optout.