[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191007131706.GX5855@unreal>
Date: Mon, 7 Oct 2019 16:17:06 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: Doug Ledford <dledford@...hat.com>,
Jason Gunthorpe <jgg@...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
On Mon, Oct 07, 2019 at 05:48:31AM -0700, Christoph Hellwig wrote:
> On Mon, Oct 07, 2019 at 03:36:56PM +0300, Leon Romanovsky wrote:
> > > > 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;
> >
> > I don't think that it simplifies and wanted to make separate checks to
> > be separated. For example, rdma_protocol_iwarp() has nothing to do with
> > attrs.max_sgl_rd.
>
> The important bit is to have the DMA_FROM_DEVICE check only once, as
> we only do the registration for reads with either parameter. So if
> you want it more verbose the wya would be:
>
> if (dir == DMA_FROM_DEVICE) {
> if (rdma_protocol_iwarp(dev, port_num))
> return true;
> if (dev->attrs.max_sgl_rd && dma_nents > dev->attrs.max_sgl_rd)
> return true;
> }
I'm doing it now, Thank you for taking time to explain.
Powered by blists - more mailing lists