linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] RDMA: use true,false for bool variable
@ 2019-12-24  8:40 zhengbin
  2019-12-24  8:40 ` [PATCH 1/5] RDMA/siw: " zhengbin
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: zhengbin @ 2019-12-24  8:40 UTC (permalink / raw)
  To: bmt, dledford, jgg, linux-rdma; +Cc: zhengbin13

zhengbin (5):
  RDMA/siw: use true,false for bool variable
  IB/hfi1: use true,false for bool variable
  IB/iser: use true,false for bool variable
  RDMA/mlx4: use true,false for bool variable
  RDMA/mlx5: use true,false for bool variable

 drivers/infiniband/hw/hfi1/rc.c           | 2 +-
 drivers/infiniband/hw/mlx4/qp.c           | 4 ++--
 drivers/infiniband/hw/mlx5/mr.c           | 4 ++--
 drivers/infiniband/hw/mlx5/qp.c           | 2 +-
 drivers/infiniband/sw/siw/siw_cm.c        | 2 +-
 drivers/infiniband/ulp/iser/iser_memory.c | 2 +-
 drivers/infiniband/ulp/iser/iser_verbs.c  | 2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

--
2.7.4


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

* [PATCH 1/5] RDMA/siw: use true,false for bool variable
  2019-12-24  8:40 [PATCH 0/5] RDMA: use true,false for bool variable zhengbin
@ 2019-12-24  8:40 ` zhengbin
  2019-12-24  9:50   ` Leon Romanovsky
  2019-12-24  8:40 ` [PATCH 2/5] IB/hfi1: " zhengbin
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: zhengbin @ 2019-12-24  8:40 UTC (permalink / raw)
  To: bmt, dledford, jgg, linux-rdma; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/infiniband/sw/siw/siw_cm.c:32:18-41: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/infiniband/sw/siw/siw_cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c
index 3bccfef4..0c3f058 100644
--- a/drivers/infiniband/sw/siw/siw_cm.c
+++ b/drivers/infiniband/sw/siw/siw_cm.c
@@ -29,7 +29,7 @@
  * MPA_V2_RDMA_NO_RTR, MPA_V2_RDMA_READ_RTR, MPA_V2_RDMA_WRITE_RTR
  */
 static __be16 rtr_type = MPA_V2_RDMA_READ_RTR | MPA_V2_RDMA_WRITE_RTR;
-static const bool relaxed_ird_negotiation = 1;
+static const bool relaxed_ird_negotiation = true;

 static void siw_cm_llp_state_change(struct sock *s);
 static void siw_cm_llp_data_ready(struct sock *s);
--
2.7.4


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

* [PATCH 2/5] IB/hfi1: use true,false for bool variable
  2019-12-24  8:40 [PATCH 0/5] RDMA: use true,false for bool variable zhengbin
  2019-12-24  8:40 ` [PATCH 1/5] RDMA/siw: " zhengbin
@ 2019-12-24  8:40 ` zhengbin
  2019-12-24  9:48   ` Leon Romanovsky
  2019-12-24  8:40 ` [PATCH 3/5] IB/iser: " zhengbin
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: zhengbin @ 2019-12-24  8:40 UTC (permalink / raw)
  To: bmt, dledford, jgg, linux-rdma; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/infiniband/hw/hfi1/rc.c:2602:1-8: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/infiniband/hw/hfi1/rc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c
index 1a3c647..f1734e5 100644
--- a/drivers/infiniband/hw/hfi1/rc.c
+++ b/drivers/infiniband/hw/hfi1/rc.c
@@ -2599,7 +2599,7 @@ static noinline int rc_rcv_error(struct ib_other_headers *ohdr, void *data,
 	 * to be sent before sending this one.
 	 */
 	e = NULL;
-	old_req = 1;
+	old_req = true;
 	ibp->rvp.n_rc_dupreq++;

 	spin_lock_irqsave(&qp->s_lock, flags);
--
2.7.4


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

* [PATCH 3/5] IB/iser: use true,false for bool variable
  2019-12-24  8:40 [PATCH 0/5] RDMA: use true,false for bool variable zhengbin
  2019-12-24  8:40 ` [PATCH 1/5] RDMA/siw: " zhengbin
  2019-12-24  8:40 ` [PATCH 2/5] IB/hfi1: " zhengbin
@ 2019-12-24  8:40 ` zhengbin
  2019-12-24  8:40 ` [PATCH 4/5] RDMA/mlx4: " zhengbin
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: zhengbin @ 2019-12-24  8:40 UTC (permalink / raw)
  To: bmt, dledford, jgg, linux-rdma; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/infiniband/ulp/iser/iser_memory.c:530:2-21: WARNING: Assignment of 0/1 to bool variable
drivers/infiniband/ulp/iser/iser_verbs.c:1096:2-21: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/infiniband/ulp/iser/iser_memory.c | 2 +-
 drivers/infiniband/ulp/iser/iser_verbs.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index 0f74dc6..7a8f24d 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -527,7 +527,7 @@ int iser_reg_rdma_mem(struct iscsi_iser_task *task,
 		if (unlikely(err))
 			goto err_reg;

-		desc->sig_protected = 1;
+		desc->sig_protected = true;
 	}

 	return 0;
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index 1f4a37a..127887c 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -1093,7 +1093,7 @@ u8 iser_check_task_pi_status(struct iscsi_iser_task *iser_task,
 	int ret;

 	if (desc && desc->sig_protected) {
-		desc->sig_protected = 0;
+		desc->sig_protected = false;
 		ret = ib_check_mr_status(desc->rsc.sig_mr,
 					 IB_MR_CHECK_SIG_STATUS, &mr_status);
 		if (ret) {
--
2.7.4


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

* [PATCH 4/5] RDMA/mlx4: use true,false for bool variable
  2019-12-24  8:40 [PATCH 0/5] RDMA: use true,false for bool variable zhengbin
                   ` (2 preceding siblings ...)
  2019-12-24  8:40 ` [PATCH 3/5] IB/iser: " zhengbin
@ 2019-12-24  8:40 ` zhengbin
  2019-12-24  9:48   ` Leon Romanovsky
  2019-12-24  8:40 ` [PATCH 5/5] RDMA/mlx5: " zhengbin
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: zhengbin @ 2019-12-24  8:40 UTC (permalink / raw)
  To: bmt, dledford, jgg, linux-rdma; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/infiniband/hw/mlx4/qp.c:852:2-14: WARNING: Assignment of 0/1 to bool variable
drivers/infiniband/hw/mlx4/qp.c:3087:3-10: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/infiniband/hw/mlx4/qp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 85f57b7..8d240bc 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -849,7 +849,7 @@ static void mlx4_ib_release_wqn(struct mlx4_ib_ucontext *context,
 	 * reused for further WQN allocations.
 	 * The next created WQ will allocate a new range.
 	 */
-		range->dirty = 1;
+		range->dirty = true;
 	}

 	mutex_unlock(&context->wqn_ranges_mutex);
@@ -3084,7 +3084,7 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, const struct ib_ud_wr *wr,
 		}
 		if (ah->av.eth.vlan != cpu_to_be16(0xffff)) {
 			vlan = be16_to_cpu(ah->av.eth.vlan) & 0x0fff;
-			is_vlan = 1;
+			is_vlan = true;
 		}
 	}
 	err = ib_ud_header_init(send_size, !is_eth, is_eth, is_vlan, is_grh,
--
2.7.4


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

* [PATCH 5/5] RDMA/mlx5: use true,false for bool variable
  2019-12-24  8:40 [PATCH 0/5] RDMA: use true,false for bool variable zhengbin
                   ` (3 preceding siblings ...)
  2019-12-24  8:40 ` [PATCH 4/5] RDMA/mlx4: " zhengbin
@ 2019-12-24  8:40 ` zhengbin
  2019-12-24  9:48   ` Leon Romanovsky
  2020-01-03 23:15 ` [PATCH 0/5] RDMA: " Jason Gunthorpe
  2020-01-04 17:25 ` Bernard Metzler
  6 siblings, 1 reply; 12+ messages in thread
From: zhengbin @ 2019-12-24  8:40 UTC (permalink / raw)
  To: bmt, dledford, jgg, linux-rdma; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/infiniband/hw/mlx5/mr.c:150:2-26: WARNING: Assignment of 0/1 to bool variable
drivers/infiniband/hw/mlx5/mr.c:1455:2-26: WARNING: Assignment of 0/1 to bool variable
drivers/infiniband/hw/mlx5/qp.c:1874:6-20: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/infiniband/hw/mlx5/mr.c | 4 ++--
 drivers/infiniband/hw/mlx5/qp.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index ea8bfc3..3f6c177 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -147,7 +147,7 @@ static int add_keys(struct mlx5_ib_dev *dev, int c, int num)
 			break;
 		}
 		mr->order = ent->order;
-		mr->allocated_from_cache = 1;
+		mr->allocated_from_cache = true;
 		mr->dev = dev;

 		MLX5_SET(mkc, mkc, free, 1);
@@ -1452,7 +1452,7 @@ int mlx5_ib_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start,
 			goto err;
 		}

-		mr->allocated_from_cache = 0;
+		mr->allocated_from_cache = false;
 	} else {
 		/*
 		 * Send a UMR WQE
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 7e51870..04126ef 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -1871,7 +1871,7 @@ static void configure_requester_scat_cqe(struct mlx5_ib_dev *dev,
 {
 	enum ib_qp_type qpt = init_attr->qp_type;
 	int scqe_sz;
-	bool allow_scat_cqe = 0;
+	bool allow_scat_cqe = false;

 	if (qpt == IB_QPT_UC || qpt == IB_QPT_UD)
 		return;
--
2.7.4


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

* Re: [PATCH 5/5] RDMA/mlx5: use true,false for bool variable
  2019-12-24  8:40 ` [PATCH 5/5] RDMA/mlx5: " zhengbin
@ 2019-12-24  9:48   ` Leon Romanovsky
  0 siblings, 0 replies; 12+ messages in thread
From: Leon Romanovsky @ 2019-12-24  9:48 UTC (permalink / raw)
  To: zhengbin; +Cc: bmt, dledford, jgg, linux-rdma

On Tue, Dec 24, 2019 at 04:40:12PM +0800, zhengbin wrote:
> Fixes coccicheck warning:
>
> drivers/infiniband/hw/mlx5/mr.c:150:2-26: WARNING: Assignment of 0/1 to bool variable
> drivers/infiniband/hw/mlx5/mr.c:1455:2-26: WARNING: Assignment of 0/1 to bool variable
> drivers/infiniband/hw/mlx5/qp.c:1874:6-20: WARNING: Assignment of 0/1 to bool variable
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>  drivers/infiniband/hw/mlx5/mr.c | 4 ++--
>  drivers/infiniband/hw/mlx5/qp.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
>

Thanks,
Acked-by: Leon Romanovsky <leonro@mellanox.com>

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

* Re: [PATCH 4/5] RDMA/mlx4: use true,false for bool variable
  2019-12-24  8:40 ` [PATCH 4/5] RDMA/mlx4: " zhengbin
@ 2019-12-24  9:48   ` Leon Romanovsky
  0 siblings, 0 replies; 12+ messages in thread
From: Leon Romanovsky @ 2019-12-24  9:48 UTC (permalink / raw)
  To: zhengbin; +Cc: bmt, dledford, jgg, linux-rdma

On Tue, Dec 24, 2019 at 04:40:11PM +0800, zhengbin wrote:
> Fixes coccicheck warning:
>
> drivers/infiniband/hw/mlx4/qp.c:852:2-14: WARNING: Assignment of 0/1 to bool variable
> drivers/infiniband/hw/mlx4/qp.c:3087:3-10: WARNING: Assignment of 0/1 to bool variable
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>  drivers/infiniband/hw/mlx4/qp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>

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

* Re: [PATCH 2/5] IB/hfi1: use true,false for bool variable
  2019-12-24  8:40 ` [PATCH 2/5] IB/hfi1: " zhengbin
@ 2019-12-24  9:48   ` Leon Romanovsky
  0 siblings, 0 replies; 12+ messages in thread
From: Leon Romanovsky @ 2019-12-24  9:48 UTC (permalink / raw)
  To: zhengbin; +Cc: bmt, dledford, jgg, linux-rdma

On Tue, Dec 24, 2019 at 04:40:09PM +0800, zhengbin wrote:
> Fixes coccicheck warning:
>
> drivers/infiniband/hw/hfi1/rc.c:2602:1-8: WARNING: Assignment of 0/1 to bool variable
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>  drivers/infiniband/hw/hfi1/rc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>

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

* Re: [PATCH 1/5] RDMA/siw: use true,false for bool variable
  2019-12-24  8:40 ` [PATCH 1/5] RDMA/siw: " zhengbin
@ 2019-12-24  9:50   ` Leon Romanovsky
  0 siblings, 0 replies; 12+ messages in thread
From: Leon Romanovsky @ 2019-12-24  9:50 UTC (permalink / raw)
  To: zhengbin; +Cc: bmt, dledford, jgg, linux-rdma

On Tue, Dec 24, 2019 at 04:40:08PM +0800, zhengbin wrote:
> Fixes coccicheck warning:
>
> drivers/infiniband/sw/siw/siw_cm.c:32:18-41: WARNING: Assignment of 0/1 to bool variable
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>  drivers/infiniband/sw/siw/siw_cm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c
> index 3bccfef4..0c3f058 100644
> --- a/drivers/infiniband/sw/siw/siw_cm.c
> +++ b/drivers/infiniband/sw/siw/siw_cm.c
> @@ -29,7 +29,7 @@
>   * MPA_V2_RDMA_NO_RTR, MPA_V2_RDMA_READ_RTR, MPA_V2_RDMA_WRITE_RTR
>   */
>  static __be16 rtr_type = MPA_V2_RDMA_READ_RTR | MPA_V2_RDMA_WRITE_RTR;
> -static const bool relaxed_ird_negotiation = 1;
> +static const bool relaxed_ird_negotiation = true;

It is worth to simply delete this variable.

>
>  static void siw_cm_llp_state_change(struct sock *s);
>  static void siw_cm_llp_data_ready(struct sock *s);
> --
> 2.7.4
>

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

* Re: [PATCH 0/5] RDMA: use true,false for bool variable
  2019-12-24  8:40 [PATCH 0/5] RDMA: use true,false for bool variable zhengbin
                   ` (4 preceding siblings ...)
  2019-12-24  8:40 ` [PATCH 5/5] RDMA/mlx5: " zhengbin
@ 2020-01-03 23:15 ` Jason Gunthorpe
  2020-01-04 17:25 ` Bernard Metzler
  6 siblings, 0 replies; 12+ messages in thread
From: Jason Gunthorpe @ 2020-01-03 23:15 UTC (permalink / raw)
  To: zhengbin; +Cc: bmt, dledford, linux-rdma

On Tue, Dec 24, 2019 at 04:40:07PM +0800, zhengbin wrote:
> zhengbin (5):
>   RDMA/siw: use true,false for bool variable
>   IB/hfi1: use true,false for bool variable
>   IB/iser: use true,false for bool variable
>   RDMA/mlx4: use true,false for bool variable
>   RDMA/mlx5: use true,false for bool variable

Applied to for-next, but Leon seems right about the funny
relaxed_ird_negotiation that is never set, is that debugging or
something?

Thanks,
Jason

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

* RE: [PATCH 0/5] RDMA: use true,false for bool variable
  2019-12-24  8:40 [PATCH 0/5] RDMA: use true,false for bool variable zhengbin
                   ` (5 preceding siblings ...)
  2020-01-03 23:15 ` [PATCH 0/5] RDMA: " Jason Gunthorpe
@ 2020-01-04 17:25 ` Bernard Metzler
  6 siblings, 0 replies; 12+ messages in thread
From: Bernard Metzler @ 2020-01-04 17:25 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: zhengbin, dledford, linux-rdma

-----"Jason Gunthorpe" <jgg@ziepe.ca> wrote: -----

>To: "zhengbin" <zhengbin13@huawei.com>
>From: "Jason Gunthorpe" <jgg@ziepe.ca>
>Date: 01/04/2020 12:15AM
>Cc: bmt@zurich.ibm.com, dledford@redhat.com,
>linux-rdma@vger.kernel.org
>Subject: [EXTERNAL] Re: [PATCH 0/5] RDMA: use true,false for bool
>variable
>
>On Tue, Dec 24, 2019 at 04:40:07PM +0800, zhengbin wrote:
>> zhengbin (5):
>>   RDMA/siw: use true,false for bool variable
>>   IB/hfi1: use true,false for bool variable
>>   IB/iser: use true,false for bool variable
>>   RDMA/mlx4: use true,false for bool variable
>>   RDMA/mlx5: use true,false for bool variable
>
>Applied to for-next, but Leon seems right about the funny
>relaxed_ird_negotiation that is never set, is that debugging or
>something?
>

Sorry for not coming back earlier. I had a quite severe
bicycle accident which has put me completely off for the
last two and a half weeks.

This flag was introduced with a change to the MPA setup
sequence. While siw originally insisted in correct peer
behavior (not sending data in RDMA mode until handshake
completed), this led to issues with another iWarp 
implementation, which under certain circumstances brakes
the correct setup sequence. So we allowed that peer behavior,
while it brakes the spec.
If we agree that this 'permissive' behavior to be the only
behavior we want to support, we can simply remove that flag
and related code, maybe just leaving a comment at the right
place stating we are permissive?

Thanks
Bernard.


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

end of thread, other threads:[~2020-01-04 17:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-24  8:40 [PATCH 0/5] RDMA: use true,false for bool variable zhengbin
2019-12-24  8:40 ` [PATCH 1/5] RDMA/siw: " zhengbin
2019-12-24  9:50   ` Leon Romanovsky
2019-12-24  8:40 ` [PATCH 2/5] IB/hfi1: " zhengbin
2019-12-24  9:48   ` Leon Romanovsky
2019-12-24  8:40 ` [PATCH 3/5] IB/iser: " zhengbin
2019-12-24  8:40 ` [PATCH 4/5] RDMA/mlx4: " zhengbin
2019-12-24  9:48   ` Leon Romanovsky
2019-12-24  8:40 ` [PATCH 5/5] RDMA/mlx5: " zhengbin
2019-12-24  9:48   ` Leon Romanovsky
2020-01-03 23:15 ` [PATCH 0/5] RDMA: " Jason Gunthorpe
2020-01-04 17:25 ` Bernard Metzler

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).