IB/mlx4: Fix corruption of RoCEv2 IPv4 GIDs
authorJack Morgenstein <jackm@dev.mellanox.co.il>
Mon, 5 Mar 2018 18:09:45 +0000 (20:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:52:12 +0000 (07:52 +0200)
commit9636bbd409ba1df2c2cc69d12933f2107a92ab02
tree5de10f207f4e8f21fd7a4971b45a7f6af55093cd
parent7b10604ddf519affe0cf56dee1169523d7e060c3
IB/mlx4: Fix corruption of RoCEv2 IPv4 GIDs

[ Upstream commit 0077416a3d529baccbe07ab3242e8db541cfadf6 ]

When using IPv4 addresses in RoCEv2, the GID format for the mapped
IPv4 address should be: ::ffff:<4-byte IPv4 address>.

In the cited commit, IPv4 mapped IPV6 addresses had the 3 upper dwords
zeroed out by memset, which resulted in deleting the ffff field.

However, since procedure ipv6_addr_v4mapped() already verifies that the
gid has format ::ffff:<ipv4 address>, no change is needed for the gid,
and the memset can simply be removed.

Fixes: 7e57b85c444c ("IB/mlx4: Add support for setting RoCEv2 gids in hardware")
Reviewed-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/mlx4/main.c