mbox series

[for-next,v3,0/2] Introduce rdma_set_min_rnr_timer() and use it in RDS

Message ID 1617216194-12890-1-git-send-email-haakon.bugge@oracle.com (mailing list archive)
Headers show
Series Introduce rdma_set_min_rnr_timer() and use it in RDS | expand

Message

Haakon Bugge March 31, 2021, 6:43 p.m. UTC
ib_modify_qp() is an expensive operation on some HCAs running
virtualized. This series removes two ib_modify_qp() calls from RDS.

I am sending this as a v3, even though it is the first sent to
net. This because the IB Core commit has reach v3.

Håkon Bugge (2):
  IB/cma: Introduce rdma_set_min_rnr_timer()
  rds: ib: Remove two ib_modify_qp() calls

 drivers/infiniband/core/cma.c      | 41 ++++++++++++++++++++++++++++++++++++++
 drivers/infiniband/core/cma_priv.h |  2 ++
 include/rdma/rdma_cm.h             |  2 ++
 net/rds/ib_cm.c                    | 35 +-------------------------------
 net/rds/rdma_transport.c           |  1 +
 5 files changed, 47 insertions(+), 34 deletions(-)

--
1.8.3.1

Comments

Santosh Shilimkar March 31, 2021, 7:54 p.m. UTC | #1
[...]

Thanks Haakon. Patchset looks fine by me.
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Jason Gunthorpe April 1, 2021, 5:51 p.m. UTC | #2
On Wed, Mar 31, 2021 at 07:54:17PM +0000, Santosh Shilimkar wrote:
> [...]
> 
> Thanks Haakon. Patchset looks fine by me.
> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

Jakub/Dave are you OK if I take this RDS patch rdma to rdma's tree?

Thanks,
Jason
Haakon Bugge April 7, 2021, 4:41 p.m. UTC | #3
> On 1 Apr 2021, at 19:51, Jason Gunthorpe <jgg@nvidia.com> wrote:
> 
> On Wed, Mar 31, 2021 at 07:54:17PM +0000, Santosh Shilimkar wrote:
>> [...]
>> 
>> Thanks Haakon. Patchset looks fine by me.
>> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
> 
> Jakub/Dave are you OK if I take this RDS patch rdma to rdma's tree?

Let me know if this is lingering due to Leon's comment about using WARN_ON() instead of error returns.


Håkon
Haakon Bugge April 12, 2021, 6:35 p.m. UTC | #4
> On 7 Apr 2021, at 18:41, Haakon Bugge <haakon.bugge@oracle.com> wrote:
> 
> 
> 
>> On 1 Apr 2021, at 19:51, Jason Gunthorpe <jgg@nvidia.com> wrote:
>> 
>> On Wed, Mar 31, 2021 at 07:54:17PM +0000, Santosh Shilimkar wrote:
>>> [...]
>>> 
>>> Thanks Haakon. Patchset looks fine by me.
>>> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
>> 
>> Jakub/Dave are you OK if I take this RDS patch rdma to rdma's tree?
> 
> Let me know if this is lingering due to Leon's comment about using WARN_ON() instead of error returns.

A gentle ping.

Håkon
Jason Gunthorpe April 12, 2021, 6:45 p.m. UTC | #5
On Mon, Apr 12, 2021 at 06:35:35PM +0000, Haakon Bugge wrote:
> 
> 
> > On 7 Apr 2021, at 18:41, Haakon Bugge <haakon.bugge@oracle.com> wrote:
> > 
> > 
> > 
> >> On 1 Apr 2021, at 19:51, Jason Gunthorpe <jgg@nvidia.com> wrote:
> >> 
> >> On Wed, Mar 31, 2021 at 07:54:17PM +0000, Santosh Shilimkar wrote:
> >>> [...]
> >>> 
> >>> Thanks Haakon. Patchset looks fine by me.
> >>> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
> >> 
> >> Jakub/Dave are you OK if I take this RDS patch rdma to rdma's tree?
> > 
> > Let me know if this is lingering due to Leon's comment about using WARN_ON() instead of error returns.
> 
> A gentle ping.

I will take it with Santos' ack.

Jason
Jason Gunthorpe April 12, 2021, 10:58 p.m. UTC | #6
On Wed, Mar 31, 2021 at 08:43:12PM +0200, Håkon Bugge wrote:
> ib_modify_qp() is an expensive operation on some HCAs running
> virtualized. This series removes two ib_modify_qp() calls from RDS.
> 
> I am sending this as a v3, even though it is the first sent to
> net. This because the IB Core commit has reach v3.
> 
> Håkon Bugge (2):
>   IB/cma: Introduce rdma_set_min_rnr_timer()
>   rds: ib: Remove two ib_modify_qp() calls

Applied to rdma for-next, thanks

Jason
Leon Romanovsky April 13, 2021, 6:29 a.m. UTC | #7
On Mon, Apr 12, 2021 at 07:58:47PM -0300, Jason Gunthorpe wrote:
> On Wed, Mar 31, 2021 at 08:43:12PM +0200, Håkon Bugge wrote:
> > ib_modify_qp() is an expensive operation on some HCAs running
> > virtualized. This series removes two ib_modify_qp() calls from RDS.
> > 
> > I am sending this as a v3, even though it is the first sent to
> > net. This because the IB Core commit has reach v3.
> > 
> > Håkon Bugge (2):
> >   IB/cma: Introduce rdma_set_min_rnr_timer()
> >   rds: ib: Remove two ib_modify_qp() calls
> 
> Applied to rdma for-next, thanks

Jason,

It should be 
+	WARN_ON(id->qp_type != IB_QPT_RC && id->qp_type != IB_QPT_XRC_TGT);

and not
+	if (WARN_ON(id->qp_type != IB_QPT_RC && id->qp_type != IB_QPT_XRC_TGT))
+		return -EINVAL;

Thanks

> 
> Jason
Haakon Bugge April 13, 2021, 11:13 a.m. UTC | #8
> On 13 Apr 2021, at 08:29, Leon Romanovsky <leon@kernel.org> wrote:
> 
> On Mon, Apr 12, 2021 at 07:58:47PM -0300, Jason Gunthorpe wrote:
>> On Wed, Mar 31, 2021 at 08:43:12PM +0200, Håkon Bugge wrote:
>>> ib_modify_qp() is an expensive operation on some HCAs running
>>> virtualized. This series removes two ib_modify_qp() calls from RDS.
>>> 
>>> I am sending this as a v3, even though it is the first sent to
>>> net. This because the IB Core commit has reach v3.
>>> 
>>> Håkon Bugge (2):
>>>  IB/cma: Introduce rdma_set_min_rnr_timer()
>>>  rds: ib: Remove two ib_modify_qp() calls
>> 
>> Applied to rdma for-next, thanks
> 
> Jason,
> 
> It should be 
> +	WARN_ON(id->qp_type != IB_QPT_RC && id->qp_type != IB_QPT_XRC_TGT);

With no return you will arm the setting of the timer and subsequently get an error from the modify_qp later.


Håkon

> 
> and not
> +	if (WARN_ON(id->qp_type != IB_QPT_RC && id->qp_type != IB_QPT_XRC_TGT))
> +		return -EINVAL;
> 
> Thanks
> 
>> 
>> Jason
Leon Romanovsky April 13, 2021, 11:37 a.m. UTC | #9
On Tue, Apr 13, 2021 at 11:13:38AM +0000, Haakon Bugge wrote:
> 
> 
> > On 13 Apr 2021, at 08:29, Leon Romanovsky <leon@kernel.org> wrote:
> > 
> > On Mon, Apr 12, 2021 at 07:58:47PM -0300, Jason Gunthorpe wrote:
> >> On Wed, Mar 31, 2021 at 08:43:12PM +0200, Håkon Bugge wrote:
> >>> ib_modify_qp() is an expensive operation on some HCAs running
> >>> virtualized. This series removes two ib_modify_qp() calls from RDS.
> >>> 
> >>> I am sending this as a v3, even though it is the first sent to
> >>> net. This because the IB Core commit has reach v3.
> >>> 
> >>> Håkon Bugge (2):
> >>>  IB/cma: Introduce rdma_set_min_rnr_timer()
> >>>  rds: ib: Remove two ib_modify_qp() calls
> >> 
> >> Applied to rdma for-next, thanks
> > 
> > Jason,
> > 
> > It should be 
> > +	WARN_ON(id->qp_type != IB_QPT_RC && id->qp_type != IB_QPT_XRC_TGT);
> 
> With no return you will arm the setting of the timer and subsequently get an error from the modify_qp later.

The addition of WARN_ON() means that this is programmer error to get
such input. Historically, in-kernel API doesn't need to have protection
from other kernel developers.

Thanks

> 
> 
> Håkon
> 
> > 
> > and not
> > +	if (WARN_ON(id->qp_type != IB_QPT_RC && id->qp_type != IB_QPT_XRC_TGT))
> > +		return -EINVAL;
> > 
> > Thanks
> > 
> >> 
> >> Jason
>
Jason Gunthorpe April 13, 2021, 1:51 p.m. UTC | #10
On Tue, Apr 13, 2021 at 09:29:41AM +0300, Leon Romanovsky wrote:
> On Mon, Apr 12, 2021 at 07:58:47PM -0300, Jason Gunthorpe wrote:
> > On Wed, Mar 31, 2021 at 08:43:12PM +0200, Håkon Bugge wrote:
> > > ib_modify_qp() is an expensive operation on some HCAs running
> > > virtualized. This series removes two ib_modify_qp() calls from RDS.
> > > 
> > > I am sending this as a v3, even though it is the first sent to
> > > net. This because the IB Core commit has reach v3.
> > > 
> > > Håkon Bugge (2):
> > >   IB/cma: Introduce rdma_set_min_rnr_timer()
> > >   rds: ib: Remove two ib_modify_qp() calls
> > 
> > Applied to rdma for-next, thanks
> 
> Jason,
> 
> It should be 
> +	WARN_ON(id->qp_type != IB_QPT_RC && id->qp_type != IB_QPT_XRC_TGT);
> 
> and not
> +	if (WARN_ON(id->qp_type != IB_QPT_RC && id->qp_type != IB_QPT_XRC_TGT))
> +		return -EINVAL;

Unless we can completely remove the return code the if statement is a
reasonable way to use the WARN_ON here

Jason