RDMA/efa: Remove .create_ah callback assignment
authorGal Pressman <galpress@amazon.com>
Sun, 15 Nov 2020 10:34:02 +0000 (12:34 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 16 Nov 2020 20:50:30 +0000 (16:50 -0400)
Drivers now expose two callbacks for address handle creation, one for
uverbs and one for kverbs. EFA only supports uverbs so the .create_ah
assignment can be removed. Fix the core code caller to check the proper
function pointer.

Link: https://lore.kernel.org/r/20201115103404.48829-3-galpress@amazon.com
Signed-off-by: Gal Pressman <galpress@amazon.com>
Acked-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/verbs.c
drivers/infiniband/hw/efa/efa_main.c

index ab1e6048685ee5254e1128ac1a72153f7169f5ed..33778f8674a14580844874cf0d5dba0415f5862e 100644 (file)
@@ -516,7 +516,7 @@ static struct ib_ah *_rdma_create_ah(struct ib_pd *pd,
 
        might_sleep_if(flags & RDMA_CREATE_AH_SLEEPABLE);
 
-       if (!device->ops.create_ah)
+       if (!udata && !device->ops.create_ah)
                return ERR_PTR(-EOPNOTSUPP);
 
        ah = rdma_zalloc_drv_obj_gfp(
index 2b3da85fb43c988b8af1d9db59d6a33c35ac0a4a..cb2f2c647ee5653db4ca6d76ebe939f1e1f4e7cd 100644 (file)
@@ -245,7 +245,6 @@ static const struct ib_device_ops efa_dev_ops = {
        .alloc_hw_stats = efa_alloc_hw_stats,
        .alloc_pd = efa_alloc_pd,
        .alloc_ucontext = efa_alloc_ucontext,
-       .create_ah = efa_create_ah,
        .create_cq = efa_create_cq,
        .create_qp = efa_create_qp,
        .create_user_ah = efa_create_ah,