* [PATCH for-next 0/2] create_user_ah introduction fixups
@ 2020-11-15 10:34 Gal Pressman
2020-11-15 10:34 ` [PATCH for-next 1/2] RDMA/core: Check .create_ah is not NULL only in case it's needed Gal Pressman
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Gal Pressman @ 2020-11-15 10:34 UTC (permalink / raw)
To: Jason Gunthorpe, Doug Ledford; +Cc: linux-rdma, Gal Pressman
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(-)
--
2.29.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH for-next 1/2] RDMA/core: Check .create_ah is not NULL only in case it's needed
2020-11-15 10:34 [PATCH for-next 0/2] create_user_ah introduction fixups Gal Pressman
@ 2020-11-15 10:34 ` Gal Pressman
2020-11-15 11:15 ` Leon Romanovsky
2020-11-16 18:22 ` Jason Gunthorpe
2020-11-15 10:34 ` [PATCH for-next 2/2] RDMA/efa: Remove .create_ah callback assignment Gal Pressman
2020-11-16 20:52 ` [PATCH for-next 0/2] create_user_ah introduction fixups Jason Gunthorpe
2 siblings, 2 replies; 8+ messages in thread
From: Gal Pressman @ 2020-11-15 10:34 UTC (permalink / raw)
To: Jason Gunthorpe, Doug Ledford; +Cc: linux-rdma, 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")
Signed-off-by: Gal Pressman <galpress@amazon.com>
---
drivers/infiniband/core/verbs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index ab1e6048685e..33778f8674a1 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -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(
--
2.29.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH for-next 2/2] RDMA/efa: Remove .create_ah callback assignment
2020-11-15 10:34 [PATCH for-next 0/2] create_user_ah introduction fixups Gal Pressman
2020-11-15 10:34 ` [PATCH for-next 1/2] RDMA/core: Check .create_ah is not NULL only in case it's needed Gal Pressman
@ 2020-11-15 10:34 ` Gal Pressman
2020-11-15 11:15 ` Leon Romanovsky
2020-11-16 20:52 ` [PATCH for-next 0/2] create_user_ah introduction fixups Jason Gunthorpe
2 siblings, 1 reply; 8+ messages in thread
From: Gal Pressman @ 2020-11-15 10:34 UTC (permalink / raw)
To: Jason Gunthorpe, Doug Ledford; +Cc: linux-rdma, Gal Pressman, Yossi Leybovich
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 <galpress@amazon.com>
---
drivers/infiniband/hw/efa/efa_main.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/infiniband/hw/efa/efa_main.c b/drivers/infiniband/hw/efa/efa_main.c
index 2b3da85fb43c..cb2f2c647ee5 100644
--- a/drivers/infiniband/hw/efa/efa_main.c
+++ b/drivers/infiniband/hw/efa/efa_main.c
@@ -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,
--
2.29.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH for-next 1/2] RDMA/core: Check .create_ah is not NULL only in case it's needed
2020-11-15 10:34 ` [PATCH for-next 1/2] RDMA/core: Check .create_ah is not NULL only in case it's needed Gal Pressman
@ 2020-11-15 11:15 ` Leon Romanovsky
2020-11-16 18:22 ` Jason Gunthorpe
1 sibling, 0 replies; 8+ messages in thread
From: Leon Romanovsky @ 2020-11-15 11:15 UTC (permalink / raw)
To: Gal Pressman; +Cc: Jason Gunthorpe, Doug Ledford, linux-rdma
On Sun, Nov 15, 2020 at 12:34:02PM +0200, Gal Pressman wrote:
> 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")
> Signed-off-by: Gal Pressman <galpress@amazon.com>
> ---
> drivers/infiniband/core/verbs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH for-next 2/2] RDMA/efa: Remove .create_ah callback assignment
2020-11-15 10:34 ` [PATCH for-next 2/2] RDMA/efa: Remove .create_ah callback assignment Gal Pressman
@ 2020-11-15 11:15 ` Leon Romanovsky
0 siblings, 0 replies; 8+ messages in thread
From: Leon Romanovsky @ 2020-11-15 11:15 UTC (permalink / raw)
To: Gal Pressman; +Cc: Jason Gunthorpe, Doug Ledford, linux-rdma, Yossi Leybovich
On Sun, Nov 15, 2020 at 12:34:03PM +0200, Gal Pressman wrote:
> 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 <galpress@amazon.com>
> ---
> drivers/infiniband/hw/efa/efa_main.c | 1 -
> 1 file changed, 1 deletion(-)
>
Thanks,
Acked-by: Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH for-next 1/2] RDMA/core: Check .create_ah is not NULL only in case it's needed
2020-11-15 10:34 ` [PATCH for-next 1/2] RDMA/core: Check .create_ah is not NULL only in case it's needed Gal Pressman
2020-11-15 11:15 ` Leon Romanovsky
@ 2020-11-16 18:22 ` Jason Gunthorpe
2020-11-16 18:32 ` Gal Pressman
1 sibling, 1 reply; 8+ messages in thread
From: Jason Gunthorpe @ 2020-11-16 18:22 UTC (permalink / raw)
To: Gal Pressman; +Cc: Doug Ledford, linux-rdma
On Sun, Nov 15, 2020 at 12:34:02PM +0200, Gal Pressman wrote:
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH for-next 1/2] RDMA/core: Check .create_ah is not NULL only in case it's needed
2020-11-16 18:22 ` Jason Gunthorpe
@ 2020-11-16 18:32 ` Gal Pressman
0 siblings, 0 replies; 8+ messages in thread
From: Gal Pressman @ 2020-11-16 18:32 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: Doug Ledford, linux-rdma
On 16/11/2020 20:22, Jason Gunthorpe wrote:
> On Sun, Nov 15, 2020 at 12:34:02PM +0200, Gal Pressman wrote:
>> 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 ?
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH for-next 0/2] create_user_ah introduction fixups
2020-11-15 10:34 [PATCH for-next 0/2] create_user_ah introduction fixups Gal Pressman
2020-11-15 10:34 ` [PATCH for-next 1/2] RDMA/core: Check .create_ah is not NULL only in case it's needed Gal Pressman
2020-11-15 10:34 ` [PATCH for-next 2/2] RDMA/efa: Remove .create_ah callback assignment Gal Pressman
@ 2020-11-16 20:52 ` Jason Gunthorpe
2 siblings, 0 replies; 8+ messages in thread
From: Jason Gunthorpe @ 2020-11-16 20:52 UTC (permalink / raw)
To: Gal Pressman; +Cc: Doug Ledford, linux-rdma
On Sun, Nov 15, 2020 at 12:34:01PM +0200, Gal Pressman wrote:
> 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
I squashed them together, thanks
Jason
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-11-16 20:52 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-15 10:34 [PATCH for-next 0/2] create_user_ah introduction fixups Gal Pressman
2020-11-15 10:34 ` [PATCH for-next 1/2] RDMA/core: Check .create_ah is not NULL only in case it's needed Gal Pressman
2020-11-15 11:15 ` Leon Romanovsky
2020-11-16 18:22 ` Jason Gunthorpe
2020-11-16 18:32 ` Gal Pressman
2020-11-15 10:34 ` [PATCH for-next 2/2] RDMA/efa: Remove .create_ah callback assignment Gal Pressman
2020-11-15 11:15 ` Leon Romanovsky
2020-11-16 20:52 ` [PATCH for-next 0/2] create_user_ah introduction fixups Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).