RDMA/efa: Allow passing of optional access flags for MR registration
authorMichael Guralnik <michaelgur@mellanox.com>
Wed, 8 Jan 2020 18:05:37 +0000 (20:05 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 16 Jan 2020 19:55:46 +0000 (15:55 -0400)
As part of adding a range of optional access flags that drivers need to be
able to accept, mask this range inside efa driver.  This will prevent the
driver from failing when an access flag from that range is passed.

Link: https://lore.kernel.org/r/1578506740-22188-8-git-send-email-yishaih@mellanox.com
Signed-off-by: Michael Guralnik <michaelgur@mellanox.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/efa/efa_verbs.c

index 9a6cff7..a556572 100644 (file)
@@ -1367,6 +1367,7 @@ struct ib_mr *efa_reg_mr(struct ib_pd *ibpd, u64 start, u64 length,
                IB_ACCESS_LOCAL_WRITE |
                (is_rdma_read_cap(dev) ? IB_ACCESS_REMOTE_READ : 0);
 
+       access_flags &= ~IB_UVERBS_ACCESS_OPTIONAL_RANGE;
        if (access_flags & ~supp_access_flags) {
                ibdev_dbg(&dev->ibdev,
                          "Unsupported access flags[%#x], supported[%#x]\n",