* [PATCH for-rc] IB/cma: Allow XRG INI QPs to set their local ACK timeout
@ 2022-02-09 13:23 Håkon Bugge
2022-02-09 15:04 ` Leon Romanovsky
0 siblings, 1 reply; 3+ messages in thread
From: Håkon Bugge @ 2022-02-09 13:23 UTC (permalink / raw)
To: Jason Gunthorpe, Leon Romanovsky; +Cc: linux-rdma, linux-kernel
XRC INI QPs should be able to adjust their local ACK timeout.
Fixes: 2c1619edef61 ("IB/cma: Define option to set ack timeout and pack tos_set")
Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
Suggested-by: Avneesh Pant <avneesh.pant@oracle.com>
---
To avoid excessive discussions around the *if (WARN_ON( ...*
construct, just saying that it has been sanctioned by Jason here:
https://lore.kernel.org/linux-rdma/20210413135120.GT7405@nvidia.com/
---
drivers/infiniband/core/cma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 0f5f0d7..006ea9c 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -2811,7 +2811,7 @@ int rdma_set_ack_timeout(struct rdma_cm_id *id, u8 timeout)
{
struct rdma_id_private *id_priv;
- if (id->qp_type != IB_QPT_RC)
+ if (WARN_ON(id->qp_type != IB_QPT_RC && id->qp_type != IB_QPT_XRC_INI))
return -EINVAL;
id_priv = container_of(id, struct rdma_id_private, id);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH for-rc] IB/cma: Allow XRG INI QPs to set their local ACK timeout
2022-02-09 13:23 [PATCH for-rc] IB/cma: Allow XRG INI QPs to set their local ACK timeout Håkon Bugge
@ 2022-02-09 15:04 ` Leon Romanovsky
2022-02-09 15:25 ` Haakon Bugge
0 siblings, 1 reply; 3+ messages in thread
From: Leon Romanovsky @ 2022-02-09 15:04 UTC (permalink / raw)
To: Håkon Bugge; +Cc: Jason Gunthorpe, linux-rdma, linux-kernel
On Wed, Feb 09, 2022 at 02:23:00PM +0100, Håkon Bugge wrote:
> XRC INI QPs should be able to adjust their local ACK timeout.
>
> Fixes: 2c1619edef61 ("IB/cma: Define option to set ack timeout and pack tos_set")
> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
> Suggested-by: Avneesh Pant <avneesh.pant@oracle.com>
>
> ---
>
> To avoid excessive discussions around the *if (WARN_ON( ...*
> construct, just saying that it has been sanctioned by Jason here:
>
> https://lore.kernel.org/linux-rdma/20210413135120.GT7405@nvidia.com/
And I think that this is wrong, because it cane be triggered by user.
1. Create cm_id with any QP type you want - ucma_create_id()
2. Call to set option - ucma_set_option()
3. See WARN_ON.
Thanks
> ---
> drivers/infiniband/core/cma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
> index 0f5f0d7..006ea9c 100644
> --- a/drivers/infiniband/core/cma.c
> +++ b/drivers/infiniband/core/cma.c
> @@ -2811,7 +2811,7 @@ int rdma_set_ack_timeout(struct rdma_cm_id *id, u8 timeout)
> {
> struct rdma_id_private *id_priv;
>
> - if (id->qp_type != IB_QPT_RC)
> + if (WARN_ON(id->qp_type != IB_QPT_RC && id->qp_type != IB_QPT_XRC_INI))
> return -EINVAL;
>
> id_priv = container_of(id, struct rdma_id_private, id);
> --
> 1.8.3.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH for-rc] IB/cma: Allow XRG INI QPs to set their local ACK timeout
2022-02-09 15:04 ` Leon Romanovsky
@ 2022-02-09 15:25 ` Haakon Bugge
0 siblings, 0 replies; 3+ messages in thread
From: Haakon Bugge @ 2022-02-09 15:25 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Jason Gunthorpe, OFED mailing list, linux-kernel@vger.kernel.org
> On 9 Feb 2022, at 16:04, Leon Romanovsky <leon@kernel.org> wrote:
>
> On Wed, Feb 09, 2022 at 02:23:00PM +0100, Håkon Bugge wrote:
>> XRC INI QPs should be able to adjust their local ACK timeout.
>>
>> Fixes: 2c1619edef61 ("IB/cma: Define option to set ack timeout and pack tos_set")
>> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
>> Suggested-by: Avneesh Pant <avneesh.pant@oracle.com>
>>
>> ---
>>
>> To avoid excessive discussions around the *if (WARN_ON( ...*
>> construct, just saying that it has been sanctioned by Jason here:
>>
>> https://lore.kernel.org/linux-rdma/20210413135120.GT7405@nvidia.com/
>
> And I think that this is wrong, because it cane be triggered by user.
> 1. Create cm_id with any QP type you want - ucma_create_id()
> 2. Call to set option - ucma_set_option()
> 3. See WARN_ON.
Yes, this one is callable from user-space. Right. Will send a v2.
Thxs, Håkon
>
> Thanks
>
>> ---
>> drivers/infiniband/core/cma.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
>> index 0f5f0d7..006ea9c 100644
>> --- a/drivers/infiniband/core/cma.c
>> +++ b/drivers/infiniband/core/cma.c
>> @@ -2811,7 +2811,7 @@ int rdma_set_ack_timeout(struct rdma_cm_id *id, u8 timeout)
>> {
>> struct rdma_id_private *id_priv;
>>
>> - if (id->qp_type != IB_QPT_RC)
>> + if (WARN_ON(id->qp_type != IB_QPT_RC && id->qp_type != IB_QPT_XRC_INI))
>> return -EINVAL;
>>
>> id_priv = container_of(id, struct rdma_id_private, id);
>> --
>> 1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-09 15:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-09 13:23 [PATCH for-rc] IB/cma: Allow XRG INI QPs to set their local ACK timeout Håkon Bugge
2022-02-09 15:04 ` Leon Romanovsky
2022-02-09 15:25 ` Haakon Bugge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox