net/mlx4: Fix endianness issue in qp context params
authorTariq Toukan <tariqt@mellanox.com>
Mon, 9 Oct 2017 13:59:48 +0000 (16:59 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Oct 2017 17:33:05 +0000 (10:33 -0700)
Should take care of the endianness before assigning to params2 field.

Fixes: 53f33ae295a5 ("net/mlx4_core: Port aggregation upper layer interface")
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_resources.c
drivers/net/ethernet/mellanox/mlx4/qp.c
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c

index 5a47f9669621c25e153bfb97e5f88b500ee25e57..6883ac75d37f6a34ce6721db9a0ce1fe53618d05 100644 (file)
@@ -53,7 +53,7 @@ void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride,
        if (is_tx) {
                context->sq_size_stride = ilog2(size) << 3 | (ilog2(stride) - 4);
                if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PORT_REMAP)
-                       context->params2 |= MLX4_QP_BIT_FPP;
+                       context->params2 |= cpu_to_be32(MLX4_QP_BIT_FPP);
 
        } else {
                context->sq_size_stride = ilog2(TXBB_SIZE) - 4;
index 728a2fb1f5c09a99b31b812a53204de0a4c6b6eb..203320923340e4b52bb8fbe59334ebda18d234b2 100644 (file)
@@ -925,7 +925,7 @@ int mlx4_qp_to_ready(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
                context->flags &= cpu_to_be32(~(0xf << 28));
                context->flags |= cpu_to_be32(states[i + 1] << 28);
                if (states[i + 1] != MLX4_QP_STATE_RTR)
-                       context->params2 &= ~MLX4_QP_BIT_FPP;
+                       context->params2 &= ~cpu_to_be32(MLX4_QP_BIT_FPP);
                err = mlx4_qp_modify(dev, mtt, states[i], states[i + 1],
                                     context, 0, 0, qp);
                if (err) {
index fabb533797275f75965f037bf14f5a63d5c4b066..04304dd894c6c3119eb24302fe599766dadd3708 100644 (file)
@@ -3185,7 +3185,7 @@ static int verify_qp_parameters(struct mlx4_dev *dev,
        optpar  = be32_to_cpu(*(__be32 *) inbox->buf);
 
        if (slave != mlx4_master_func_num(dev)) {
-               qp_ctx->params2 &= ~MLX4_QP_BIT_FPP;
+               qp_ctx->params2 &= ~cpu_to_be32(MLX4_QP_BIT_FPP);
                /* setting QP rate-limit is disallowed for VFs */
                if (qp_ctx->rate_limit_params)
                        return -EPERM;