Received: by 10.223.176.46 with SMTP id f43csp100163wra; Thu, 18 Jan 2018 14:32:13 -0800 (PST) X-Google-Smtp-Source: ACJfBothx+YdfPsI0DYL67aBXaBZIG+S7JZEKoCfoSiuZtwWuE8qNVBb2zApxVSfECz38DcY19aG X-Received: by 10.101.90.202 with SMTP id d10mr15823890pgt.366.1516314733509; Thu, 18 Jan 2018 14:32:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516314733; cv=none; d=google.com; s=arc-20160816; b=rlrQOyz+VRXptkGHU8LQadWEcgVq+m9gMbxOIFCO+Pz9BMvB78ZjBqoLMDTP/xkmg9 5WSemvSiFlag/EA3ESgH5sgK88s2GJIuS1FQ4BCQ3YBSZtojagoVf/KH2LrXbOCtjtpy QDxGEKXoLwxWju8FY9fIleePfccCcjxTx9YX5XInaKI9ptpYyAaCOYxEl6oQF34d/dTA Ub2mESz+JfsA3izhFxMug2/qiCFJZ3Gsr+DP99qqWUlPAaoIXFsS/2xZsq/tmZiGxIC0 gena2b60UUhv3a4psXZfStg3OG3yTdgmMpE04TC6NfimulCdAVlbrLylWOmIEVwzMUC4 C/hw== 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=9XsssMVmW+MlKu9j0g9PMiVJKZaEdSqWlJfuSVy4+i8=; b=ZH+UxwxRZcWAWsb9TR4sMoFfzyAHudxuwqJLjSyVQkw+ctsurUzG09WXDEMwP8b9ww TCs7hYByL9ketSGQ2VF5gKCvvh4Hx8vbDgDKegdv3Hn+OKEWBgJw3zl+lTYkuZ1IkVR3 YsWVG8c11iCzFSmAdBLili4kSfNTWi9RBs2uBYCk17qNeUtT5SGrPSby+gS6pzupDx3i Z7QYi6XorTgiBheeN9dpXYsprvUOoh3oEyeYwi/JAxc+xtJgH+bleinsEJ931VyDI+II o2xdGbfHsnvKiBHaytcrvLKyT3sBA7WjJr/ZEs/1Rb5fnaMYK9I/pjbk+pXrK54bOTCR 6+7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kudzu-us.20150623.gappssmtp.com header.s=20150623 header.b=RubIYpg2; 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 i2si8087166pfd.57.2018.01.18.14.32.00; Thu, 18 Jan 2018 14:32:13 -0800 (PST) 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=@kudzu-us.20150623.gappssmtp.com header.s=20150623 header.b=RubIYpg2; 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 S1755026AbeARWaE (ORCPT + 99 others); Thu, 18 Jan 2018 17:30:04 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:36936 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753696AbeARW35 (ORCPT ); Thu, 18 Jan 2018 17:29:57 -0500 Received: by mail-qt0-f193.google.com with SMTP id d54so22251556qtd.4 for ; Thu, 18 Jan 2018 14:29:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kudzu-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9XsssMVmW+MlKu9j0g9PMiVJKZaEdSqWlJfuSVy4+i8=; b=RubIYpg2znrSYpA9K2SRbjj+RQDcSr+MWmTJ6rcllQKGeNcN6USQOiMaJUXIrL7gZA gbPuSTBO9ipenDyODOfqj6YpdYvH/Im0aYwYZSr7Xl4lyugzXp4z2OM++nb6IZFr34D4 XkIFbvzxFFmKSQCIivPjNNSP/NNNKjhBUve18rRQtD6pqmUJ04HS6AMfwTTn8EWw9gYB OMuP9k+tyNMNHwWGzGcKC2BaCOr4ZXFePMmX+e3x8z4AjbgnD79U+FOJSDh4W+AGuzZB up/lTEdsKRE5mB+X55RIgGOebx9fJi+pj2Xo/BJAmWEu33/7AU47LLvn25+QQfvrNw3G FYJw== 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=9XsssMVmW+MlKu9j0g9PMiVJKZaEdSqWlJfuSVy4+i8=; b=ukgrw3DGsIiu1iEfQNnrE8CPMraZPGMYAXZmxScNOvWIqSQ11oz2YKcSCAAirGr0U+ M03r8ulVyAJZ6Kho6zW3Kr47+2NG3IxaBzcMEypeX5zCwAt/h9Rf1T8SR9b2Bon/vDjN 5RKsLO+LeUWLTnAKogfNlJo6mc73X+GHiiv52PYdVk00x7oT+aI3IfZe9kXsJJiH1f/T R1up/FWy0fXgflK+n0GbUSsBdRvlrPe1dha0i3sS3lUtxapZohAq0X13ycmI//3ieFst k84oot3vlWuwY/ZzYdtvavuS2u392h00QOrdC1EBQktZcmERxMKVKPBAa5FxVp+7cVHX OkEA== X-Gm-Message-State: AKwxytcF0nmAFPoFOnrpr4Si/iCBgQDgHEyZuVA/bsYDsDzvvnC4bjbY KwMgRzb2z1w+yFd13Bd6F2UXlQ== X-Received: by 10.200.57.162 with SMTP id v31mr20796626qte.128.1516314596391; Thu, 18 Jan 2018 14:29:56 -0800 (PST) Received: from kudzu.us ([98.122.141.161]) by smtp.gmail.com with ESMTPSA id r53sm5566713qtr.57.2018.01.18.14.29.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jan 2018 14:29:56 -0800 (PST) Date: Thu, 18 Jan 2018 17:29:54 -0500 From: Jon Mason To: Logan Gunthorpe Cc: linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org, Allen.Hubbe@dell.com, Dave Jiang Subject: Re: [PATCH v2 1/2] ntb_transport: Fix bug with max_mw_size parameter Message-ID: <20180118222953.GC25893@kudzu.us> References: <20171218182506.5219-1-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171218182506.5219-1-logang@deltatee.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 18, 2017 at 11:25:05AM -0700, Logan Gunthorpe wrote: > When using the max_mw_size parameter of ntb_transport to limit the size of > the Memory windows, communication cannot be established and the queues > freeze. > > This is because the mw_size that's reported to the peer is correctly > limited but the size used locally is not. So the MW is initialized > with a buffer smaller than the window but the TX side is using the > full window. This means the TX side will be writing to a region of the > window that points nowhere. > > This is easily fixed by applying the same limit to tx_size in > ntb_transport_init_queue(). Applied to ntb-next. Thanks, Jon > > Fixes: e26a5843f7f5 ("NTB: Split ntb_hw_intel and ntb_transport drivers") > Signed-off-by: Logan Gunthorpe > Acked-by: Allen Hubbe > Cc: Jon Mason > Cc: Dave Jiang > --- > drivers/ntb/ntb_transport.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c > index 045e3dd4750e..9878c48826e3 100644 > --- a/drivers/ntb/ntb_transport.c > +++ b/drivers/ntb/ntb_transport.c > @@ -1003,6 +1003,9 @@ static int ntb_transport_init_queue(struct ntb_transport_ctx *nt, > mw_base = nt->mw_vec[mw_num].phys_addr; > mw_size = nt->mw_vec[mw_num].phys_size; > > + if (max_mw_size && mw_size > max_mw_size) > + mw_size = max_mw_size; > + > tx_size = (unsigned int)mw_size / num_qps_mw; > qp_offset = tx_size * (qp_num / mw_count); > > -- > 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/20171218182506.5219-1-logang%40deltatee.com. > For more options, visit https://groups.google.com/d/optout.