From: Or Gerlitz Date: Wed, 10 Sep 2014 14:15:11 +0000 (+0300) Subject: mlx4: Fix wrong endianess access with QP context flags X-Git-Tag: firefly_0821_release~176^2~3193^2~40 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8e1a03b63c62bfa622c3989f8aead17ea845db7d;p=firefly-linux-kernel-4.4.55.git mlx4: Fix wrong endianess access with QP context flags We wrongly tested QP context bits without BE conversion as was spotted by sparse... drivers/infiniband/hw/mlx4/qp.c:1685:38: sparse: restricted __be32 degrades to integer Fix that! Fixes: d2fce8a ('mlx4: Set user-space raw Ethernet QPs to properly handle VXLAN traffic') Signed-off-by: Or Gerlitz Signed-off-by: David S. Miller --- diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index efb9eff8906c..836503927dea 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -1682,7 +1682,7 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp, MLX4_IB_LINK_TYPE_ETH; if (dev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) { /* set QP to receive both tunneled & non-tunneled packets */ - if (!(context->flags & (1 << MLX4_RSS_QPC_FLAG_OFFSET))) + if (!(context->flags & cpu_to_be32(1 << MLX4_RSS_QPC_FLAG_OFFSET))) context->srqn = cpu_to_be32(7 << 28); } }