* [PATCH 0/5] mlx5 patches for kernel v4.10
@ 2016-12-06 1:17 Bart Van Assche
[not found] ` <9ff07804-492c-c67a-e729-b31e0f863027-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
0 siblings, 1 reply; 20+ messages in thread
From: Bart Van Assche @ 2016-12-06 1:17 UTC (permalink / raw)
To: Doug Ledford
Cc: Eli Cohen, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Hello Doug,
The patches in this series is what I came up with while analyzing the
build output for the mlx5 driver and by analyzing an error message
reported by the mlx5 driver. It would be appreciated if these patches
would be considered for inclusion in kernel v4.10.
Thanks,
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 1/5] mlx5: Use NULL instead of 0 to represent a pointer
[not found] ` <9ff07804-492c-c67a-e729-b31e0f863027-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
@ 2016-12-06 1:18 ` Bart Van Assche
[not found] ` <16dc2a07-86f7-ce47-7b0c-1da03e58d99f-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 1:18 ` [PATCH 2/5] mlx5: Remove a set-but-not-used variable Bart Van Assche
` (3 subsequent siblings)
4 siblings, 1 reply; 20+ messages in thread
From: Bart Van Assche @ 2016-12-06 1:18 UTC (permalink / raw)
To: Doug Ledford
Cc: Eli Cohen, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Detected by sparse.
Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/hw/mlx5/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 32b09f059c84..abd200e3e299 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -127,7 +127,7 @@ static int mlx5_netdev_event(struct notifier_block *this,
if ((upper == ndev || (!upper && ndev == ibdev->roce.netdev))
&& ibdev->ib_active) {
- struct ib_event ibev = {0};
+ struct ib_event ibev = { NULL };
ibev.device = &ibdev->ib_dev;
ibev.event = (event == NETDEV_UP) ?
--
2.11.0
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 2/5] mlx5: Remove a set-but-not-used variable
[not found] ` <9ff07804-492c-c67a-e729-b31e0f863027-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 1:18 ` [PATCH 1/5] mlx5: Use NULL instead of 0 to represent a pointer Bart Van Assche
@ 2016-12-06 1:18 ` Bart Van Assche
[not found] ` <f1351e2c-915d-9883-838b-d3c50f27da17-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 1:19 ` [PATCH 3/5] mlx5: Avoid that sparse complains about dubious !x & y expressions Bart Van Assche
` (2 subsequent siblings)
4 siblings, 1 reply; 20+ messages in thread
From: Bart Van Assche @ 2016-12-06 1:18 UTC (permalink / raw)
To: Doug Ledford
Cc: Eli Cohen, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
This has been detected by building the mlx5 driver with W=1.
Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/hw/mlx5/qp.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index d1e921816bfe..b2c6c13d44ac 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -2577,7 +2577,6 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp,
struct mlx5_ib_port *mibport = NULL;
enum mlx5_qp_state mlx5_cur, mlx5_new;
enum mlx5_qp_optpar optpar;
- int sqd_event;
int mlx5_st;
int err;
u16 op;
@@ -2724,12 +2723,6 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp,
if (qp->rq.wqe_cnt && cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT)
context->db_rec_addr = cpu_to_be64(qp->db.dma);
- if (cur_state == IB_QPS_RTS && new_state == IB_QPS_SQD &&
- attr_mask & IB_QP_EN_SQD_ASYNC_NOTIFY && attr->en_sqd_async_notify)
- sqd_event = 1;
- else
- sqd_event = 0;
-
if (cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) {
u8 port_num = (attr_mask & IB_QP_PORT ? attr->port_num :
qp->port) - 1;
--
2.11.0
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 3/5] mlx5: Avoid that sparse complains about dubious !x & y expressions
[not found] ` <9ff07804-492c-c67a-e729-b31e0f863027-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 1:18 ` [PATCH 1/5] mlx5: Use NULL instead of 0 to represent a pointer Bart Van Assche
2016-12-06 1:18 ` [PATCH 2/5] mlx5: Remove a set-but-not-used variable Bart Van Assche
@ 2016-12-06 1:19 ` Bart Van Assche
[not found] ` <572c702f-589f-2d5a-9e13-45223191db85-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 1:19 ` [PATCH 4/5] mlx5: Fix mlx5_srq_attr.pas endianness annotation Bart Van Assche
2016-12-06 1:19 ` [PATCH 5/5] mlx5, calc_sq_size(): Make a debug message more informative Bart Van Assche
4 siblings, 1 reply; 20+ messages in thread
From: Bart Van Assche @ 2016-12-06 1:19 UTC (permalink / raw)
To: Doug Ledford
Cc: Eli Cohen, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/hw/mlx5/mr.c | 20 ++++++++++----------
drivers/net/ethernet/mellanox/mlx5/core/srq.c | 8 ++++----
drivers/net/ethernet/mellanox/mlx5/core/vport.c | 2 +-
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 4e9012463c37..3a5707e0d82a 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -687,10 +687,10 @@ struct ib_mr *mlx5_ib_get_dma_mr(struct ib_pd *pd, int acc)
mkc = MLX5_ADDR_OF(create_mkey_in, in, memory_key_mkey_entry);
MLX5_SET(mkc, mkc, access_mode, MLX5_MKC_ACCESS_MODE_PA);
- MLX5_SET(mkc, mkc, a, !!(acc & IB_ACCESS_REMOTE_ATOMIC));
- MLX5_SET(mkc, mkc, rw, !!(acc & IB_ACCESS_REMOTE_WRITE));
- MLX5_SET(mkc, mkc, rr, !!(acc & IB_ACCESS_REMOTE_READ));
- MLX5_SET(mkc, mkc, lw, !!(acc & IB_ACCESS_LOCAL_WRITE));
+ MLX5_SET(mkc, mkc, a, (acc & IB_ACCESS_REMOTE_ATOMIC) != 0);
+ MLX5_SET(mkc, mkc, rw, (acc & IB_ACCESS_REMOTE_WRITE) != 0);
+ MLX5_SET(mkc, mkc, rr, (acc & IB_ACCESS_REMOTE_READ) != 0);
+ MLX5_SET(mkc, mkc, lw, (acc & IB_ACCESS_LOCAL_WRITE) != 0);
MLX5_SET(mkc, mkc, lr, 1);
MLX5_SET(mkc, mkc, length64, 1);
@@ -1093,14 +1093,14 @@ static struct mlx5_ib_mr *reg_create(struct ib_mr *ibmr, struct ib_pd *pd,
/* The pg_access bit allows setting the access flags
* in the page list submitted with the command. */
- MLX5_SET(create_mkey_in, in, pg_access, !!(pg_cap));
+ MLX5_SET(create_mkey_in, in, pg_access, pg_cap != 0);
mkc = MLX5_ADDR_OF(create_mkey_in, in, memory_key_mkey_entry);
MLX5_SET(mkc, mkc, access_mode, MLX5_MKC_ACCESS_MODE_MTT);
- MLX5_SET(mkc, mkc, a, !!(access_flags & IB_ACCESS_REMOTE_ATOMIC));
- MLX5_SET(mkc, mkc, rw, !!(access_flags & IB_ACCESS_REMOTE_WRITE));
- MLX5_SET(mkc, mkc, rr, !!(access_flags & IB_ACCESS_REMOTE_READ));
- MLX5_SET(mkc, mkc, lw, !!(access_flags & IB_ACCESS_LOCAL_WRITE));
+ MLX5_SET(mkc, mkc, a, (access_flags & IB_ACCESS_REMOTE_ATOMIC) != 0);
+ MLX5_SET(mkc, mkc, rw, (access_flags & IB_ACCESS_REMOTE_WRITE) != 0);
+ MLX5_SET(mkc, mkc, rr, (access_flags & IB_ACCESS_REMOTE_READ) != 0);
+ MLX5_SET(mkc, mkc, lw, (access_flags & IB_ACCESS_LOCAL_WRITE) != 0);
MLX5_SET(mkc, mkc, lr, 1);
MLX5_SET64(mkc, mkc, start_addr, virt_addr);
@@ -1696,7 +1696,7 @@ struct ib_mw *mlx5_ib_alloc_mw(struct ib_pd *pd, enum ib_mw_type type,
MLX5_SET(mkc, mkc, umr_en, 1);
MLX5_SET(mkc, mkc, lr, 1);
MLX5_SET(mkc, mkc, access_mode, MLX5_MKC_ACCESS_MODE_KLMS);
- MLX5_SET(mkc, mkc, en_rinval, !!((type == IB_MW_TYPE_2)));
+ MLX5_SET(mkc, mkc, en_rinval, type == IB_MW_TYPE_2);
MLX5_SET(mkc, mkc, qpn, 0xffffff);
err = mlx5_core_create_mkey(dev->mdev, &mw->mmkey, in, inlen);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/srq.c b/drivers/net/ethernet/mellanox/mlx5/core/srq.c
index 3099630015d7..2dee3129f1cd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/srq.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/srq.c
@@ -80,8 +80,8 @@ static int get_pas_size(struct mlx5_srq_attr *in)
static void set_wq(void *wq, struct mlx5_srq_attr *in)
{
- MLX5_SET(wq, wq, wq_signature, !!(in->flags
- & MLX5_SRQ_FLAG_WQ_SIG));
+ MLX5_SET(wq, wq, wq_signature,
+ (in->flags & MLX5_SRQ_FLAG_WQ_SIG) != 0);
MLX5_SET(wq, wq, log_wq_pg_sz, in->log_page_size);
MLX5_SET(wq, wq, log_wq_stride, in->wqe_shift + 4);
MLX5_SET(wq, wq, log_wq_sz, in->log_size);
@@ -93,8 +93,8 @@ static void set_wq(void *wq, struct mlx5_srq_attr *in)
static void set_srqc(void *srqc, struct mlx5_srq_attr *in)
{
- MLX5_SET(srqc, srqc, wq_signature, !!(in->flags
- & MLX5_SRQ_FLAG_WQ_SIG));
+ MLX5_SET(srqc, srqc, wq_signature,
+ (in->flags & MLX5_SRQ_FLAG_WQ_SIG) != 0);
MLX5_SET(srqc, srqc, log_page_size, in->log_page_size);
MLX5_SET(srqc, srqc, log_rq_stride, in->wqe_shift);
MLX5_SET(srqc, srqc, log_srq_size, in->log_size);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/vport.c b/drivers/net/ethernet/mellanox/mlx5/core/vport.c
index 525f17af108e..ea9076f61b6b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/vport.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/vport.c
@@ -539,7 +539,7 @@ int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev,
MLX5_SET(modify_nic_vport_context_in, in,
field_select.node_guid, 1);
MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport);
- MLX5_SET(modify_nic_vport_context_in, in, other_vport, !!vport);
+ MLX5_SET(modify_nic_vport_context_in, in, other_vport, vport != 0);
nic_vport_context = MLX5_ADDR_OF(modify_nic_vport_context_in,
in, nic_vport_context);
--
2.11.0
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 4/5] mlx5: Fix mlx5_srq_attr.pas endianness annotation
[not found] ` <9ff07804-492c-c67a-e729-b31e0f863027-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
` (2 preceding siblings ...)
2016-12-06 1:19 ` [PATCH 3/5] mlx5: Avoid that sparse complains about dubious !x & y expressions Bart Van Assche
@ 2016-12-06 1:19 ` Bart Van Assche
[not found] ` <3d4f5ffa-e9bf-cd28-d200-74c5dd3d68ce-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 1:19 ` [PATCH 5/5] mlx5, calc_sq_size(): Make a debug message more informative Bart Van Assche
4 siblings, 1 reply; 20+ messages in thread
From: Bart Van Assche @ 2016-12-06 1:19 UTC (permalink / raw)
To: Doug Ledford
Cc: Eli Cohen, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Detected by sparse.
Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
include/linux/mlx5/srq.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/mlx5/srq.h b/include/linux/mlx5/srq.h
index 33c97dc900f8..1cde0fd53f90 100644
--- a/include/linux/mlx5/srq.h
+++ b/include/linux/mlx5/srq.h
@@ -55,7 +55,7 @@ struct mlx5_srq_attr {
u32 lwm;
u32 user_index;
u64 db_record;
- u64 *pas;
+ __be64 *pas;
};
struct mlx5_core_dev;
--
2.11.0
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 5/5] mlx5, calc_sq_size(): Make a debug message more informative
[not found] ` <9ff07804-492c-c67a-e729-b31e0f863027-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
` (3 preceding siblings ...)
2016-12-06 1:19 ` [PATCH 4/5] mlx5: Fix mlx5_srq_attr.pas endianness annotation Bart Van Assche
@ 2016-12-06 1:19 ` Bart Van Assche
[not found] ` <4387aa0f-5097-d456-eee2-b480dfa5af87-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
4 siblings, 1 reply; 20+ messages in thread
From: Bart Van Assche @ 2016-12-06 1:19 UTC (permalink / raw)
To: Doug Ledford
Cc: Eli Cohen, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Make it clear that qp->sq.wqe_cnt is not the number of WQEs.
Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/hw/mlx5/qp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index b2c6c13d44ac..735b8aadb84c 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -381,7 +381,8 @@ static int calc_sq_size(struct mlx5_ib_dev *dev, struct ib_qp_init_attr *attr,
wq_size = roundup_pow_of_two(attr->cap.max_send_wr * wqe_size);
qp->sq.wqe_cnt = wq_size / MLX5_SEND_WQE_BB;
if (qp->sq.wqe_cnt > (1 << MLX5_CAP_GEN(dev->mdev, log_max_qp_sz))) {
- mlx5_ib_dbg(dev, "wqe count(%d) exceeds limits(%d)\n",
+ mlx5_ib_dbg(dev, "send queue size (%d * %d / %d -> %d) exceeds limits(%d)\n",
+ attr->cap.max_send_wr, wqe_size, MLX5_SEND_WQE_BB,
qp->sq.wqe_cnt,
1 << MLX5_CAP_GEN(dev->mdev, log_max_qp_sz));
return -ENOMEM;
--
2.11.0
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 4/5] mlx5: Fix mlx5_srq_attr.pas endianness annotation
[not found] ` <3d4f5ffa-e9bf-cd28-d200-74c5dd3d68ce-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
@ 2016-12-06 13:55 ` Leon Romanovsky
0 siblings, 0 replies; 20+ messages in thread
From: Leon Romanovsky @ 2016-12-06 13:55 UTC (permalink / raw)
To: Bart Van Assche
Cc: Doug Ledford, Eli Cohen,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Mon, Dec 05, 2016 at 05:19:29PM -0800, Bart Van Assche wrote:
> Detected by sparse.
>
> Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Thanks Bart,
It is fixed in Dave's tree.
https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/include/linux/mlx5/srq.h?id=dd257efb1e0f8875ed7e42b88837a8dada0d0e41
> ---
> include/linux/mlx5/srq.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/mlx5/srq.h b/include/linux/mlx5/srq.h
> index 33c97dc900f8..1cde0fd53f90 100644
> --- a/include/linux/mlx5/srq.h
> +++ b/include/linux/mlx5/srq.h
> @@ -55,7 +55,7 @@ struct mlx5_srq_attr {
> u32 lwm;
> u32 user_index;
> u64 db_record;
> - u64 *pas;
> + __be64 *pas;
> };
>
> struct mlx5_core_dev;
> --
> 2.11.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/5] mlx5: Use NULL instead of 0 to represent a pointer
[not found] ` <16dc2a07-86f7-ce47-7b0c-1da03e58d99f-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
@ 2016-12-06 13:59 ` Leon Romanovsky
[not found] ` <20161206135917.GC2437-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
0 siblings, 1 reply; 20+ messages in thread
From: Leon Romanovsky @ 2016-12-06 13:59 UTC (permalink / raw)
To: Bart Van Assche
Cc: Doug Ledford, Eli Cohen,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Mon, Dec 05, 2016 at 05:18:08PM -0800, Bart Van Assche wrote:
> Detected by sparse.
>
> Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> drivers/infiniband/hw/mlx5/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> index 32b09f059c84..abd200e3e299 100644
> --- a/drivers/infiniband/hw/mlx5/main.c
> +++ b/drivers/infiniband/hw/mlx5/main.c
> @@ -127,7 +127,7 @@ static int mlx5_netdev_event(struct notifier_block *this,
>
> if ((upper == ndev || (!upper && ndev == ibdev->roce.netdev))
> && ibdev->ib_active) {
> - struct ib_event ibev = {0};
> + struct ib_event ibev = { NULL };
I afraid that it is sparse anomality and because NULL==0, the ibev.event
will be initialized to zero, but it is a matter of time when the sparse
will complain about wrong initialization again.
>
> ibev.device = &ibdev->ib_dev;
> ibev.event = (event == NETDEV_UP) ?
> --
> 2.11.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 2/5] mlx5: Remove a set-but-not-used variable
[not found] ` <f1351e2c-915d-9883-838b-d3c50f27da17-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
@ 2016-12-06 14:24 ` Leon Romanovsky
[not found] ` <20161206142441.GA3437-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
0 siblings, 1 reply; 20+ messages in thread
From: Leon Romanovsky @ 2016-12-06 14:24 UTC (permalink / raw)
To: Bart Van Assche
Cc: Doug Ledford, Eli Cohen,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Mon, Dec 05, 2016 at 05:18:27PM -0800, Bart Van Assche wrote:
> This has been detected by building the mlx5 driver with W=1.
>
> Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Thanks,
Fixes: 1a412fb1caa2 ('net/mlx5: Fixes: 1a412fb1caa2 (IB/mlx5: Modify QP commands via mlx5 ifc')
Acked-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> drivers/infiniband/hw/mlx5/qp.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
> index d1e921816bfe..b2c6c13d44ac 100644
> --- a/drivers/infiniband/hw/mlx5/qp.c
> +++ b/drivers/infiniband/hw/mlx5/qp.c
> @@ -2577,7 +2577,6 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp,
> struct mlx5_ib_port *mibport = NULL;
> enum mlx5_qp_state mlx5_cur, mlx5_new;
> enum mlx5_qp_optpar optpar;
> - int sqd_event;
> int mlx5_st;
> int err;
> u16 op;
> @@ -2724,12 +2723,6 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp,
> if (qp->rq.wqe_cnt && cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT)
> context->db_rec_addr = cpu_to_be64(qp->db.dma);
>
> - if (cur_state == IB_QPS_RTS && new_state == IB_QPS_SQD &&
> - attr_mask & IB_QP_EN_SQD_ASYNC_NOTIFY && attr->en_sqd_async_notify)
> - sqd_event = 1;
> - else
> - sqd_event = 0;
> -
> if (cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) {
> u8 port_num = (attr_mask & IB_QP_PORT ? attr->port_num :
> qp->port) - 1;
> --
> 2.11.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 5/5] mlx5, calc_sq_size(): Make a debug message more informative
[not found] ` <4387aa0f-5097-d456-eee2-b480dfa5af87-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
@ 2016-12-06 14:31 ` Leon Romanovsky
[not found] ` <20161206143159.GB3437-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
0 siblings, 1 reply; 20+ messages in thread
From: Leon Romanovsky @ 2016-12-06 14:31 UTC (permalink / raw)
To: Bart Van Assche
Cc: Doug Ledford, Eli Cohen,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Mon, Dec 05, 2016 at 05:19:52PM -0800, Bart Van Assche wrote:
> Make it clear that qp->sq.wqe_cnt is not the number of WQEs.
>
> Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Thanks,
Acked-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> drivers/infiniband/hw/mlx5/qp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
> index b2c6c13d44ac..735b8aadb84c 100644
> --- a/drivers/infiniband/hw/mlx5/qp.c
> +++ b/drivers/infiniband/hw/mlx5/qp.c
> @@ -381,7 +381,8 @@ static int calc_sq_size(struct mlx5_ib_dev *dev, struct ib_qp_init_attr *attr,
> wq_size = roundup_pow_of_two(attr->cap.max_send_wr * wqe_size);
> qp->sq.wqe_cnt = wq_size / MLX5_SEND_WQE_BB;
> if (qp->sq.wqe_cnt > (1 << MLX5_CAP_GEN(dev->mdev, log_max_qp_sz))) {
> - mlx5_ib_dbg(dev, "wqe count(%d) exceeds limits(%d)\n",
> + mlx5_ib_dbg(dev, "send queue size (%d * %d / %d -> %d) exceeds limits(%d)\n",
> + attr->cap.max_send_wr, wqe_size, MLX5_SEND_WQE_BB,
> qp->sq.wqe_cnt,
> 1 << MLX5_CAP_GEN(dev->mdev, log_max_qp_sz));
> return -ENOMEM;
> --
> 2.11.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/5] mlx5: Use NULL instead of 0 to represent a pointer
[not found] ` <20161206135917.GC2437-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
@ 2016-12-06 16:28 ` Jason Gunthorpe
2016-12-06 16:29 ` Bart Van Assche
1 sibling, 0 replies; 20+ messages in thread
From: Jason Gunthorpe @ 2016-12-06 16:28 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Bart Van Assche, Doug Ledford, Eli Cohen,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Tue, Dec 06, 2016 at 03:59:17PM +0200, Leon Romanovsky wrote:
> On Mon, Dec 05, 2016 at 05:18:08PM -0800, Bart Van Assche wrote:
> > Detected by sparse.
> >
> > Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> > Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > drivers/infiniband/hw/mlx5/main.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> > index 32b09f059c84..abd200e3e299 100644
> > +++ b/drivers/infiniband/hw/mlx5/main.c
> > @@ -127,7 +127,7 @@ static int mlx5_netdev_event(struct notifier_block *this,
> >
> > if ((upper == ndev || (!upper && ndev == ibdev->roce.netdev))
> > && ibdev->ib_active) {
> > - struct ib_event ibev = {0};
> > + struct ib_event ibev = { NULL };
>
> I afraid that it is sparse anomality and because NULL==0, the ibev.event
> will be initialized to zero, but it is a matter of time when the sparse
> will complain about wrong initialization again.
Use '= {}' for zeroing structs.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/5] mlx5: Use NULL instead of 0 to represent a pointer
[not found] ` <20161206135917.GC2437-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2016-12-06 16:28 ` Jason Gunthorpe
@ 2016-12-06 16:29 ` Bart Van Assche
[not found] ` <a8d3dbb7-aafa-c5af-5d06-78d1f4914c5d-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
1 sibling, 1 reply; 20+ messages in thread
From: Bart Van Assche @ 2016-12-06 16:29 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Doug Ledford, Eli Cohen,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On 12/06/2016 05:59 AM, Leon Romanovsky wrote:
> On Mon, Dec 05, 2016 at 05:18:08PM -0800, Bart Van Assche wrote:
>> Detected by sparse.
>>
>> Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
>> Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>> ---
>> drivers/infiniband/hw/mlx5/main.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
>> index 32b09f059c84..abd200e3e299 100644
>> --- a/drivers/infiniband/hw/mlx5/main.c
>> +++ b/drivers/infiniband/hw/mlx5/main.c
>> @@ -127,7 +127,7 @@ static int mlx5_netdev_event(struct notifier_block *this,
>>
>> if ((upper == ndev || (!upper && ndev == ibdev->roce.netdev))
>> && ibdev->ib_active) {
>> - struct ib_event ibev = {0};
>> + struct ib_event ibev = { NULL };
>
> I afraid that it is sparse anomality and because NULL==0, the ibev.event
> will be initialized to zero, but it is a matter of time when the sparse
> will complain about wrong initialization again.
Hello Leon,
The first member of struct ib_event is a pointer so I think the sparse
complaint is correct. Anyway, how about one of the following two
alternatives:
* Change {0} into { }.
* Use memset() instead of an initializer.
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/5] mlx5: Use NULL instead of 0 to represent a pointer
[not found] ` <a8d3dbb7-aafa-c5af-5d06-78d1f4914c5d-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
@ 2016-12-07 8:21 ` Leon Romanovsky
[not found] ` <20161207082110.GA11857-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
0 siblings, 1 reply; 20+ messages in thread
From: Leon Romanovsky @ 2016-12-07 8:21 UTC (permalink / raw)
To: Bart Van Assche
Cc: Doug Ledford, Eli Cohen,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
[-- Attachment #1: Type: text/plain, Size: 1865 bytes --]
On Tue, Dec 06, 2016 at 08:29:56AM -0800, Bart Van Assche wrote:
> On 12/06/2016 05:59 AM, Leon Romanovsky wrote:
> > On Mon, Dec 05, 2016 at 05:18:08PM -0800, Bart Van Assche wrote:
> > > Detected by sparse.
> > >
> > > Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> > > Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > > ---
> > > drivers/infiniband/hw/mlx5/main.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> > > index 32b09f059c84..abd200e3e299 100644
> > > --- a/drivers/infiniband/hw/mlx5/main.c
> > > +++ b/drivers/infiniband/hw/mlx5/main.c
> > > @@ -127,7 +127,7 @@ static int mlx5_netdev_event(struct notifier_block *this,
> > >
> > > if ((upper == ndev || (!upper && ndev == ibdev->roce.netdev))
> > > && ibdev->ib_active) {
> > > - struct ib_event ibev = {0};
> > > + struct ib_event ibev = { NULL };
> >
> > I afraid that it is sparse anomality and because NULL==0, the ibev.event
> > will be initialized to zero, but it is a matter of time when the sparse
> > will complain about wrong initialization again.
>
> Hello Leon,
>
> The first member of struct ib_event is a pointer so I think the sparse
> complaint is correct.
Yes, sparse didn't iterate all fields of this struct. This is why I
called it "sparse anomality".
> Anyway, how about one of the following two
> alternatives:
> * Change {0} into { }.
Yes, please.
Thanks
> * Use memset() instead of an initializer.
>
> Bart.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 3/5] mlx5: Avoid that sparse complains about dubious !x & y expressions
[not found] ` <572c702f-589f-2d5a-9e13-45223191db85-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
@ 2016-12-08 9:26 ` Or Gerlitz
[not found] ` <CAJ3xEMjPZYgLhDi_6Jxkx_dg_RaehD=3SchMt_noLzQEChPrxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 20+ messages in thread
From: Or Gerlitz @ 2016-12-08 9:26 UTC (permalink / raw)
To: Bart Van Assche, Saeed Mahameed
Cc: Eli Cohen, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Matan Barak
On Tue, Dec 6, 2016 at 3:19 AM, Bart Van Assche
<bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org> wrote:
> This patch does not change any functionality.
Hi Bart,
Matan came up with a fix (below) which solves all these sparse
complaints in both drivers (mlx5 IB and core)
while basically not touching the code, we will be going with that fix
to 4.11, thanks, I will add reported
by pointing to you.
Doug, in case you picked that, I guess you have to drop it.
Or.
iff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 9f48936..0abdc66 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -67,10 +67,11 @@
/* insert a value to a struct */
#define MLX5_SET(typ, p, fld, v) do { \
+ typeof( v ) _v = v; \
BUILD_BUG_ON(__mlx5_st_sz_bits(typ) % 32); \
*((__be32 *)(p) + __mlx5_dw_off(typ, fld)) = \
cpu_to_be32((be32_to_cpu(*((__be32 *)(p) + __mlx5_dw_off(typ, fld))) & \
- (~__mlx5_dw_mask(typ, fld))) | (((v) &
__mlx5_mask(typ, fld)) \
+ (~__mlx5_dw_mask(typ, fld))) | (((_v) &
__mlx5_mask(typ, fld)) \
<< __mlx5_dw_bit_off(typ, fld))); \
} while (0)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 3/5] mlx5: Avoid that sparse complains about dubious !x & y expressions
[not found] ` <CAJ3xEMjPZYgLhDi_6Jxkx_dg_RaehD=3SchMt_noLzQEChPrxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-12-08 17:52 ` Bart Van Assche
2016-12-08 17:53 ` Jason Gunthorpe
1 sibling, 0 replies; 20+ messages in thread
From: Bart Van Assche @ 2016-12-08 17:52 UTC (permalink / raw)
To: Or Gerlitz, Saeed Mahameed
Cc: Eli Cohen, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Matan Barak
On 12/08/2016 01:26 AM, Or Gerlitz wrote:
> Matan came up with a fix (below) which solves all these sparse
> complaints in both drivers (mlx5 IB and core)
> while basically not touching the code, we will be going with that fix
> to 4.11, thanks, I will add reported
> by pointing to you.
Hello Or,
Please consider to keep the following change:
- MLX5_SET(mkc, mkc, en_rinval, !!((type == IB_MW_TYPE_2)));
+ MLX5_SET(mkc, mkc, en_rinval, type == IB_MW_TYPE_2);
I don't think that specifying two boolean not (!) operators in front of
a boolean expression is useful :-)
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 3/5] mlx5: Avoid that sparse complains about dubious !x & y expressions
[not found] ` <CAJ3xEMjPZYgLhDi_6Jxkx_dg_RaehD=3SchMt_noLzQEChPrxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-08 17:52 ` Bart Van Assche
@ 2016-12-08 17:53 ` Jason Gunthorpe
[not found] ` <20161208175322.GB11025-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
1 sibling, 1 reply; 20+ messages in thread
From: Jason Gunthorpe @ 2016-12-08 17:53 UTC (permalink / raw)
To: Or Gerlitz
Cc: Bart Van Assche, Saeed Mahameed, Eli Cohen,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Matan Barak
On Thu, Dec 08, 2016 at 11:26:32AM +0200, Or Gerlitz wrote:
> /* insert a value to a struct */
> #define MLX5_SET(typ, p, fld, v) do { \
> + typeof( v ) _v = v; \
> BUILD_BUG_ON(__mlx5_st_sz_bits(typ) % 32); \
> *((__be32 *)(p) + __mlx5_dw_off(typ, fld)) = \
> cpu_to_be32((be32_to_cpu(*((__be32 *)(p) + __mlx5_dw_off(typ, fld))) & \
> - (~__mlx5_dw_mask(typ, fld))) | (((v) &
> __mlx5_mask(typ, fld)) \
> + (~__mlx5_dw_mask(typ, fld))) | (((_v) &
> __mlx5_mask(typ, fld)) \
> << __mlx5_dw_bit_off(typ, fld))); \
> } while (0)
Ugh, that is ugly.
This is better, it has proper type safety :|
static inline _mlx5_set(__be32 *p, u32 dw_mask,
u32 mask, u32 dw_off,
unsigned int bit_off, u32 val)
{
*(p + dw_off) = cpu_to_b32((be32_to_cpu_p(p + dw_off) &
~dw_mask) | ((val & mask) << bit_off));
}
#define MLX5_SET(typ, p, fld, v) \
_mlx5_set(p, __mlx5_dw_mask(typ, fld),
__mlx5_mask(typ, fld),
__mlx5_dw_off(typ, fld),
__mlx5_dw_bit_off(typ, fld), v)
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/5] mlx5: Use NULL instead of 0 to represent a pointer
[not found] ` <20161207082110.GA11857-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
@ 2016-12-14 18:44 ` Doug Ledford
0 siblings, 0 replies; 20+ messages in thread
From: Doug Ledford @ 2016-12-14 18:44 UTC (permalink / raw)
To: Leon Romanovsky, Bart Van Assche
Cc: Eli Cohen, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
[-- Attachment #1.1: Type: text/plain, Size: 375 bytes --]
On 12/7/2016 3:21 AM, Leon Romanovsky wrote:
> On Tue, Dec 06, 2016 at 08:29:56AM -0800, Bart Van Assche wrote:
>> Anyway, how about one of the following two
>> alternatives:
>> * Change {0} into { }.
>
> Yes, please.
> Thanks
Fixed this one up and applied it.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 2/5] mlx5: Remove a set-but-not-used variable
[not found] ` <20161206142441.GA3437-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
@ 2016-12-14 18:45 ` Doug Ledford
0 siblings, 0 replies; 20+ messages in thread
From: Doug Ledford @ 2016-12-14 18:45 UTC (permalink / raw)
To: Leon Romanovsky, Bart Van Assche
Cc: Eli Cohen, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
[-- Attachment #1.1: Type: text/plain, Size: 653 bytes --]
On 12/6/2016 9:24 AM, Leon Romanovsky wrote:
> On Mon, Dec 05, 2016 at 05:18:27PM -0800, Bart Van Assche wrote:
>> This has been detected by building the mlx5 driver with W=1.
>>
>> Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
>> Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> Thanks,
> Fixes: 1a412fb1caa2 ('net/mlx5: Fixes: 1a412fb1caa2 (IB/mlx5: Modify QP commands via mlx5 ifc')
> Acked-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Applied, thanks.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 3/5] mlx5: Avoid that sparse complains about dubious !x & y expressions
[not found] ` <20161208175322.GB11025-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2016-12-14 18:46 ` Doug Ledford
0 siblings, 0 replies; 20+ messages in thread
From: Doug Ledford @ 2016-12-14 18:46 UTC (permalink / raw)
To: Jason Gunthorpe, Or Gerlitz
Cc: Bart Van Assche, Saeed Mahameed, Eli Cohen,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Matan Barak
[-- Attachment #1.1: Type: text/plain, Size: 1673 bytes --]
On 12/8/2016 12:53 PM, Jason Gunthorpe wrote:
> On Thu, Dec 08, 2016 at 11:26:32AM +0200, Or Gerlitz wrote:
>> /* insert a value to a struct */
>> #define MLX5_SET(typ, p, fld, v) do { \
>> + typeof( v ) _v = v; \
>> BUILD_BUG_ON(__mlx5_st_sz_bits(typ) % 32); \
>> *((__be32 *)(p) + __mlx5_dw_off(typ, fld)) = \
>> cpu_to_be32((be32_to_cpu(*((__be32 *)(p) + __mlx5_dw_off(typ, fld))) & \
>> - (~__mlx5_dw_mask(typ, fld))) | (((v) &
>> __mlx5_mask(typ, fld)) \
>> + (~__mlx5_dw_mask(typ, fld))) | (((_v) &
>> __mlx5_mask(typ, fld)) \
>> << __mlx5_dw_bit_off(typ, fld))); \
>> } while (0)
>
> Ugh, that is ugly.
>
> This is better, it has proper type safety :|
>
> static inline _mlx5_set(__be32 *p, u32 dw_mask,
> u32 mask, u32 dw_off,
> unsigned int bit_off, u32 val)
> {
> *(p + dw_off) = cpu_to_b32((be32_to_cpu_p(p + dw_off) &
> ~dw_mask) | ((val & mask) << bit_off));
> }
>
> #define MLX5_SET(typ, p, fld, v) \
> _mlx5_set(p, __mlx5_dw_mask(typ, fld),
> __mlx5_mask(typ, fld),
> __mlx5_dw_off(typ, fld),
> __mlx5_dw_bit_off(typ, fld), v)
>
> Jason
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Dropped this patch and will wait for fixed up version from Mellanox.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 5/5] mlx5, calc_sq_size(): Make a debug message more informative
[not found] ` <20161206143159.GB3437-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
@ 2016-12-14 18:46 ` Doug Ledford
0 siblings, 0 replies; 20+ messages in thread
From: Doug Ledford @ 2016-12-14 18:46 UTC (permalink / raw)
To: Leon Romanovsky, Bart Van Assche
Cc: Eli Cohen, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
[-- Attachment #1.1: Type: text/plain, Size: 554 bytes --]
On 12/6/2016 9:31 AM, Leon Romanovsky wrote:
> On Mon, Dec 05, 2016 at 05:19:52PM -0800, Bart Van Assche wrote:
>> Make it clear that qp->sq.wqe_cnt is not the number of WQEs.
>>
>> Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
>> Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> Thanks,
> Acked-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Applied, thanks.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2016-12-14 18:46 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06 1:17 [PATCH 0/5] mlx5 patches for kernel v4.10 Bart Van Assche
[not found] ` <9ff07804-492c-c67a-e729-b31e0f863027-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 1:18 ` [PATCH 1/5] mlx5: Use NULL instead of 0 to represent a pointer Bart Van Assche
[not found] ` <16dc2a07-86f7-ce47-7b0c-1da03e58d99f-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 13:59 ` Leon Romanovsky
[not found] ` <20161206135917.GC2437-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2016-12-06 16:28 ` Jason Gunthorpe
2016-12-06 16:29 ` Bart Van Assche
[not found] ` <a8d3dbb7-aafa-c5af-5d06-78d1f4914c5d-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-07 8:21 ` Leon Romanovsky
[not found] ` <20161207082110.GA11857-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2016-12-14 18:44 ` Doug Ledford
2016-12-06 1:18 ` [PATCH 2/5] mlx5: Remove a set-but-not-used variable Bart Van Assche
[not found] ` <f1351e2c-915d-9883-838b-d3c50f27da17-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 14:24 ` Leon Romanovsky
[not found] ` <20161206142441.GA3437-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2016-12-14 18:45 ` Doug Ledford
2016-12-06 1:19 ` [PATCH 3/5] mlx5: Avoid that sparse complains about dubious !x & y expressions Bart Van Assche
[not found] ` <572c702f-589f-2d5a-9e13-45223191db85-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-08 9:26 ` Or Gerlitz
[not found] ` <CAJ3xEMjPZYgLhDi_6Jxkx_dg_RaehD=3SchMt_noLzQEChPrxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-08 17:52 ` Bart Van Assche
2016-12-08 17:53 ` Jason Gunthorpe
[not found] ` <20161208175322.GB11025-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-12-14 18:46 ` Doug Ledford
2016-12-06 1:19 ` [PATCH 4/5] mlx5: Fix mlx5_srq_attr.pas endianness annotation Bart Van Assche
[not found] ` <3d4f5ffa-e9bf-cd28-d200-74c5dd3d68ce-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 13:55 ` Leon Romanovsky
2016-12-06 1:19 ` [PATCH 5/5] mlx5, calc_sq_size(): Make a debug message more informative Bart Van Assche
[not found] ` <4387aa0f-5097-d456-eee2-b480dfa5af87-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 14:31 ` Leon Romanovsky
[not found] ` <20161206143159.GB3437-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2016-12-14 18:46 ` Doug Ledford
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).