summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/ruc.c
diff options
context:
space:
mode:
authorDon Hiatt2017-08-04 22:54:10 +0200
committerDoug Ledford2017-08-22 20:22:37 +0200
commit5786adf3fde7aa22a68eedac9c59e40da76ffbfb (patch)
treedfa52895b4f06e5eae1c1db86c51a8a946380c35 /drivers/infiniband/hw/hfi1/ruc.c
parentIB/hfi1: Add support to send 16B bypass packets (diff)
downloadkernel-qcow2-linux-5786adf3fde7aa22a68eedac9c59e40da76ffbfb.tar.gz
kernel-qcow2-linux-5786adf3fde7aa22a68eedac9c59e40da76ffbfb.tar.xz
kernel-qcow2-linux-5786adf3fde7aa22a68eedac9c59e40da76ffbfb.zip
IB/hfi1: Add support to process 16B header errors
Enhance hdr_rcverr() to also handle errors during 16B bypass packet receive. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Don Hiatt <don.hiatt@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/ruc.c')
-rw-r--r--drivers/infiniband/hw/hfi1/ruc.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/infiniband/hw/hfi1/ruc.c b/drivers/infiniband/hw/hfi1/ruc.c
index e30c64fcce67..d252f8f2207a 100644
--- a/drivers/infiniband/hw/hfi1/ruc.c
+++ b/drivers/infiniband/hw/hfi1/ruc.c
@@ -227,15 +227,23 @@ int hfi1_ruc_check_hdr(struct hfi1_ibport *ibp, struct hfi1_packet *packet)
u32 sl = packet->sl;
int migrated;
u32 bth0, bth1;
+ u16 pkey;
bth0 = be32_to_cpu(packet->ohdr->bth[0]);
bth1 = be32_to_cpu(packet->ohdr->bth[1]);
- migrated = bth0 & IB_BTH_MIG_REQ;
+ if (packet->etype == RHF_RCV_TYPE_BYPASS) {
+ pkey = hfi1_16B_get_pkey(packet->hdr);
+ migrated = bth1 & OPA_BTH_MIG_REQ;
+ } else {
+ pkey = ib_bth_get_pkey(packet->ohdr);
+ migrated = bth0 & IB_BTH_MIG_REQ;
+ }
if (qp->s_mig_state == IB_MIG_ARMED && migrated) {
if (!packet->grh) {
- if (rdma_ah_get_ah_flags(&qp->alt_ah_attr) &
- IB_AH_GRH)
+ if ((rdma_ah_get_ah_flags(&qp->alt_ah_attr) &
+ IB_AH_GRH) &&
+ (packet->etype != RHF_RCV_TYPE_BYPASS))
return 1;
} else {
const struct ib_global_route *grh;
@@ -254,10 +262,10 @@ int hfi1_ruc_check_hdr(struct hfi1_ibport *ibp, struct hfi1_packet *packet)
grh->dgid.global.interface_id))
return 1;
}
- if (unlikely(rcv_pkey_check(ppd_from_ibp(ibp), (u16)bth0,
+ if (unlikely(rcv_pkey_check(ppd_from_ibp(ibp), pkey,
sc5, slid))) {
- hfi1_bad_pkey(ibp, (u16)bth0, sl,
- 0, qp->ibqp.qp_num, slid, dlid);
+ hfi1_bad_pkey(ibp, pkey, sl, 0, qp->ibqp.qp_num,
+ slid, dlid);
return 1;
}
/* Validate the SLID. See Ch. 9.6.1.5 and 17.2.8 */
@@ -270,8 +278,9 @@ int hfi1_ruc_check_hdr(struct hfi1_ibport *ibp, struct hfi1_packet *packet)
spin_unlock_irqrestore(&qp->s_lock, flags);
} else {
if (!packet->grh) {
- if (rdma_ah_get_ah_flags(&qp->remote_ah_attr) &
- IB_AH_GRH)
+ if ((rdma_ah_get_ah_flags(&qp->remote_ah_attr) &
+ IB_AH_GRH) &&
+ (packet->etype != RHF_RCV_TYPE_BYPASS))
return 1;
} else {
const struct ib_global_route *grh;
@@ -290,10 +299,10 @@ int hfi1_ruc_check_hdr(struct hfi1_ibport *ibp, struct hfi1_packet *packet)
grh->dgid.global.interface_id))
return 1;
}
- if (unlikely(rcv_pkey_check(ppd_from_ibp(ibp), (u16)bth0,
+ if (unlikely(rcv_pkey_check(ppd_from_ibp(ibp), pkey,
sc5, slid))) {
- hfi1_bad_pkey(ibp, (u16)bth0, sl,
- 0, qp->ibqp.qp_num, slid, dlid);
+ hfi1_bad_pkey(ibp, pkey, sl, 0, qp->ibqp.qp_num,
+ slid, dlid);
return 1;
}
/* Validate the SLID. See Ch. 9.6.1.5 */