Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272355
b: refs/heads/master
c: 9fd5473
h: refs/heads/master
i:
  272353: 8895a29
  272351: 6c74da5
v: v3
  • Loading branch information
Mike Marciniszyn authored and Roland Dreier committed Oct 21, 2011
1 parent c7a2d95 commit 4074ad8
Show file tree
Hide file tree
Showing 5 changed files with 9 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: d0f2faf72d51dacf5c5e8dec7dca22d0395896e2
refs/heads/master: 9fd5473deb421eb7e5575a5f9d7e43ca67c04fe9
5 changes: 0 additions & 5 deletions trunk/drivers/infiniband/hw/qib/qib_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ static u32 qib_rcv_hdrerr(struct qib_ctxtdata *rcd, struct qib_pportdata *ppd,
u32 opcode;
u32 psn;
int diff;
unsigned long flags;

/* Sanity check packet */
if (tlen < 24)
Expand Down Expand Up @@ -365,19 +364,15 @@ static u32 qib_rcv_hdrerr(struct qib_ctxtdata *rcd, struct qib_pportdata *ppd,

switch (qp->ibqp.qp_type) {
case IB_QPT_RC:
spin_lock_irqsave(&qp->s_lock, flags);
ruc_res =
qib_ruc_check_hdr(
ibp, hdr,
lnh == QIB_LRH_GRH,
qp,
be32_to_cpu(ohdr->bth[0]));
if (ruc_res) {
spin_unlock_irqrestore(&qp->s_lock,
flags);
goto unlock;
}
spin_unlock_irqrestore(&qp->s_lock, flags);

/* Only deal with RDMA Writes for now */
if (opcode <
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/infiniband/hw/qib/qib_rc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1889,10 +1889,8 @@ void qib_rc_rcv(struct qib_ctxtdata *rcd, struct qib_ib_header *hdr,
}

opcode = be32_to_cpu(ohdr->bth[0]);
spin_lock_irqsave(&qp->s_lock, flags);
if (qib_ruc_check_hdr(ibp, hdr, has_grh, qp, opcode))
goto sunlock;
spin_unlock_irqrestore(&qp->s_lock, flags);
return;

psn = be32_to_cpu(ohdr->bth[2]);
opcode >>= 24;
Expand Down
7 changes: 6 additions & 1 deletion trunk/drivers/infiniband/hw/qib/qib_ruc.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,15 @@ static int gid_ok(union ib_gid *gid, __be64 gid_prefix, __be64 id)

/*
*
* This should be called with the QP s_lock held.
* This should be called with the QP r_lock held.
*
* The s_lock will be acquired around the qib_migrate_qp() call.
*/
int qib_ruc_check_hdr(struct qib_ibport *ibp, struct qib_ib_header *hdr,
int has_grh, struct qib_qp *qp, u32 bth0)
{
__be64 guid;
unsigned long flags;

if (qp->s_mig_state == IB_MIG_ARMED && (bth0 & IB_BTH_MIG_REQ)) {
if (!has_grh) {
Expand Down Expand Up @@ -295,7 +298,9 @@ int qib_ruc_check_hdr(struct qib_ibport *ibp, struct qib_ib_header *hdr,
if (be16_to_cpu(hdr->lrh[3]) != qp->alt_ah_attr.dlid ||
ppd_from_ibp(ibp)->port != qp->alt_ah_attr.port_num)
goto err;
spin_lock_irqsave(&qp->s_lock, flags);
qib_migrate_qp(qp);
spin_unlock_irqrestore(&qp->s_lock, flags);
} else {
if (!has_grh) {
if (qp->remote_ah_attr.ah_flags & IB_AH_GRH)
Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/infiniband/hw/qib/qib_uc.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ void qib_uc_rcv(struct qib_ibport *ibp, struct qib_ib_header *hdr,
int has_grh, void *data, u32 tlen, struct qib_qp *qp)
{
struct qib_other_headers *ohdr;
unsigned long flags;
u32 opcode;
u32 hdrsize;
u32 psn;
Expand All @@ -263,10 +262,8 @@ void qib_uc_rcv(struct qib_ibport *ibp, struct qib_ib_header *hdr,
}

opcode = be32_to_cpu(ohdr->bth[0]);
spin_lock_irqsave(&qp->s_lock, flags);
if (qib_ruc_check_hdr(ibp, hdr, has_grh, qp, opcode))
goto sunlock;
spin_unlock_irqrestore(&qp->s_lock, flags);
return;

psn = be32_to_cpu(ohdr->bth[2]);
opcode >>= 24;
Expand Down Expand Up @@ -554,6 +551,4 @@ void qib_uc_rcv(struct qib_ibport *ibp, struct qib_ib_header *hdr,
qib_rc_error(qp, IB_WC_LOC_QP_OP_ERR);
return;

sunlock:
spin_unlock_irqrestore(&qp->s_lock, flags);
}

0 comments on commit 4074ad8

Please sign in to comment.