* [PATCH v1] mlx4: remove unused fields
@ 2016-09-28 18:00 David Decotigny
2016-09-28 18:19 ` Eric Dumazet
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: David Decotigny @ 2016-09-28 18:00 UTC (permalink / raw)
To: Yishai Hadas, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: edumazet-hpIqsD4AKlfQT0dZR+AlfA, David Decotigny
From: David Decotigny <decot-Ypc/8FJVVoBWk0Htik3J/w@public.gmane.org>
This also can address following UBSAN warnings:
[ 36.640343] ================================================================================
[ 36.648772] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:857:26
[ 36.656853] shift exponent 64 is too large for 32-bit type 'int'
[ 36.663348] ================================================================================
[ 36.671783] ================================================================================
[ 36.680213] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:861:27
[ 36.688297] shift exponent 35 is too large for 32-bit type 'int'
[ 36.694702] ================================================================================
Tested:
reboot with UBSAN, no warning.
Signed-off-by: David Decotigny <decot-Ypc/8FJVVoBWk0Htik3J/w@public.gmane.org>
---
drivers/net/ethernet/mellanox/mlx4/fw.c | 4 ----
drivers/net/ethernet/mellanox/mlx4/fw.h | 2 --
2 files changed, 6 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index 090bf81..f9cbc67 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -853,12 +853,8 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
dev_cap->max_eqs = 1 << (field & 0xf);
MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_MTT_OFFSET);
dev_cap->reserved_mtts = 1 << (field >> 4);
- MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_MRW_SZ_OFFSET);
- dev_cap->max_mrw_sz = 1 << field;
MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_MRW_OFFSET);
dev_cap->reserved_mrws = 1 << (field & 0xf);
- MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_MTT_SEG_OFFSET);
- dev_cap->max_mtt_seg = 1 << (field & 0x3f);
MLX4_GET(size, outbox, QUERY_DEV_CAP_NUM_SYS_EQ_OFFSET);
dev_cap->num_sys_eqs = size & 0xfff;
MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_REQ_QP_OFFSET);
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.h b/drivers/net/ethernet/mellanox/mlx4/fw.h
index f11614f..5343a05 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.h
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.h
@@ -80,9 +80,7 @@ struct mlx4_dev_cap {
int max_eqs;
int num_sys_eqs;
int reserved_mtts;
- int max_mrw_sz;
int reserved_mrws;
- int max_mtt_seg;
int max_requester_per_qp;
int max_responder_per_qp;
int max_rdma_global;
--
2.8.0.rc3.226.g39d4020
--
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] 4+ messages in thread
* Re: [PATCH v1] mlx4: remove unused fields
2016-09-28 18:00 [PATCH v1] mlx4: remove unused fields David Decotigny
@ 2016-09-28 18:19 ` Eric Dumazet
[not found] ` <1475085604-101493-1-git-send-email-ddecotig-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-09-30 5:57 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2016-09-28 18:19 UTC (permalink / raw)
To: David Decotigny, Tariq Toukan
Cc: Yishai Hadas, netdev, linux-rdma, linux-kernel, edumazet,
David Decotigny
On Wed, 2016-09-28 at 11:00 -0700, David Decotigny wrote:
> From: David Decotigny <decot@googlers.com>
>
> This also can address following UBSAN warnings:
> [ 36.640343] ================================================================================
> [ 36.648772] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:857:26
> [ 36.656853] shift exponent 64 is too large for 32-bit type 'int'
> [ 36.663348] ================================================================================
> [ 36.671783] ================================================================================
> [ 36.680213] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:861:27
> [ 36.688297] shift exponent 35 is too large for 32-bit type 'int'
> [ 36.694702] ================================================================================
>
> Tested:
> reboot with UBSAN, no warning.
>
> Signed-off-by: David Decotigny <decot@googlers.com>
> ---
CC: Tariq Toukan <tariqt@mellanox.com> (mlx4 maintainer)
Note this patch was cooked/tested using net-next, but can be applied to
net tree, with minor fuzz.
Acked-by: Eric Dumazet <edumazet@google.com>
Thanks David.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] mlx4: remove unused fields
[not found] ` <1475085604-101493-1-git-send-email-ddecotig-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2016-09-29 7:44 ` Tariq Toukan
0 siblings, 0 replies; 4+ messages in thread
From: Tariq Toukan @ 2016-09-29 7:44 UTC (permalink / raw)
To: David Decotigny, Yishai Hadas, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: edumazet-hpIqsD4AKlfQT0dZR+AlfA, David Decotigny
On 28/09/2016 9:00 PM, David Decotigny wrote:
> From: David Decotigny <decot-Ypc/8FJVVoBWk0Htik3J/w@public.gmane.org>
>
> This also can address following UBSAN warnings:
> [ 36.640343] ================================================================================
> [ 36.648772] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:857:26
> [ 36.656853] shift exponent 64 is too large for 32-bit type 'int'
> [ 36.663348] ================================================================================
> [ 36.671783] ================================================================================
> [ 36.680213] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:861:27
> [ 36.688297] shift exponent 35 is too large for 32-bit type 'int'
> [ 36.694702] ================================================================================
>
> Tested:
> reboot with UBSAN, no warning.
>
> Signed-off-by: David Decotigny <decot-Ypc/8FJVVoBWk0Htik3J/w@public.gmane.org>
> ---
> drivers/net/ethernet/mellanox/mlx4/fw.c | 4 ----
> drivers/net/ethernet/mellanox/mlx4/fw.h | 2 --
> 2 files changed, 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
> index 090bf81..f9cbc67 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/fw.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
> @@ -853,12 +853,8 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
> dev_cap->max_eqs = 1 << (field & 0xf);
> MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_MTT_OFFSET);
> dev_cap->reserved_mtts = 1 << (field >> 4);
> - MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_MRW_SZ_OFFSET);
> - dev_cap->max_mrw_sz = 1 << field;
> MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_MRW_OFFSET);
> dev_cap->reserved_mrws = 1 << (field & 0xf);
> - MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_MTT_SEG_OFFSET);
> - dev_cap->max_mtt_seg = 1 << (field & 0x3f);
> MLX4_GET(size, outbox, QUERY_DEV_CAP_NUM_SYS_EQ_OFFSET);
> dev_cap->num_sys_eqs = size & 0xfff;
> MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_REQ_QP_OFFSET);
> diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.h b/drivers/net/ethernet/mellanox/mlx4/fw.h
> index f11614f..5343a05 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/fw.h
> +++ b/drivers/net/ethernet/mellanox/mlx4/fw.h
> @@ -80,9 +80,7 @@ struct mlx4_dev_cap {
> int max_eqs;
> int num_sys_eqs;
> int reserved_mtts;
> - int max_mrw_sz;
> int reserved_mrws;
> - int max_mtt_seg;
> int max_requester_per_qp;
> int max_responder_per_qp;
> int max_rdma_global;
Reviewed-by: Tariq Toukan <tariqt-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Thanks.
--
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] 4+ messages in thread
* Re: [PATCH v1] mlx4: remove unused fields
2016-09-28 18:00 [PATCH v1] mlx4: remove unused fields David Decotigny
2016-09-28 18:19 ` Eric Dumazet
[not found] ` <1475085604-101493-1-git-send-email-ddecotig-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2016-09-30 5:57 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2016-09-30 5:57 UTC (permalink / raw)
To: ddecotig; +Cc: yishaih, netdev, linux-rdma, linux-kernel, edumazet, decot
From: David Decotigny <ddecotig@gmail.com>
Date: Wed, 28 Sep 2016 11:00:04 -0700
> From: David Decotigny <decot@googlers.com>
>
> This also can address following UBSAN warnings:
> [ 36.640343] ================================================================================
> [ 36.648772] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:857:26
> [ 36.656853] shift exponent 64 is too large for 32-bit type 'int'
> [ 36.663348] ================================================================================
> [ 36.671783] ================================================================================
> [ 36.680213] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:861:27
> [ 36.688297] shift exponent 35 is too large for 32-bit type 'int'
> [ 36.694702] ================================================================================
>
> Tested:
> reboot with UBSAN, no warning.
>
> Signed-off-by: David Decotigny <decot@googlers.com>
Applied to net-next, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-30 5:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-28 18:00 [PATCH v1] mlx4: remove unused fields David Decotigny
2016-09-28 18:19 ` Eric Dumazet
[not found] ` <1475085604-101493-1-git-send-email-ddecotig-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-09-29 7:44 ` Tariq Toukan
2016-09-30 5:57 ` David Miller
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).