IB/mlx5: Fix page fault handling for MW
authorArtemy Kovalyov <artemyko@mellanox.com>
Sun, 25 Nov 2018 18:34:26 +0000 (20:34 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 26 Nov 2018 23:28:36 +0000 (16:28 -0700)
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 <artemyko@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/odp.c

index 2a0743808bd83787ed6fe86c38252c733c5be1c4..b711a0f3aa3537939350648d7549bfca57ddb4e1 100644 (file)
@@ -743,6 +743,7 @@ next_mr:
                        head = frame;
 
                        bcnt -= frame->bcnt;
+                       offset = 0;
                }
                break;