All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: Doug Ledford <dledford@redhat.com>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zheng Yongjun <zhengyongjun3@huawei.com>,
	Wenpeng Liang <liangwenpeng@huawei.com>,
	Leon Romanovsky <leon@kernel.org>,
	Weihang Li <liweihang@huawei.com>, Mark Bloch <mbloch@nvidia.com>
Subject: Re: [PATCH] RDMA/rw: switch to dma_map_sgtable()
Date: Tue, 5 Oct 2021 15:22:00 -0300	[thread overview]
Message-ID: <20211005182200.GA2677974@nvidia.com> (raw)
In-Reply-To: <20211001213215.3761-1-logang@deltatee.com>

On Fri, Oct 01, 2021 at 03:32:15PM -0600, Logan Gunthorpe wrote:
> There are a couple of subtle error path bugs related to mapping the
> sgls:
> 
> - In rdma_rw_ctx_init(), dma_unmap would be called with an sg that
>   could have been incremented from the original call, as well as an
>   nents that was not the original number of nents called when mapped.
> - Similarly in rdma_rw_ctx_signature_init, both sg and prot_sg were
>   unmapped with the incorrect number of nents.
> 
> To fix this, switch to the sgtable interface for mapping which
> conveniently stores the original nents for unmapping. This will get
> cleaned up further once the dma mapping interface supports P2PDMA and
> pci_p2pdma_map_sg() can be removed. At that point the sgtable interface
> will be preferred as it offers better error reporting for P2PDMA pages.
> 
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
 ---
>  drivers/infiniband/core/rw.c | 66 ++++++++++++++++++++++--------------
>  1 file changed, 41 insertions(+), 25 deletions(-)

Applied to for-next, thanks

Jason

      reply	other threads:[~2021-10-05 18:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 21:32 [PATCH] RDMA/rw: switch to dma_map_sgtable() Logan Gunthorpe
2021-10-05 18:22 ` Jason Gunthorpe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211005182200.GA2677974@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=dledford@redhat.com \
    --cc=leon@kernel.org \
    --cc=liangwenpeng@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=liweihang@huawei.com \
    --cc=logang@deltatee.com \
    --cc=mbloch@nvidia.com \
    --cc=zhengyongjun3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.