linux-stable/drivers/net/ethernet/mellanox/mlx5/core
Tom Herbert b8a4ddb2e8 net/mlx5: Add MLX5_ARRAY_SET64 to fix BUILD_BUG_ON
I am hitting this in mlx5:

drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c: In function
reclaim_pages_cmd.clone.0:
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:346: error: call
to __compiletime_assert_346 declared with attribute error:
BUILD_BUG_ON failed: __mlx5_bit_off(manage_pages_out, pas[i]) % 64
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c: In function give_pages:
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:291: error: call
to __compiletime_assert_291 declared with attribute error:
BUILD_BUG_ON failed: __mlx5_bit_off(manage_pages_in, pas[i]) % 64

Problem is that this is doing a BUILD_BUG_ON on a non-constant
expression because of trying to take offset of pas[i] in the
structure.

Fix is to create MLX5_ARRAY_SET64 that takes an additional argument
that is the field index to separate between BUILD_BUG_ON on the array
constant field and the indexed field to assign the value to.
There are two callers of MLX5_SET64 that are trying to get a variable
offset, change those to call MLX5_ARRAY_SET64 passing 'pas' and 'i'
as the arguments to use in the offset check and the indexed value
assignment.

Fixes: a533ed5e17 ("net/mlx5: Pages management commands via mlx5 ifc")
Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-10-13 10:13:24 -04:00
..
Kconfig net/mlx5: Add devlink interface 2016-07-02 14:40:40 -04:00
Makefile net/mlx5: Organize device list API in one place 2016-09-10 21:21:50 -07:00
alloc.c net/mlx5e: Allocate DMA coherent memory on reader NUMA node 2015-07-27 00:29:17 -07:00
cmd.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-08-30 00:54:02 -04:00
cq.c net/mlx5: Unify and improve command interface 2016-08-17 17:45:58 +03:00
debugfs.c {net,IB}/mlx5: QP/XRCD commands via mlx5 ifc 2016-08-17 17:45:57 +03:00
dev.c net/mlx5: Organize device list API in one place 2016-09-10 21:21:50 -07:00
en.h net/mlx5: E-Switch, Support VLAN actions in the offloads mode 2016-09-23 07:22:12 -04:00
en_arfs.c net/mlx5: Refactor mlx5_add_flow_rule 2016-07-05 00:06:02 -07:00
en_clock.c ptp_clock: future-proofing drivers against PTP subsystem becoming optional 2016-09-22 02:18:33 -04:00
en_common.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-08-30 00:54:02 -04:00
en_dcbnl.c net/mlx5: Add error prints when validate ETS failed 2016-08-28 23:24:16 -04:00
en_ethtool.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-09-12 15:52:44 -07:00
en_fs.c net/mlx5e: Restore vlan filter after seamless reset 2016-09-10 21:21:50 -07:00
en_fs_ethtool.c net/mlx5e: Add support to get ethtool flow rules 2016-07-05 00:06:03 -07:00
en_main.c mlx5: Add ndo_poll_controller() implementation 2016-09-30 02:11:16 -04:00
en_rep.c net/mlx5e: Implement mlx5e interface attach/detach callbacks 2016-09-10 21:21:50 -07:00
en_rx.c net/mlx5: E-Switch, Support VLAN actions in the offloads mode 2016-09-23 07:22:12 -04:00
en_rx_am.c net/mlx5e: Support adaptive RX coalescing 2016-06-27 04:10:41 -04:00
en_stats.h net/mlx5e: XDP TX forwarding support 2016-09-22 02:51:41 -04:00
en_tc.c net/mlx5e: shut up maybe-uninitialized warning 2016-10-03 01:55:18 -04:00
en_tc.h net/mlx5e: Hardware offloaded flower filter statistics support 2016-05-16 13:43:51 -04:00
en_tx.c net/mlx5e: XDP TX forwarding support 2016-09-22 02:51:41 -04:00
en_txrx.c net/mlx5e: XDP TX forwarding support 2016-09-22 02:51:41 -04:00
eq.c net/mlx5: Unify and improve command interface 2016-08-17 17:45:58 +03:00
eswitch.c net/mlx5: E-Switch, Allow fine tuning of eswitch vport push/pop vlan 2016-09-23 07:22:12 -04:00
eswitch.h net/mlx5: E-Switch, Support VLAN actions in the offloads mode 2016-09-23 07:22:12 -04:00
eswitch_offloads.c net/mlx5: E-Switch, Support VLAN actions in the offloads mode 2016-09-23 07:22:12 -04:00
fs_cmd.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-09-23 06:46:57 -04:00
fs_cmd.h net/mlx5: LAG demux flow table support 2016-08-18 18:49:56 +03:00
fs_core.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-08-30 00:54:02 -04:00
fs_core.h net/mlx5: Add sniffer namespaces 2016-08-18 18:49:59 +03:00
fs_counters.c net/mlx5: Update last-use statistics for flow rules 2016-08-19 16:09:55 -07:00
fw.c net/mlx5: Unify and improve command interface 2016-08-17 17:45:58 +03:00
health.c net/mlx5_core/health: Remove deprecated create_singlethread_workqueue 2016-07-26 15:18:56 -07:00
lag.c net/mlx5: Organize device list API in one place 2016-09-10 21:21:50 -07:00
mad.c net/mlx5: Unify and improve command interface 2016-08-17 17:45:58 +03:00
main.c net/mlx5: Organize device list API in one place 2016-09-10 21:21:50 -07:00
mcg.c net/mlx5: Unify and improve command interface 2016-08-17 17:45:58 +03:00
mlx5_core.h net/mlx5: Organize device list API in one place 2016-09-10 21:21:50 -07:00
mr.c net/mlx5: Unify and improve command interface 2016-08-17 17:45:58 +03:00
pagealloc.c net/mlx5: Add MLX5_ARRAY_SET64 to fix BUILD_BUG_ON 2016-10-13 10:13:24 -04:00
pd.c net/mlx5: Unify and improve command interface 2016-08-17 17:45:58 +03:00
port.c net/mlx5: Separate query_port_proto_oper for IB and EN 2016-08-18 18:49:52 +03:00
qp.c net/mlx5: Unify and improve command interface 2016-08-17 17:45:58 +03:00
rl.c net/mlx5: Unify and improve command interface 2016-08-17 17:45:58 +03:00
sriov.c net/mlx5: Align sriov/eswitch modules with the new load/unload flow. 2016-09-10 21:21:50 -07:00
srq.c net/mlx5: Unify and improve command interface 2016-08-17 17:45:58 +03:00
transobj.c net/mlx5: Unify and improve command interface 2016-08-17 17:45:58 +03:00
uar.c net/mlx5: Unify and improve command interface 2016-08-17 17:45:58 +03:00
vport.c net/mlx5: Enable setting minimum inline header mode for VFs 2016-08-17 17:45:59 +03:00
vxlan.c net/mlx5: Unify and improve command interface 2016-08-17 17:45:58 +03:00
vxlan.h mlx5: Fix merge errors. 2016-05-09 22:05:13 -04:00
wq.c net/mlx5: use mlx5_buf_alloc_node instead of mlx5_buf_alloc in mlx5_wq_ll_create 2016-06-28 05:17:38 -04:00
wq.h net/mlx5e: Allocate DMA coherent memory on reader NUMA node 2015-07-27 00:29:17 -07:00