From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0173ECE58C for ; Mon, 7 Oct 2019 12:12:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0F9B20867 for ; Mon, 7 Oct 2019 12:12:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="M5unEYoR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727716AbfJGMMr (ORCPT ); Mon, 7 Oct 2019 08:12:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51504 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727467AbfJGMMq (ORCPT ); Mon, 7 Oct 2019 08:12:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=NqZCL9FFV5jxg5SgSyY7hAFsJqUG9yJ1eIIIYBNoz4I=; b=M5unEYoRvbqLicq7WjdHaoVUi 8hGurkSClm928w67S9VpITLU8TWdna7SA5MaLMKRABr84waLVuYTUNinFSeVQ6c3hvXrYfd6+3e5k qF8cw1Gn1RzIIAnpan12O3lc9uOu6vk7Ym+ogEaXaDCLNYJtifUq9ClJu1HsMorJWJ9/7TbHF3qmf LNLWHyVDfWtB4pAvc1/d4IMu6sCVAeiTiGFA/9ezlwk+bYa1kXB7DhaT2H8Pe5sW/Xtp6XDz04eC6 e7ZuMtoYNRw1cJlhzBaCKhV4t5RAFrPvwVhNXfF9/XQGVIVl5k9DLT+trkoLgBLVBoJWVW6MFlTw1 D40X8zR9Q==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHRsa-0006vi-GH; Mon, 07 Oct 2019 12:12:44 +0000 Date: Mon, 7 Oct 2019 05:12:44 -0700 From: Christoph Hellwig To: Leon Romanovsky Cc: Doug Ledford , Jason Gunthorpe , Christoph Hellwig , Leon Romanovsky , RDMA mailing list , Or Gerlitz , Yamin Friedman , Saeed Mahameed , linux-netdev Subject: Re: [PATCH rdma-next v1 2/3] RDMA/rw: Support threshold for registration vs scattering to local pages Message-ID: <20191007121244.GA19843@infradead.org> References: <20191007115819.9211-1-leon@kernel.org> <20191007115819.9211-3-leon@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191007115819.9211-3-leon@kernel.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Sorry for nitpicking again, but.. On Mon, Oct 07, 2019 at 02:58:18PM +0300, Leon Romanovsky wrote: > @@ -37,15 +39,15 @@ static inline bool rdma_rw_can_use_mr(struct ib_device *dev, u8 port_num) > * Check if the device will use memory registration for this RW operation. > * We currently always use memory registrations for iWarp RDMA READs, and > * have a debug option to force usage of MRs. > - * > - * XXX: In the future we can hopefully fine tune this based on HCA driver > - * input. The above comment needs an updated a la: * Check if the device will use memory registration for this RW operation. * For RDMA READs we must use MRs on iWarp and can optionaly use them as an * optimaztion otherwise. Additionally we have a debug option to force usage * of MRs to help testing this code path. > if (rdma_protocol_iwarp(dev, port_num) && dir == DMA_FROM_DEVICE) > return true; > + if (dev->attrs.max_sgl_rd && dir == DMA_FROM_DEVICE && > + dma_nents > dev->attrs.max_sgl_rd) > + return true; This can be simplified to: if (dir == DMA_FROM_DEVICE && (rdma_protocol_iwarp(dev, port_num) || (dev->attrs.max_sgl_rd && dma_nents > dev->attrs.max_sgl_rd))) return true;