aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/mlx4')
-rw-r--r--drivers/infiniband/hw/mlx4/cm.c2
-rw-r--r--drivers/infiniband/hw/mlx4/cq.c7
-rw-r--r--drivers/infiniband/hw/mlx4/main.c11
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c6
4 files changed, 13 insertions, 13 deletions
diff --git a/drivers/infiniband/hw/mlx4/cm.c b/drivers/infiniband/hw/mlx4/cm.c
index 56a593e0ae5d..39a488889fc7 100644
--- a/drivers/infiniband/hw/mlx4/cm.c
+++ b/drivers/infiniband/hw/mlx4/cm.c
@@ -372,7 +372,7 @@ int mlx4_ib_demux_cm_handler(struct ib_device *ibdev, int port, int *slave,
372 *slave = mlx4_ib_find_real_gid(ibdev, port, gid.global.interface_id); 372 *slave = mlx4_ib_find_real_gid(ibdev, port, gid.global.interface_id);
373 if (*slave < 0) { 373 if (*slave < 0) {
374 mlx4_ib_warn(ibdev, "failed matching slave_id by gid (0x%llx)\n", 374 mlx4_ib_warn(ibdev, "failed matching slave_id by gid (0x%llx)\n",
375 gid.global.interface_id); 375 be64_to_cpu(gid.global.interface_id));
376 return -ENOENT; 376 return -ENOENT;
377 } 377 }
378 return 0; 378 return 0;
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index 543ecdd8667b..0176caa5792c 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -369,8 +369,7 @@ int mlx4_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata)
369 int err; 369 int err;
370 370
371 mutex_lock(&cq->resize_mutex); 371 mutex_lock(&cq->resize_mutex);
372 372 if (entries < 1 || entries > dev->dev->caps.max_cqes) {
373 if (entries < 1) {
374 err = -EINVAL; 373 err = -EINVAL;
375 goto out; 374 goto out;
376 } 375 }
@@ -381,7 +380,7 @@ int mlx4_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata)
381 goto out; 380 goto out;
382 } 381 }
383 382
384 if (entries > dev->dev->caps.max_cqes) { 383 if (entries > dev->dev->caps.max_cqes + 1) {
385 err = -EINVAL; 384 err = -EINVAL;
386 goto out; 385 goto out;
387 } 386 }
@@ -394,7 +393,7 @@ int mlx4_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata)
394 /* Can't be smaller than the number of outstanding CQEs */ 393 /* Can't be smaller than the number of outstanding CQEs */
395 outst_cqe = mlx4_ib_get_outstanding_cqes(cq); 394 outst_cqe = mlx4_ib_get_outstanding_cqes(cq);
396 if (entries < outst_cqe + 1) { 395 if (entries < outst_cqe + 1) {
397 err = 0; 396 err = -EINVAL;
398 goto out; 397 goto out;
399 } 398 }
400 399
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index eb8e215f1613..ac6e2b710ea6 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -1269,8 +1269,7 @@ static int mlx4_ib_mcg_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
1269 struct mlx4_dev *dev = mdev->dev; 1269 struct mlx4_dev *dev = mdev->dev;
1270 struct mlx4_ib_qp *mqp = to_mqp(ibqp); 1270 struct mlx4_ib_qp *mqp = to_mqp(ibqp);
1271 struct mlx4_ib_steering *ib_steering = NULL; 1271 struct mlx4_ib_steering *ib_steering = NULL;
1272 enum mlx4_protocol prot = (gid->raw[1] == 0x0e) ? 1272 enum mlx4_protocol prot = MLX4_PROT_IB_IPV6;
1273 MLX4_PROT_IB_IPV4 : MLX4_PROT_IB_IPV6;
1274 struct mlx4_flow_reg_id reg_id; 1273 struct mlx4_flow_reg_id reg_id;
1275 1274
1276 if (mdev->dev->caps.steering_mode == 1275 if (mdev->dev->caps.steering_mode ==
@@ -1284,8 +1283,10 @@ static int mlx4_ib_mcg_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
1284 !!(mqp->flags & 1283 !!(mqp->flags &
1285 MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK), 1284 MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK),
1286 prot, &reg_id.id); 1285 prot, &reg_id.id);
1287 if (err) 1286 if (err) {
1287 pr_err("multicast attach op failed, err %d\n", err);
1288 goto err_malloc; 1288 goto err_malloc;
1289 }
1289 1290
1290 reg_id.mirror = 0; 1291 reg_id.mirror = 0;
1291 if (mlx4_is_bonded(dev)) { 1292 if (mlx4_is_bonded(dev)) {
@@ -1348,9 +1349,7 @@ static int mlx4_ib_mcg_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
1348 struct net_device *ndev; 1349 struct net_device *ndev;
1349 struct mlx4_ib_gid_entry *ge; 1350 struct mlx4_ib_gid_entry *ge;
1350 struct mlx4_flow_reg_id reg_id = {0, 0}; 1351 struct mlx4_flow_reg_id reg_id = {0, 0};
1351 1352 enum mlx4_protocol prot = MLX4_PROT_IB_IPV6;
1352 enum mlx4_protocol prot = (gid->raw[1] == 0x0e) ?
1353 MLX4_PROT_IB_IPV4 : MLX4_PROT_IB_IPV6;
1354 1353
1355 if (mdev->dev->caps.steering_mode == 1354 if (mdev->dev->caps.steering_mode ==
1356 MLX4_STEERING_MODE_DEVICE_MANAGED) { 1355 MLX4_STEERING_MODE_DEVICE_MANAGED) {
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index dfc6ca128a7e..ed2bd6701f9b 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1696,8 +1696,10 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
1696 qp->mlx4_ib_qp_type == MLX4_IB_QPT_PROXY_GSI || 1696 qp->mlx4_ib_qp_type == MLX4_IB_QPT_PROXY_GSI ||
1697 qp->mlx4_ib_qp_type == MLX4_IB_QPT_TUN_GSI) { 1697 qp->mlx4_ib_qp_type == MLX4_IB_QPT_TUN_GSI) {
1698 err = handle_eth_ud_smac_index(dev, qp, (u8 *)attr->smac, context); 1698 err = handle_eth_ud_smac_index(dev, qp, (u8 *)attr->smac, context);
1699 if (err) 1699 if (err) {
1700 return -EINVAL; 1700 err = -EINVAL;
1701 goto out;
1702 }
1701 if (qp->mlx4_ib_qp_type == MLX4_IB_QPT_PROXY_GSI) 1703 if (qp->mlx4_ib_qp_type == MLX4_IB_QPT_PROXY_GSI)
1702 dev->qp1_proxy[qp->port - 1] = qp; 1704 dev->qp1_proxy[qp->port - 1] = qp;
1703 } 1705 }