mlx4: Fix wrong endianess access with QP context flags
authorOr Gerlitz <ogerlitz@mellanox.com>
Wed, 10 Sep 2014 14:15:11 +0000 (17:15 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Sep 2014 22:22:43 +0000 (15:22 -0700)
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 <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/infiniband/hw/mlx4/qp.c

index efb9eff8906c34845053ba04ced5dea9bfe8cbe4..836503927deae9dc14507331ac8b80d5a500fdbe 100644 (file)
@@ -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);
                }
        }