create_user_ah introduction fixups
Subsystems (2)
cover create_user_ah introduction fixups
The first patch fixes the create_ah NULL check to only happen in case of kernel AH (!udata).
The second patch removes the create_ah callback from EFA as it does not support kverbs.
Thanks,
Gal
Gal Pressman (2):
RDMA/core: Check .create_ah is not NULL only in case it's needed RDMA/efa: Remove .create_ah callback assignment
drivers/infiniband/core/verbs.c | 2 +- drivers/infiniband/hw/efa/efa_main.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
Signature · 1 line
2.29.2
PATCH 1/2 RDMA/core: Check .create_ah is not NULL only in case it's needed
Drivers now expose two callbacks for address handle creation, one for uverbs and one for kverbs. The function pointer NULL check in _rdma_create_ah() should only happen if !udata.
A NULL check for .create_user_ah is not needed as it is validated by the uverbs uapi definitions.
--- drivers/infiniband/core/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/verbs.c +1 -1
@@ -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(
Signature · 1 line
2.29.2
PATCH 2/2 RDMA/efa: Remove .create_ah callback assignment
In reply to Gal PressmanThe AH creation flow is now split to two callbacks, based on uverbs/kverbs. EFA only supports uverbs so the .create_ah assignment can be removed.
--- drivers/infiniband/hw/efa/efa_main.c | 1 - 1 file changed, 1 deletion(-)
drivers/infiniband/hw/efa/efa_main.c +0 -1
@@ -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,
Signature · 1 line
2.29.2
Re: [PATCH for-next 1/2] RDMA/core: Check .create_ah is not NULL only in case it's needed
In reply to Gal PressmanQuoted 4 lines · Gal Pressman
Drivers now expose two callbacks for address handle creation, one for uverbs and one for kverbs. The function pointer NULL check in
_rdma_create_ah()should only happen if !udata.
Quoted 9 lines
A NULL check for .create_user_ah is not needed as it is validated by the uverbs uapi definitions.
Fixes 676a80adba01 ("RDMA: Remove AH from uverbs_cmd_mask")Signed-off-by Gal Pressman <[email protected]>--- drivers/infiniband/core/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks,
Re: [PATCH for-next 2/2] RDMA/efa: Remove .create_ah callback assignment
In reply to Gal PressmanQuoted 10 lines · Gal Pressman
The AH creation flow is now split to two callbacks, based on uverbs/kverbs. EFA only supports uverbs so the .create_ah assignment can be removed.
Fixes 676a80adba01 ("RDMA: Remove AH from uverbs_cmd_mask")Signed-off-by Gal Pressman <[email protected]>--- drivers/infiniband/hw/efa/efa_main.c | 1 - 1 file changed, 1 deletion(-)
Thanks,
Re: [PATCH for-next 1/2] RDMA/core: Check .create_ah is not NULL only in case it's needed
In reply to Gal PressmanQuoted 8 lines · Gal Pressman
Drivers now expose two callbacks for address handle creation, one for uverbs and one for kverbs. The function pointer NULL check in
_rdma_create_ah()should only happen if !udata.A NULL check for .create_user_ah is not needed as it is validated by the uverbs uapi definitions.
Fixes 676a80adba01 ("RDMA: Remove AH from uverbs_cmd_mask")
Why is this a fixes? It makes sense in the context of the next patch, but it doesn't look like any driver sets ops.create_ah == NULL ?
Jason
Re: [PATCH for-next 1/2] RDMA/core: Check .create_ah is not NULL only in case it's needed
Quoted 5 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman
Drivers now expose two callbacks for address handle creation, one for uverbs and one for kverbs. The function pointer NULL check in
_rdma_create_ah()should only happen if !udata.
Quoted 7 lines
Quoted 4 lines
A NULL check for .create_user_ah is not needed as it is validated by the uverbs uapi definitions.
Fixes 676a80adba01 ("RDMA: Remove AH from uverbs_cmd_mask")Why is this a fixes? It makes sense in the context of the next patch, but it doesn't look like any driver sets ops.create_ah == NULL ?
I assumed that the NULL check should be changed regardless as it makes more sense to only check the callback if it's used.
You can remove it if you prefer, I just hope the second patch won't be accidentally picked up without this one.
Jason Gunthorpe
maintainerQuoted 11 lines · Gal Pressman
The first patch fixes the
create_ahNULL check to only happen in case of kernel AH (!udata).
The second patch removes thecreate_ahcallback from EFA as it does not support kverbs.Thanks,
GalGal Pressman (2):
RDMA/core: Check .create_ah is not NULL only in case it's needed RDMA/efa: Remove .create_ah callback assignment
I squashed them together, thanks
Jason