Message ID | CAL1RGDXoVByoFadRiH7iRxWj9AdShEJtvpoj_5uNhkudGrwJPQ@mail.gmail.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
On Fri, 30 May 2014 15:43:39 -0700 Roland Dreier <roland@purestorage.com> wrote: > Looks like this is actually a bug... assuming you guys agree the patch > is correct, I'll add the following: > > commit 165cb465f73c (HEAD, mlx4) > Author: Roland Dreier <roland@purestorage.com> > Date: Fri May 30 15:38:58 2014 > > mlx4_core: Move handling of MLX4_QP_ST_MLX to proper switch > statement > > The handling of MLX4_QP_ST_MLX in verify_qp_parameters() was > accidentally put inside the inner switch statement (that handles > which transition of RC/UC/XRC QPs is happening). Fix this by moving > the case to the outer switch statement. > > The compiler pointed this out with: > > drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In > function 'verify_qp_parameters': > >> drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:2875:3: > warning: case value '7' not in enumerated type 'enum qp_transition' > [-Wswitch] > case MLX4_QP_ST_MLX: > > Reported-by: kbuild test robot <fengguang.wu@intel.com> > Fixes: 99ec41d0a48c ("mlx4: Add infrastructure for selecting VFs > to enable QP0 via MLX proxy QPs") > Signed-off-by: Roland Dreier <roland@purestorage.com> Acked-by: Jack Morgenstein <jackm@dev.mellanox.co.il> ---- Thanks, Roland! your fix is exactly right! -Jack -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index ad98162a8d79..10db83ee0e58 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c @@ -2872,25 +2872,25 @@ static int verify_qp_parameters(struct mlx4_dev *dev, return -EINVAL; } break; - case MLX4_QP_ST_MLX: - qpn = vhcr->in_modifier & 0x7fffff; - port = (qp_ctx->pri_path.sched_queue >> 6 & 1) + 1; - if (transition == QP_TRANS_INIT2RTR && - slave != mlx4_master_func_num(dev) && - mlx4_is_qp_reserved(dev, qpn) && - !mlx4_vf_smi_enabled(dev, slave, port)) { - /* only enabled VFs may create MLX proxy QPs */ - mlx4_err(dev, "%s: unprivileged slave %d attempting to create an MLX proxy special QP on port %d\n", - __func__, slave, port); - return -EPERM; - } - break; - default: break; } + break; + case MLX4_QP_ST_MLX: + qpn = vhcr->in_modifier & 0x7fffff; + port = (qp_ctx->pri_path.sched_queue >> 6 & 1) + 1; + if (transition == QP_TRANS_INIT2RTR && + slave != mlx4_master_func_num(dev) && + mlx4_is_qp_reserved(dev, qpn) && + !mlx4_vf_smi_enabled(dev, slave, port)) { + /* only enabled VFs may create MLX proxy QPs */ + mlx4_err(dev, "%s: unprivileged slave %d attempting to create an MLX proxy special QP on port %d\n", + __func__, slave, port); + return -EPERM; + } break; + default: