Skip to content

Commit

Permalink
net/mlx4_core: Fix wrong mask and error flow for the update-qp command
Browse files Browse the repository at this point in the history
The bit mask for currently supported driver features (MLX4_UPDATE_QP_SUPPORTED_ATTRS)
of the update-qp command was defined twice (using enum value and pre-processor
define directive) and wrong.

The return value of the call to mlx4_update_qp() from within the SRIOV
resource-tracker was wrongly voided down.

Fix both issues.

issue: none
Fixes: 09e05c3 ('net/mlx4: Set vlan stripping policy by the right command')
Fixes: ce8d9e0 ('net/mlx4_core: Add UPDATE_QP SRIOV wrapper support')
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
ogerlitz authored and davem330 committed Mar 2, 2015
1 parent 38674a4 commit f5956fa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion drivers/net/ethernet/mellanox/mlx4/qp.c
Expand Up @@ -412,7 +412,6 @@ int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp, gfp_t gfp)

EXPORT_SYMBOL_GPL(mlx4_qp_alloc);

#define MLX4_UPDATE_QP_SUPPORTED_ATTRS MLX4_UPDATE_QP_SMAC
int mlx4_update_qp(struct mlx4_dev *dev, u32 qpn,
enum mlx4_update_qp_attr attr,
struct mlx4_update_qp_params *params)
Expand Down
9 changes: 6 additions & 3 deletions drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
Expand Up @@ -713,7 +713,7 @@ static int update_vport_qp_param(struct mlx4_dev *dev,
struct mlx4_vport_oper_state *vp_oper;
struct mlx4_priv *priv;
u32 qp_type;
int port;
int port, err = 0;

port = (qpc->pri_path.sched_queue & 0x40) ? 2 : 1;
priv = mlx4_priv(dev);
Expand All @@ -738,7 +738,9 @@ static int update_vport_qp_param(struct mlx4_dev *dev,
} else {
struct mlx4_update_qp_params params = {.flags = 0};

mlx4_update_qp(dev, qpn, MLX4_UPDATE_QP_VSD, &params);
err = mlx4_update_qp(dev, qpn, MLX4_UPDATE_QP_VSD, &params);
if (err)
goto out;
}
}

Expand Down Expand Up @@ -773,7 +775,8 @@ static int update_vport_qp_param(struct mlx4_dev *dev,
qpc->pri_path.feup |= MLX4_FSM_FORCE_ETH_SRC_MAC;
qpc->pri_path.grh_mylmc = (0x80 & qpc->pri_path.grh_mylmc) + vp_oper->mac_idx;
}
return 0;
out:
return err;
}

static int mpt_mask(struct mlx4_dev *dev)
Expand Down
2 changes: 1 addition & 1 deletion include/linux/mlx4/qp.h
Expand Up @@ -427,7 +427,7 @@ struct mlx4_wqe_inline_seg {

enum mlx4_update_qp_attr {
MLX4_UPDATE_QP_SMAC = 1 << 0,
MLX4_UPDATE_QP_VSD = 1 << 2,
MLX4_UPDATE_QP_VSD = 1 << 1,
MLX4_UPDATE_QP_SUPPORTED_ATTRS = (1 << 2) - 1
};

Expand Down

0 comments on commit f5956fa

Please sign in to comment.