]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
RDMA/efa: Mask access flags with the correct optional range
authorGal Pressman <galpress@amazon.com>
Wed, 29 Jan 2020 07:18:03 +0000 (09:18 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 29 Jan 2020 20:41:05 +0000 (16:41 -0400)
The uapi value IB_UVERBS_ACCESS_OPTIONAL_RANGE shouldn't be used inside
the driver, use IB_ACCESS_OPTIONAL instead.

Fixes: 86dd738cf20c ("RDMA/efa: Allow passing of optional access flags for MR registration")
Link: https://lore.kernel.org/r/20200129071803.40117-1-galpress@amazon.com
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/efa/efa_verbs.c

index 4c7b7800a861d8638535fd8ce0ae1fb2c3c9d86b..ec554587055449a1ff1084bde23200dc50f61f2b 100644 (file)
@@ -1367,7 +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;
+       access_flags &= ~IB_ACCESS_OPTIONAL;
        if (access_flags & ~supp_access_flags) {
                ibdev_dbg(&dev->ibdev,
                          "Unsupported access flags[%#x], supported[%#x]\n",