Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26959
b: refs/heads/master
c: b228b43
h: refs/heads/master
i:
  26957: 7618af2
  26955: 61cb66c
  26951: 6f9ace7
  26943: 1a474f4
v: v3
  • Loading branch information
Bryan O'Sullivan authored and Roland Dreier committed May 23, 2006
1 parent d56af8c commit 376403a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ebac3800e5652063aa9491ef7fb4d57e089eb385
refs/heads/master: b228b43c491c53d1838e06f47a7470db9f84d899
32 changes: 17 additions & 15 deletions trunk/drivers/infiniband/hw/ipath/ipath_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ static void ipath_error_qp(struct ipath_qp *qp)
int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
int attr_mask)
{
struct ipath_ibdev *dev = to_idev(ibqp->device);
struct ipath_qp *qp = to_iqp(ibqp);
enum ib_qp_state cur_state, new_state;
unsigned long flags;
Expand All @@ -443,6 +444,19 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
attr_mask))
goto inval;

if (attr_mask & IB_QP_AV)
if (attr->ah_attr.dlid == 0 ||
attr->ah_attr.dlid >= IPS_MULTICAST_LID_BASE)
goto inval;

if (attr_mask & IB_QP_PKEY_INDEX)
if (attr->pkey_index >= ipath_layer_get_npkeys(dev->dd))
goto inval;

if (attr_mask & IB_QP_MIN_RNR_TIMER)
if (attr->min_rnr_timer > 31)
goto inval;

switch (new_state) {
case IB_QPS_RESET:
ipath_reset_qp(qp);
Expand All @@ -457,13 +471,8 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,

}

if (attr_mask & IB_QP_PKEY_INDEX) {
struct ipath_ibdev *dev = to_idev(ibqp->device);

if (attr->pkey_index >= ipath_layer_get_npkeys(dev->dd))
goto inval;
if (attr_mask & IB_QP_PKEY_INDEX)
qp->s_pkey_index = attr->pkey_index;
}

if (attr_mask & IB_QP_DEST_QPN)
qp->remote_qpn = attr->dest_qp_num;
Expand All @@ -479,12 +488,8 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
if (attr_mask & IB_QP_ACCESS_FLAGS)
qp->qp_access_flags = attr->qp_access_flags;

if (attr_mask & IB_QP_AV) {
if (attr->ah_attr.dlid == 0 ||
attr->ah_attr.dlid >= IPS_MULTICAST_LID_BASE)
goto inval;
if (attr_mask & IB_QP_AV)
qp->remote_ah_attr = attr->ah_attr;
}

if (attr_mask & IB_QP_PATH_MTU)
qp->path_mtu = attr->path_mtu;
Expand All @@ -499,11 +504,8 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
qp->s_rnr_retry_cnt = qp->s_rnr_retry;
}

if (attr_mask & IB_QP_MIN_RNR_TIMER) {
if (attr->min_rnr_timer > 31)
goto inval;
if (attr_mask & IB_QP_MIN_RNR_TIMER)
qp->s_min_rnr_timer = attr->min_rnr_timer;
}

if (attr_mask & IB_QP_QKEY)
qp->qkey = attr->qkey;
Expand Down

0 comments on commit 376403a

Please sign in to comment.