linux-stable/drivers/net
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
..
appletalk
arcnet
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-09-12 15:52:44 -07:00
caif
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-10-02 22:20:41 -04:00
cris
dsa treewide: remove redundant #include <linux/kconfig.h> 2016-10-11 15:06:33 -07:00
ethernet net/mlx5: Add MLX5_ARRAY_SET64 to fix BUILD_BUG_ON 2016-10-13 10:13:24 -04:00
fddi
fjes
hamradio 6pack: fix buffer length mishandling 2016-09-20 22:51:30 -04:00
hippi
hyperv hv_netvsc: fix comments 2016-09-24 09:36:12 -04:00
ieee802154 fakelb: fix schedule while atomic 2016-09-19 20:19:34 +02:00
ipvlan ipvlan: Introduce l3s mode 2016-09-19 01:25:22 -04:00
irda
phy drivers: net: phy: Correct duplicate MDIO_XGENE entry 2016-10-06 21:15:42 -04:00
plip
ppp ppp: declare PPP devices as LLTX 2016-08-31 14:33:09 -07:00
slip
team team: loadbalance: push lacpdus to exact delivery 2016-08-26 13:08:59 -07:00
usb qmi_wwan: add support for Quectel EC21 and EC25 2016-10-13 10:05:06 -04:00
vmxnet3 vmxnet3: Wake queue from reset work 2016-10-04 00:36:13 -04:00
wan wan/fsl_ucc_hdlc: Fix size used in dma_free_coherent() 2016-10-08 00:04:48 -04:00
wimax
wireless Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-10-10 13:04:49 -07:00
xen-netback xen-netback: (re-)create a debugfs node for hash information 2016-10-13 09:53:09 -04:00
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
Kconfig ipvlan: Fix dependency issue 2016-09-20 22:55:23 -04:00
LICENSE.SRC
loopback.c
macsec.c macsec: set network devtype 2016-09-09 16:52:43 -07:00
macvlan.c
macvtap.c
Makefile
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-08-30 00:54:02 -04:00
veth.c net: veth: Set features for MPLS 2016-08-30 22:27:18 -07:00
virtio_net.c net/virtio-net: Convert to hotplug state machine 2016-09-02 20:05:06 +02:00
vrf.c net: vrf: Remove RT_FL_TOS 2016-09-17 10:05:05 -04:00
vxlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-09-12 15:52:44 -07:00
xen-netfront.c xen-netfront: avoid packet loss when ethernet header crosses page boundary 2016-09-20 04:40:41 -04:00