All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] RDMA/irdma: do some cleanups
@ 2021-07-14  3:11 yanjun.zhu
  2021-07-14  3:11 ` [PATCH 1/3] RDMA/irdma: change the returned type of irdma_sc_repost_aeq_entries to void yanjun.zhu
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: yanjun.zhu @ 2021-07-14  3:11 UTC (permalink / raw)
  To: zyjzyj2000, yanjun.zhu, mustafa.ismail, shiraz.saleem, dledford,
	jgg, linux-rdma, yanjun.zhu, leon

From: Zhu Yanjun <yanjun.zhu@linux.dev>

Since the functions irdma_sc_repost_aeq_entries, irdma_set_hw_rsrc and
irdma_setup_virt_qp always return 0, remove the returned value check
and change the returned type to void.

Zhu Yanjun (3):
  RDMA/irdma: change the returned type of irdma_sc_repost_aeq_entries to
    void
  RDMA/irdma: change the returned type of irdma_set_hw_rsrc to void
  RDMA/irdma: change returned type of irdma_setup_virt_qp to void

 drivers/infiniband/hw/irdma/ctrl.c  |  4 +---
 drivers/infiniband/hw/irdma/hw.c    | 11 ++---------
 drivers/infiniband/hw/irdma/type.h  |  3 +--
 drivers/infiniband/hw/irdma/verbs.c |  6 ++----
 4 files changed, 6 insertions(+), 18 deletions(-)

-- 
2.27.0


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

* [PATCH 1/3] RDMA/irdma: change the returned type of irdma_sc_repost_aeq_entries to void
  2021-07-14  3:11 [PATCH 0/3] RDMA/irdma: do some cleanups yanjun.zhu
@ 2021-07-14  3:11 ` yanjun.zhu
  2021-07-14  9:14   ` Leon Romanovsky
  2021-07-14  3:11 ` [PATCH 2/3] RDMA/irdma: change the returned type of irdma_set_hw_rsrc " yanjun.zhu
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: yanjun.zhu @ 2021-07-14  3:11 UTC (permalink / raw)
  To: zyjzyj2000, yanjun.zhu, mustafa.ismail, shiraz.saleem, dledford,
	jgg, linux-rdma, yanjun.zhu, leon

From: Zhu Yanjun <yanjun.zhu@linux.dev>

The function irdma_sc_repost_aeq_entries always returns zero. So
the returned type is changed to void.

Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
---
 drivers/infiniband/hw/irdma/ctrl.c | 4 +---
 drivers/infiniband/hw/irdma/type.h | 3 +--
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/irdma/ctrl.c b/drivers/infiniband/hw/irdma/ctrl.c
index b1023a7d0bd1..777e35620635 100644
--- a/drivers/infiniband/hw/irdma/ctrl.c
+++ b/drivers/infiniband/hw/irdma/ctrl.c
@@ -4187,11 +4187,9 @@ enum irdma_status_code irdma_sc_get_next_aeqe(struct irdma_sc_aeq *aeq,
  * @dev: sc device struct
  * @count: allocate count
  */
-enum irdma_status_code irdma_sc_repost_aeq_entries(struct irdma_sc_dev *dev, u32 count)
+void irdma_sc_repost_aeq_entries(struct irdma_sc_dev *dev, u32 count)
 {
 	writel(count, dev->hw_regs[IRDMA_AEQALLOC]);
-
-	return 0;
 }
 
 /**
diff --git a/drivers/infiniband/hw/irdma/type.h b/drivers/infiniband/hw/irdma/type.h
index 7387b83e826d..874bc25a938b 100644
--- a/drivers/infiniband/hw/irdma/type.h
+++ b/drivers/infiniband/hw/irdma/type.h
@@ -1222,8 +1222,7 @@ enum irdma_status_code irdma_sc_aeq_init(struct irdma_sc_aeq *aeq,
 					 struct irdma_aeq_init_info *info);
 enum irdma_status_code irdma_sc_get_next_aeqe(struct irdma_sc_aeq *aeq,
 					      struct irdma_aeqe_info *info);
-enum irdma_status_code irdma_sc_repost_aeq_entries(struct irdma_sc_dev *dev,
-						   u32 count);
+void irdma_sc_repost_aeq_entries(struct irdma_sc_dev *dev, u32 count);
 
 void irdma_sc_pd_init(struct irdma_sc_dev *dev, struct irdma_sc_pd *pd, u32 pd_id,
 		      int abi_ver);
-- 
2.27.0


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

* [PATCH 2/3] RDMA/irdma: change the returned type of irdma_set_hw_rsrc to void
  2021-07-14  3:11 [PATCH 0/3] RDMA/irdma: do some cleanups yanjun.zhu
  2021-07-14  3:11 ` [PATCH 1/3] RDMA/irdma: change the returned type of irdma_sc_repost_aeq_entries to void yanjun.zhu
@ 2021-07-14  3:11 ` yanjun.zhu
  2021-07-14  3:11 ` [PATCH 3/3] RDMA/irdma: change returned type of irdma_setup_virt_qp " yanjun.zhu
  2021-07-15 18:19 ` [PATCH 0/3] RDMA/irdma: do some cleanups Jason Gunthorpe
  3 siblings, 0 replies; 8+ messages in thread
From: yanjun.zhu @ 2021-07-14  3:11 UTC (permalink / raw)
  To: zyjzyj2000, yanjun.zhu, mustafa.ismail, shiraz.saleem, dledford,
	jgg, linux-rdma, yanjun.zhu, leon

From: Zhu Yanjun <yanjun.zhu@linux.dev>

Since the function irdma_set_hw_rsrc always returns zero, change
the returned type to void and remove all the related source code.

Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
---
 drivers/infiniband/hw/irdma/hw.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/hw/irdma/hw.c b/drivers/infiniband/hw/irdma/hw.c
index 7afb8a6a0526..00de5ee9a260 100644
--- a/drivers/infiniband/hw/irdma/hw.c
+++ b/drivers/infiniband/hw/irdma/hw.c
@@ -1920,7 +1920,7 @@ enum irdma_status_code irdma_ctrl_init_hw(struct irdma_pci_f *rf)
  * irdma_set_hw_rsrc - set hw memory resources.
  * @rf: RDMA PCI function
  */
-static u32 irdma_set_hw_rsrc(struct irdma_pci_f *rf)
+static void irdma_set_hw_rsrc(struct irdma_pci_f *rf)
 {
 	rf->allocated_qps = (void *)(rf->mem_rsrc +
 		   (sizeof(struct irdma_arp_entry) * rf->arp_table_size));
@@ -1937,8 +1937,6 @@ static u32 irdma_set_hw_rsrc(struct irdma_pci_f *rf)
 	spin_lock_init(&rf->arp_lock);
 	spin_lock_init(&rf->qptable_lock);
 	spin_lock_init(&rf->qh_list_lock);
-
-	return 0;
 }
 
 /**
@@ -2000,9 +1998,7 @@ u32 irdma_initialize_hw_rsrc(struct irdma_pci_f *rf)
 
 	rf->arp_table = (struct irdma_arp_entry *)rf->mem_rsrc;
 
-	ret = irdma_set_hw_rsrc(rf);
-	if (ret)
-		goto set_hw_rsrc_fail;
+	irdma_set_hw_rsrc(rf);
 
 	set_bit(0, rf->allocated_mrs);
 	set_bit(0, rf->allocated_qps);
@@ -2025,9 +2021,6 @@ u32 irdma_initialize_hw_rsrc(struct irdma_pci_f *rf)
 
 	return 0;
 
-set_hw_rsrc_fail:
-	kfree(rf->mem_rsrc);
-	rf->mem_rsrc = NULL;
 mem_rsrc_kzalloc_fail:
 	kfree(rf->allocated_ws_nodes);
 	rf->allocated_ws_nodes = NULL;
-- 
2.27.0


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

* [PATCH 3/3] RDMA/irdma: change returned type of irdma_setup_virt_qp to void
  2021-07-14  3:11 [PATCH 0/3] RDMA/irdma: do some cleanups yanjun.zhu
  2021-07-14  3:11 ` [PATCH 1/3] RDMA/irdma: change the returned type of irdma_sc_repost_aeq_entries to void yanjun.zhu
  2021-07-14  3:11 ` [PATCH 2/3] RDMA/irdma: change the returned type of irdma_set_hw_rsrc " yanjun.zhu
@ 2021-07-14  3:11 ` yanjun.zhu
  2021-07-15 18:19 ` [PATCH 0/3] RDMA/irdma: do some cleanups Jason Gunthorpe
  3 siblings, 0 replies; 8+ messages in thread
From: yanjun.zhu @ 2021-07-14  3:11 UTC (permalink / raw)
  To: zyjzyj2000, yanjun.zhu, mustafa.ismail, shiraz.saleem, dledford,
	jgg, linux-rdma, yanjun.zhu, leon

From: Zhu Yanjun <yanjun.zhu@linux.dev>

Since the returned value of the function irdma_setup_virt_qp is always 0,
remove the returned value check and change the returned type to void.

Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
---
 drivers/infiniband/hw/irdma/verbs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index 9712f6902ba8..717147ed0519 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -557,7 +557,7 @@ static int irdma_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata)
  * @iwqp: qp ptr
  * @init_info: initialize info to return
  */
-static int irdma_setup_virt_qp(struct irdma_device *iwdev,
+static void irdma_setup_virt_qp(struct irdma_device *iwdev,
 			       struct irdma_qp *iwqp,
 			       struct irdma_qp_init_info *init_info)
 {
@@ -574,8 +574,6 @@ static int irdma_setup_virt_qp(struct irdma_device *iwdev,
 		init_info->sq_pa = qpmr->sq_pbl.addr;
 		init_info->rq_pa = qpmr->rq_pbl.addr;
 	}
-
-	return 0;
 }
 
 /**
@@ -914,7 +912,7 @@ static struct ib_qp *irdma_create_qp(struct ib_pd *ibpd,
 			}
 		}
 		init_info.qp_uk_init_info.abi_ver = iwpd->sc_pd.abi_ver;
-		err_code = irdma_setup_virt_qp(iwdev, iwqp, &init_info);
+		irdma_setup_virt_qp(iwdev, iwqp, &init_info);
 	} else {
 		init_info.qp_uk_init_info.abi_ver = IRDMA_ABI_VER;
 		err_code = irdma_setup_kmode_qp(iwdev, iwqp, &init_info, init_attr);
-- 
2.27.0


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

* Re: [PATCH 1/3] RDMA/irdma: change the returned type of irdma_sc_repost_aeq_entries to void
  2021-07-14  3:11 ` [PATCH 1/3] RDMA/irdma: change the returned type of irdma_sc_repost_aeq_entries to void yanjun.zhu
@ 2021-07-14  9:14   ` Leon Romanovsky
  2021-07-14  9:23     ` Zhu Yanjun
  0 siblings, 1 reply; 8+ messages in thread
From: Leon Romanovsky @ 2021-07-14  9:14 UTC (permalink / raw)
  To: shiraz.saleem
  Cc: zyjzyj2000, yanjun.zhu, mustafa.ismail, dledford, jgg,
	linux-rdma, yanjun.zhu, Jakub Kicinski, linux-netdev

On Tue, Jul 13, 2021 at 11:11:28PM -0400, yanjun.zhu@linux.dev wrote:
> From: Zhu Yanjun <yanjun.zhu@linux.dev>
> 
> The function irdma_sc_repost_aeq_entries always returns zero. So
> the returned type is changed to void.
> 
> Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
> ---
>  drivers/infiniband/hw/irdma/ctrl.c | 4 +---
>  drivers/infiniband/hw/irdma/type.h | 3 +--
>  2 files changed, 2 insertions(+), 5 deletions(-)

<...>

> -enum irdma_status_code irdma_sc_repost_aeq_entries(struct irdma_sc_dev *dev,
> -						   u32 count);

I clearly remember that Jakub asked for more than once to remo remove
custom ice/irdma error codes. Did it happen? Can we get rid from them
in RDMA too?

Thanks

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

* Re: [PATCH 1/3] RDMA/irdma: change the returned type of irdma_sc_repost_aeq_entries to void
  2021-07-14  9:14   ` Leon Romanovsky
@ 2021-07-14  9:23     ` Zhu Yanjun
  2021-07-18  9:27       ` Leon Romanovsky
  0 siblings, 1 reply; 8+ messages in thread
From: Zhu Yanjun @ 2021-07-14  9:23 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Shiraz Saleem, Zhu Yanjun, mustafa.ismail, Doug Ledford,
	Jason Gunthorpe, RDMA mailing list, yanjun.zhu, Jakub Kicinski,
	linux-netdev

On Wed, Jul 14, 2021 at 5:15 PM Leon Romanovsky <leon@kernel.org> wrote:
>
> On Tue, Jul 13, 2021 at 11:11:28PM -0400, yanjun.zhu@linux.dev wrote:
> > From: Zhu Yanjun <yanjun.zhu@linux.dev>
> >
> > The function irdma_sc_repost_aeq_entries always returns zero. So
> > the returned type is changed to void.
> >
> > Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
> > ---
> >  drivers/infiniband/hw/irdma/ctrl.c | 4 +---
> >  drivers/infiniband/hw/irdma/type.h | 3 +--
> >  2 files changed, 2 insertions(+), 5 deletions(-)
>
> <...>
>
> > -enum irdma_status_code irdma_sc_repost_aeq_entries(struct irdma_sc_dev *dev,
> > -                                                u32 count);
>
> I clearly remember that Jakub asked for more than once to remo remove
> custom ice/irdma error codes. Did it happen? Can we get rid from them
> in RDMA too?

No. This is not related with custom ice/irdma error codes.

This is related with the returned type of the function.
If a function always returns 0, change the function returned type to void.
And remove the related returned value check.

Zhu Yanjun

>
> Thanks

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

* Re: [PATCH 0/3] RDMA/irdma: do some cleanups
  2021-07-14  3:11 [PATCH 0/3] RDMA/irdma: do some cleanups yanjun.zhu
                   ` (2 preceding siblings ...)
  2021-07-14  3:11 ` [PATCH 3/3] RDMA/irdma: change returned type of irdma_setup_virt_qp " yanjun.zhu
@ 2021-07-15 18:19 ` Jason Gunthorpe
  3 siblings, 0 replies; 8+ messages in thread
From: Jason Gunthorpe @ 2021-07-15 18:19 UTC (permalink / raw)
  To: yanjun.zhu
  Cc: zyjzyj2000, yanjun.zhu, mustafa.ismail, shiraz.saleem, dledford,
	linux-rdma, leon

On Tue, Jul 13, 2021 at 11:11:27PM -0400, yanjun.zhu@linux.dev wrote:
> From: Zhu Yanjun <yanjun.zhu@linux.dev>
> 
> Since the functions irdma_sc_repost_aeq_entries, irdma_set_hw_rsrc and
> irdma_setup_virt_qp always return 0, remove the returned value check
> and change the returned type to void.
> 
> Zhu Yanjun (3):
>   RDMA/irdma: change the returned type of irdma_sc_repost_aeq_entries to
>     void
>   RDMA/irdma: change the returned type of irdma_set_hw_rsrc to void
>   RDMA/irdma: change returned type of irdma_setup_virt_qp to void

Applied to for-next, thanks

Jason

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

* Re: [PATCH 1/3] RDMA/irdma: change the returned type of irdma_sc_repost_aeq_entries to void
  2021-07-14  9:23     ` Zhu Yanjun
@ 2021-07-18  9:27       ` Leon Romanovsky
  0 siblings, 0 replies; 8+ messages in thread
From: Leon Romanovsky @ 2021-07-18  9:27 UTC (permalink / raw)
  To: Zhu Yanjun
  Cc: Shiraz Saleem, Zhu Yanjun, mustafa.ismail, Doug Ledford,
	Jason Gunthorpe, RDMA mailing list, yanjun.zhu, Jakub Kicinski,
	linux-netdev

On Wed, Jul 14, 2021 at 05:23:33PM +0800, Zhu Yanjun wrote:
> On Wed, Jul 14, 2021 at 5:15 PM Leon Romanovsky <leon@kernel.org> wrote:
> >
> > On Tue, Jul 13, 2021 at 11:11:28PM -0400, yanjun.zhu@linux.dev wrote:
> > > From: Zhu Yanjun <yanjun.zhu@linux.dev>
> > >
> > > The function irdma_sc_repost_aeq_entries always returns zero. So
> > > the returned type is changed to void.
> > >
> > > Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
> > > ---
> > >  drivers/infiniband/hw/irdma/ctrl.c | 4 +---
> > >  drivers/infiniband/hw/irdma/type.h | 3 +--
> > >  2 files changed, 2 insertions(+), 5 deletions(-)
> >
> > <...>
> >
> > > -enum irdma_status_code irdma_sc_repost_aeq_entries(struct irdma_sc_dev *dev,
> > > -                                                u32 count);
> >
> > I clearly remember that Jakub asked for more than once to remo remove
> > custom ice/irdma error codes. Did it happen? Can we get rid from them
> > in RDMA too?
> 
> No. This is not related with custom ice/irdma error codes.

I'm not talking about your specific change, but pointed to the fact that
custom error codes are not cleaned despite multiple requests.

Thanks

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

end of thread, other threads:[~2021-07-18  9:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-14  3:11 [PATCH 0/3] RDMA/irdma: do some cleanups yanjun.zhu
2021-07-14  3:11 ` [PATCH 1/3] RDMA/irdma: change the returned type of irdma_sc_repost_aeq_entries to void yanjun.zhu
2021-07-14  9:14   ` Leon Romanovsky
2021-07-14  9:23     ` Zhu Yanjun
2021-07-18  9:27       ` Leon Romanovsky
2021-07-14  3:11 ` [PATCH 2/3] RDMA/irdma: change the returned type of irdma_set_hw_rsrc " yanjun.zhu
2021-07-14  3:11 ` [PATCH 3/3] RDMA/irdma: change returned type of irdma_setup_virt_qp " yanjun.zhu
2021-07-15 18:19 ` [PATCH 0/3] RDMA/irdma: do some cleanups Jason Gunthorpe

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.