From: Jason Gunthorpe <jgg@nvidia.com>
To: Niklas Schnelle <schnelle@linux.ibm.com>
Cc: Leon Romanovsky <leon@kernel.org>,
Doug Ledford <dledford@redhat.com>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND 1/2] RDMA/mlx5: Fix number of allocated XLT entries
Date: Wed, 8 Sep 2021 08:45:10 -0300 [thread overview]
Message-ID: <20210908114510.GD3190597@nvidia.com> (raw)
In-Reply-To: <20210908081849.7948-1-schnelle@linux.ibm.com>
On Wed, Sep 08, 2021 at 10:18:48AM +0200, Niklas Schnelle wrote:
> In commit 8010d74b9965b ("RDMA/mlx5: Split the WR setup out of
> mlx5_ib_update_xlt()") the allocation logic was split out of
> mlx5_ib_update_xlt() and the logic was changed to enable better OOM
> handling. Sadly this change introduced a miscalculation of the number of
> entries that were actually allocated when under memory pressure where it
> can actually become 0 which on s390 lets dma_map_single() fail.
>
> It can also lead to corruption of the free pages list when the wrong
> number of entries is used in the calculation of sg->length which is used
> as argument for free_pages().
>
> Fix this by using the allocation size instead of misusing
> get_order(size).
>
> Cc: stable@vger.kernel.org
> Fixes: 8010d74b9965b ("RDMA/mlx5: Split the WR setup out of mlx5_ib_update_xlt()")
> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
> ---
> drivers/infiniband/hw/mlx5/mr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Both patches applied to for-rc, thanks
Jason
prev parent reply other threads:[~2021-09-08 11:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-08 8:18 [PATCH RESEND 1/2] RDMA/mlx5: Fix number of allocated XLT entries Niklas Schnelle
2021-09-08 8:18 ` [PATCH RESEND 2/2] RDMA/mlx5: Fix xlt_chunk_align calculation Niklas Schnelle
2021-09-08 11:45 ` 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=20210908114510.GD3190597@nvidia.com \
--to=jgg@nvidia.com \
--cc=dledford@redhat.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=schnelle@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).