aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index c4b74dbc16f2..361c6ce3a9ff 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -1196,10 +1196,6 @@ int mthca_alloc_qp(struct mthca_dev *dev,
1196{ 1196{
1197 int err; 1197 int err;
1198 1198
1199 err = mthca_set_qp_size(dev, cap, pd, qp);
1200 if (err)
1201 return err;
1202
1203 switch (type) { 1199 switch (type) {
1204 case IB_QPT_RC: qp->transport = RC; break; 1200 case IB_QPT_RC: qp->transport = RC; break;
1205 case IB_QPT_UC: qp->transport = UC; break; 1201 case IB_QPT_UC: qp->transport = UC; break;
@@ -1207,6 +1203,10 @@ int mthca_alloc_qp(struct mthca_dev *dev,
1207 default: return -EINVAL; 1203 default: return -EINVAL;
1208 } 1204 }
1209 1205
1206 err = mthca_set_qp_size(dev, cap, pd, qp);
1207 if (err)
1208 return err;
1209
1210 qp->qpn = mthca_alloc(&dev->qp_table.alloc); 1210 qp->qpn = mthca_alloc(&dev->qp_table.alloc);
1211 if (qp->qpn == -1) 1211 if (qp->qpn == -1)
1212 return -ENOMEM; 1212 return -ENOMEM;
@@ -1239,6 +1239,7 @@ int mthca_alloc_sqp(struct mthca_dev *dev,
1239 u32 mqpn = qpn * 2 + dev->qp_table.sqp_start + port - 1; 1239 u32 mqpn = qpn * 2 + dev->qp_table.sqp_start + port - 1;
1240 int err; 1240 int err;
1241 1241
1242 sqp->qp.transport = MLX;
1242 err = mthca_set_qp_size(dev, cap, pd, &sqp->qp); 1243 err = mthca_set_qp_size(dev, cap, pd, &sqp->qp);
1243 if (err) 1244 if (err)
1244 return err; 1245 return err;