]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mlx4_ib: Fix endianness in blueflame post_send.
authorJack Morgenstein <jackm@dev.mellanox.co.il>
Thu, 10 Jul 2014 09:29:14 +0000 (12:29 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 21:45:21 +0000 (14:45 -0700)
commit03141e6041e9619bc39e74feb7c979a68aa6fb75
treed372466b7e5d6192b816a02f7af8b6938f4db589
parentd7544ddd20317ee9af98d8549871e8ff4155c413
mlx4_ib: Fix endianness in blueflame post_send.

qp object field doorbell_qpn was initialized using swab()
at qp creation.
swab() unconditionally swaps dword endianness. Thus, on
little-endian platforms the endianness of doorbell_qpn was
big endian; on big-endian platforms, doorbell_qpn is little-endian.

In post send blueflame, doorbell_qpn was taken as is (i.e., the
driver assumed that it was in big-endian format). This was OK
for little-endian hosts, but incorrect for big-endian hosts.

The fix is to use cpu_to_be32 when initializing doorbell_qpn (thus
guaranteeing that doorbell_qpn is in big-endian format on all
host types). This also requires modifying non-bf sends to
use __raw_writel (which does not do any endianness swapping)
instead of writel (which does endianness swapping on big-endian hosts).

The fix was developed by Shamir Rabinovitch of Oracle.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported by Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
drivers/infiniband/hw/mlx4/mlx4_ib.h
drivers/infiniband/hw/mlx4/qp.c
drivers/net/ethernet/mellanox/mlx4_vnic/vnic_qp.c