lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191007121244.GA19843@infradead.org>
Date:   Mon, 7 Oct 2019 05:12:44 -0700
From:   Christoph Hellwig <hch@...radead.org>
To:     Leon Romanovsky <leon@...nel.org>
Cc:     Doug Ledford <dledford@...hat.com>,
        Jason Gunthorpe <jgg@...lanox.com>,
        Christoph Hellwig <hch@...radead.org>,
        Leon Romanovsky <leonro@...lanox.com>,
        RDMA mailing list <linux-rdma@...r.kernel.org>,
        Or Gerlitz <ogerlitz@...lanox.com>,
        Yamin Friedman <yaminf@...lanox.com>,
        Saeed Mahameed <saeedm@...lanox.com>,
        linux-netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH rdma-next v1 2/3] RDMA/rw: Support threshold for
 registration vs scattering to local pages

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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ