From: Artemy Kovalyov Date: Sun, 25 Nov 2018 18:34:26 +0000 (+0200) Subject: IB/mlx5: Fix page fault handling for MW X-Git-Tag: v4.14.89~37 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8f859b2729e980d511f29a68c3474aa27ead72b7;p=users%2Fjedix%2Flinux-maple.git IB/mlx5: Fix page fault handling for MW [ Upstream commit 75b7b86bdb0df37e08e44b6c1f99010967f81944 ] Memory windows are implemented with an indirect MKey, when a page fault event comes for a MW Mkey we need to find the MR at the end of the list of the indirect MKeys by iterating on all items from the first to the last. The offset calculated during this process has to be zeroed after the first iteration or the next iteration will start from a wrong address, resulting incorrect ODP faulting behavior. Fixes: db570d7deafb ("IB/mlx5: Add ODP support to MW") Signed-off-by: Artemy Kovalyov Signed-off-by: Moni Shoua Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c index 3d701c7a4c91..1ed94b6c0b0a 100644 --- a/drivers/infiniband/hw/mlx5/odp.c +++ b/drivers/infiniband/hw/mlx5/odp.c @@ -723,6 +723,7 @@ next_mr: head = frame; bcnt -= frame->bcnt; + offset = 0; } break;