Skip to content

Commit f5956fa

Browse files
ogerlitzdavem330
authored andcommitted
net/mlx4_core: Fix wrong mask and error flow for the update-qp command
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 <[email protected]> Signed-off-by: Or Gerlitz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 38674a4 commit f5956fa

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

drivers/net/ethernet/mellanox/mlx4/qp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp, gfp_t gfp)
412412

413413
EXPORT_SYMBOL_GPL(mlx4_qp_alloc);
414414

415-
#define MLX4_UPDATE_QP_SUPPORTED_ATTRS MLX4_UPDATE_QP_SMAC
416415
int mlx4_update_qp(struct mlx4_dev *dev, u32 qpn,
417416
enum mlx4_update_qp_attr attr,
418417
struct mlx4_update_qp_params *params)

drivers/net/ethernet/mellanox/mlx4/resource_tracker.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ static int update_vport_qp_param(struct mlx4_dev *dev,
713713
struct mlx4_vport_oper_state *vp_oper;
714714
struct mlx4_priv *priv;
715715
u32 qp_type;
716-
int port;
716+
int port, err = 0;
717717

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

741-
mlx4_update_qp(dev, qpn, MLX4_UPDATE_QP_VSD, &params);
741+
err = mlx4_update_qp(dev, qpn, MLX4_UPDATE_QP_VSD, &params);
742+
if (err)
743+
goto out;
742744
}
743745
}
744746

@@ -773,7 +775,8 @@ static int update_vport_qp_param(struct mlx4_dev *dev,
773775
qpc->pri_path.feup |= MLX4_FSM_FORCE_ETH_SRC_MAC;
774776
qpc->pri_path.grh_mylmc = (0x80 & qpc->pri_path.grh_mylmc) + vp_oper->mac_idx;
775777
}
776-
return 0;
778+
out:
779+
return err;
777780
}
778781

779782
static int mpt_mask(struct mlx4_dev *dev)

include/linux/mlx4/qp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ struct mlx4_wqe_inline_seg {
427427

428428
enum mlx4_update_qp_attr {
429429
MLX4_UPDATE_QP_SMAC = 1 << 0,
430-
MLX4_UPDATE_QP_VSD = 1 << 2,
430+
MLX4_UPDATE_QP_VSD = 1 << 1,
431431
MLX4_UPDATE_QP_SUPPORTED_ATTRS = (1 << 2) - 1
432432
};
433433

0 commit comments

Comments
 (0)