All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next v2] RDMA/cma: Remove unnecessary INIT->INIT transition
@ 2021-06-18  6:07 Håkon Bugge
  2021-06-23  5:32 ` Leon Romanovsky
  0 siblings, 1 reply; 4+ messages in thread
From: Håkon Bugge @ 2021-06-18  6:07 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe, Leon Romanovsky; +Cc: linux-rdma

In rdma_create_qp(), a connected QP will be transitioned to the INIT
state.

Afterwards, the QP will be transitioned to the RTR state by the
cma_modify_qp_rtr() function. But this function starts by performing
an ib_modify_qp() to the INIT state again, before another
ib_modify_qp() is performed to transition the QP to the RTR state.

Hence, there is no need to transition the QP to the INIT state in
rdma_create_qp().

Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>

---

	v1 -> v2:
	   * Fixed uninitialized ret variable as:
	     Reported-by: kernel test robot <lkp@intel.com>
---
 drivers/infiniband/core/cma.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 2b9ffc2..20c155c 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -925,25 +925,12 @@ static int cma_init_ud_qp(struct rdma_id_private *id_priv, struct ib_qp *qp)
 	return ret;
 }
 
-static int cma_init_conn_qp(struct rdma_id_private *id_priv, struct ib_qp *qp)
-{
-	struct ib_qp_attr qp_attr;
-	int qp_attr_mask, ret;
-
-	qp_attr.qp_state = IB_QPS_INIT;
-	ret = rdma_init_qp_attr(&id_priv->id, &qp_attr, &qp_attr_mask);
-	if (ret)
-		return ret;
-
-	return ib_modify_qp(qp, &qp_attr, qp_attr_mask);
-}
-
 int rdma_create_qp(struct rdma_cm_id *id, struct ib_pd *pd,
 		   struct ib_qp_init_attr *qp_init_attr)
 {
 	struct rdma_id_private *id_priv;
 	struct ib_qp *qp;
-	int ret;
+	int ret = 0;
 
 	id_priv = container_of(id, struct rdma_id_private, id);
 	if (id->device != pd->device) {
@@ -960,8 +947,6 @@ int rdma_create_qp(struct rdma_cm_id *id, struct ib_pd *pd,
 
 	if (id->qp_type == IB_QPT_UD)
 		ret = cma_init_ud_qp(id_priv, qp);
-	else
-		ret = cma_init_conn_qp(id_priv, qp);
 	if (ret)
 		goto out_destroy;
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH for-next v2] RDMA/cma: Remove unnecessary INIT->INIT transition
  2021-06-18  6:07 [PATCH for-next v2] RDMA/cma: Remove unnecessary INIT->INIT transition Håkon Bugge
@ 2021-06-23  5:32 ` Leon Romanovsky
  2021-06-23  5:43   ` Leon Romanovsky
  0 siblings, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2021-06-23  5:32 UTC (permalink / raw)
  To: Håkon Bugge; +Cc: Doug Ledford, Jason Gunthorpe, linux-rdma

On Fri, Jun 18, 2021 at 08:07:55AM +0200, Håkon Bugge wrote:
> In rdma_create_qp(), a connected QP will be transitioned to the INIT
> state.
> 
> Afterwards, the QP will be transitioned to the RTR state by the
> cma_modify_qp_rtr() function. But this function starts by performing
> an ib_modify_qp() to the INIT state again, before another
> ib_modify_qp() is performed to transition the QP to the RTR state.
> 
> Hence, there is no need to transition the QP to the INIT state in
> rdma_create_qp().
> 
> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
> 
> ---
> 
> 	v1 -> v2:
> 	   * Fixed uninitialized ret variable as:
> 	     Reported-by: kernel test robot <lkp@intel.com>
> ---
>  drivers/infiniband/core/cma.c | 17 +----------------
>  1 file changed, 1 insertion(+), 16 deletions(-)
> 

I reviewed v1, let's add this tag to v2 too.

Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH for-next v2] RDMA/cma: Remove unnecessary INIT->INIT transition
  2021-06-23  5:32 ` Leon Romanovsky
@ 2021-06-23  5:43   ` Leon Romanovsky
  2021-06-23 13:28     ` Haakon Bugge
  0 siblings, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2021-06-23  5:43 UTC (permalink / raw)
  To: Håkon Bugge; +Cc: Doug Ledford, Jason Gunthorpe, linux-rdma

On Wed, Jun 23, 2021 at 08:32:59AM +0300, Leon Romanovsky wrote:
> On Fri, Jun 18, 2021 at 08:07:55AM +0200, Håkon Bugge wrote:
> > In rdma_create_qp(), a connected QP will be transitioned to the INIT
> > state.
> > 
> > Afterwards, the QP will be transitioned to the RTR state by the
> > cma_modify_qp_rtr() function. But this function starts by performing
> > an ib_modify_qp() to the INIT state again, before another
> > ib_modify_qp() is performed to transition the QP to the RTR state.
> > 
> > Hence, there is no need to transition the QP to the INIT state in
> > rdma_create_qp().
> > 
> > Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
> > 
> > ---
> > 
> > 	v1 -> v2:
> > 	   * Fixed uninitialized ret variable as:
> > 	     Reported-by: kernel test robot <lkp@intel.com>
> > ---
> >  drivers/infiniband/core/cma.c | 17 +----------------
> >  1 file changed, 1 insertion(+), 16 deletions(-)
> > 
> 
> I reviewed v1, let's add this tag to v2 too.
> 
> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

Ahh, you sent this patch as part of other series with same version :(.

Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH for-next v2] RDMA/cma: Remove unnecessary INIT->INIT transition
  2021-06-23  5:43   ` Leon Romanovsky
@ 2021-06-23 13:28     ` Haakon Bugge
  0 siblings, 0 replies; 4+ messages in thread
From: Haakon Bugge @ 2021-06-23 13:28 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: Doug Ledford, Jason Gunthorpe, OFED mailing list



> On 23 Jun 2021, at 07:43, Leon Romanovsky <leon@kernel.org> wrote:
> 
> On Wed, Jun 23, 2021 at 08:32:59AM +0300, Leon Romanovsky wrote:
>> On Fri, Jun 18, 2021 at 08:07:55AM +0200, Håkon Bugge wrote:
>>> In rdma_create_qp(), a connected QP will be transitioned to the INIT
>>> state.
>>> 
>>> Afterwards, the QP will be transitioned to the RTR state by the
>>> cma_modify_qp_rtr() function. But this function starts by performing
>>> an ib_modify_qp() to the INIT state again, before another
>>> ib_modify_qp() is performed to transition the QP to the RTR state.
>>> 
>>> Hence, there is no need to transition the QP to the INIT state in
>>> rdma_create_qp().
>>> 
>>> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
>>> 
>>> ---
>>> 
>>> 	v1 -> v2:
>>> 	   * Fixed uninitialized ret variable as:
>>> 	     Reported-by: kernel test robot <lkp@intel.com>
>>> ---
>>> drivers/infiniband/core/cma.c | 17 +----------------
>>> 1 file changed, 1 insertion(+), 16 deletions(-)
>>> 
>> 
>> I reviewed v1, let's add this tag to v2 too.
>> 
>> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
> 
> Ahh, you sent this patch as part of other series with same version :(.

Oops, yes. Sorry for the confusion ;-)

Håkon

> 
> Thanks


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-23 13:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18  6:07 [PATCH for-next v2] RDMA/cma: Remove unnecessary INIT->INIT transition Håkon Bugge
2021-06-23  5:32 ` Leon Romanovsky
2021-06-23  5:43   ` Leon Romanovsky
2021-06-23 13:28     ` Haakon Bugge

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.