Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1198614imm; Fri, 15 Jun 2018 12:52:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIGItf3piSjrskEw9vHwdbLYwP5iFjF1le2EPCwJYHDxb5KA1GUEYsYCz7pxg31xb+mv8Xa X-Received: by 2002:a62:1146:: with SMTP id z67-v6mr3360925pfi.135.1529092351533; Fri, 15 Jun 2018 12:52:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529092351; cv=none; d=google.com; s=arc-20160816; b=GSxnFfdg69yAo+3JkKjMcywNXxv+NNl3uhJyXy6yg6cJKWcGbZTVQMnHjI3dH/RuOf 0wsvnSPpYA+MrYkIzPkVVf+A0hhApeN9sVPtvcyfed5Rk5d1/0sU71tcrPONu+Xhrl5k EhBJmFiglt8Vph76iLC8yYIv1nfn6WRa9xSkdDQtOHzzF2cthjVs9PYbc08Fr4z6rseN b7iNi1S695BsEQHJgLhjhkJxpGQxlO1aTWZr0AeB8mzxdD3OfliFMZM9uZ1Sm9QJZe6s 9VIGsx3nDNiWN232Xy1/R0CqqSI9SuIkZVd3Z0Nxtdq9tFJ3ICg2IArvgbUz0HleqtDq EBVg== 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=XxeI+Db9Z2DvdlS4Y03LmdB0jkHe/57Fo9DEqP7kd3U=; b=05dj4w7ZdVrTmJf0ggXJ0jL0hykWmaDkrK2ST5WwpkicBoCOZM4cbAIEmkNINd8mjb 4fzqr6G80EDrLNzQEvW4EugB/nBR8N+Raf3cUf306FUelY/FwEjhdXYIQDz6trvcmCu+ UaMKSwaf+89EEWS4FwYM3kbF2J4O35HgrvppO2tPoDvy0MvxlSU5EN2KAw82uLjw9mek 9Rde2ZQ8x9ECku+0Q2D0K29AZlZsChPLronET7ftXHxFOuClSQ8VGqxCf0eTijkpaIZN f68rheVC3a9PtwvyjtHrO7kbTOlDGbzTousdR50yRd/UQsljl95nZbCt1kGHuw8jAkDy F7PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="qFwNB/mc"; 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 e9-v6si6904732pgo.397.2018.06.15.12.52.16; Fri, 15 Jun 2018 12:52:31 -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="qFwNB/mc"; 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 S966445AbeFOTvr (ORCPT + 99 others); Fri, 15 Jun 2018 15:51:47 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:42977 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966120AbeFOTvp (ORCPT ); Fri, 15 Jun 2018 15:51:45 -0400 Received: by mail-lf0-f66.google.com with SMTP id v135-v6so16241419lfa.9 for ; Fri, 15 Jun 2018 12:51:44 -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=XxeI+Db9Z2DvdlS4Y03LmdB0jkHe/57Fo9DEqP7kd3U=; b=qFwNB/mchYK6aJGr/6EPM78A+3qxhc2XaQaAxcElL4ng9tEvmyyW3AJQKcA985ArOc XEits1msUnLkU33+PUgX/Aw9wi8lvwbxlXvSWBTxF87u0VCdzrxnj3yL1lAfxN6npAwV TKNu41GzuHHJlhcOtr1ICBlaLTSA0Tc80It+w1WrBPo+u/JgKaezUPZr/W2gfqUgfsHF OBlFX+CduDX7is0kl444ugR/vqNCjOVWRjYUdpfRzAyRs0wgNGAhGVsQNiYZbXUm3Skp 1v6Ol/BUlvZAiydbYKnkt3ckkhLXm6r6SQGhMXn1jmRrAxf5aCrJ6ojcVbCf+lbCCvhN 3xqw== 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=XxeI+Db9Z2DvdlS4Y03LmdB0jkHe/57Fo9DEqP7kd3U=; b=nsbI1YKekT64+HbGuKSw9EAoeC7vlH9F7c5D4xgCixWPEiLLtTZ0EcOC6SnsKbauzV wfdk15AKPVQ0q4KNMsuLAixUMs62FdReCo5X0LyfE4PDnyETk85bhSoCWc0ph01Gbr7g 0ObcQvRg4hDU1tdtV4lx7d38LaBsp3kTZv8+nGdwNqB2BwM9c0g7do8UBoauc3OUCCli zw+8DXh4/7jjdqaDVcYEhEpm/u1yLduar8b8u+zA1xcNe6Gr9+XB7bfst07IudrinwCY B9GooXPKx9QIhwqMh+G16JsxDfNw2oewNRwPOU7S2lpr9jU44WyL8Bwq5vV/bTllG4Vg 5Zkw== X-Gm-Message-State: APt69E1gitgFczRcsfPE3TID7ivb2/6/cdXDx3cWZkoEEtDUsReqdDmv IuQCeuQBf+S96Kwy+uU7arc= X-Received: by 2002:a19:8e4e:: with SMTP id q75-v6mr2067375lfd.95.1529092304246; Fri, 15 Jun 2018 12:51:44 -0700 (PDT) Received: from mobilestation ([5.166.218.73]) by smtp.gmail.com with ESMTPSA id p28-v6sm1631581lfh.24.2018.06.15.12.51.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 12:51:43 -0700 (PDT) Date: Fri, 15 Jun 2018 22:51:52 +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 8/8] NTB: ntb_test: Fix bug when counting remote files Message-ID: <20180615195152.GA25605@mobilestation> References: <20180609000819.13883-1-logang@deltatee.com> <20180609000819.13883-10-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180609000819.13883-10-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:19PM -0600, Logan Gunthorpe wrote: > When remote files are counted in get_files_count, without using SSH, > the code returns 0 because there is a colon prepended to $LOC. $VPATH > should have been used instead of $LOC. > Good catch. Thanks for the patch. I discovered this problem myself a few days before you sent this patchset. So was going to submit the fix, but you were faster. I also tested this script in the looped-back setup. It is the case when two NTB-device ports are available at the same RootComplex. So the NTB can be configured from the single executional context. In this case the REMOTE_HOST is left empty, so the colon is left prepended to the corresponding paths and causes multiple errors including the one fixed by this patch. In order to fix it, we need to discard the colon for remote-less case, for instance, by the next patch: @@ -482,7 +495,11 @@ function perf_test() function ntb_tool_tests() { LOCAL_TOOL="$DEBUGFS/ntb_tool/$LOCAL_DEV" - REMOTE_TOOL="$REMOTE_HOST:$DEBUGFS/ntb_tool/$REMOTE_DEV" + if [[ "${REMOTE_HOST}" != "" ]]; then + REMOTE_TOOL="$REMOTE_HOST:$DEBUGFS/ntb_tool/$REMOTE_DEV" + else + REMOTE_TOOL="$DEBUGFS/ntb_tool/$REMOTE_DEV" + fi echo "Starting ntb_tool tests..." And so on for REMOTE_PP and REMOTE_PERF. It is necessary for NTB devices, which ports are looped-back to the same Root-Port. Would you be amenable if you resent this patch together with the fix I suggested? Regards, -Sergey > Fixes: 06bd0407d06c ("NTB: ntb_test: Update ntb_tool Scratchpad tests") > Signed-off-by: Logan Gunthorpe > --- > tools/testing/selftests/ntb/ntb_test.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb/ntb_test.sh > index 08cbfbbc7029..17ca36403d04 100755 > --- a/tools/testing/selftests/ntb/ntb_test.sh > +++ b/tools/testing/selftests/ntb/ntb_test.sh > @@ -250,7 +250,7 @@ function get_files_count() > split_remote $LOC > > if [[ "$REMOTE" == "" ]]; then > - echo $(ls -1 "$LOC"/${NAME}* 2>/dev/null | wc -l) > + echo $(ls -1 "$VPATH"/${NAME}* 2>/dev/null | wc -l) > else > echo $(ssh "$REMOTE" "ls -1 \"$VPATH\"/${NAME}* | \ > wc -l" 2> /dev/null) > -- > 2.11.0 >