diff options
-rw-r--r-- | drivers/infiniband/hw/hfi1/driver.c | 19 | ||||
-rw-r--r-- | drivers/infiniband/hw/hfi1/hfi.h | 8 | ||||
-rw-r--r-- | drivers/infiniband/hw/hfi1/ud.c | 4 |
3 files changed, 21 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c index 46d1475b2154..bd837a048bf4 100644 --- a/drivers/infiniband/hw/hfi1/driver.c +++ b/drivers/infiniband/hw/hfi1/driver.c | |||
@@ -433,31 +433,43 @@ void hfi1_process_ecn_slowpath(struct rvt_qp *qp, struct hfi1_packet *pkt, | |||
433 | bool do_cnp) | 433 | bool do_cnp) |
434 | { | 434 | { |
435 | struct hfi1_ibport *ibp = to_iport(qp->ibqp.device, qp->port_num); | 435 | struct hfi1_ibport *ibp = to_iport(qp->ibqp.device, qp->port_num); |
436 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); | ||
436 | struct ib_other_headers *ohdr = pkt->ohdr; | 437 | struct ib_other_headers *ohdr = pkt->ohdr; |
437 | struct ib_grh *grh = pkt->grh; | 438 | struct ib_grh *grh = pkt->grh; |
438 | u32 rqpn = 0, bth1; | 439 | u32 rqpn = 0, bth1; |
439 | u16 pkey, rlid, dlid = ib_get_dlid(pkt->hdr); | 440 | u16 pkey; |
441 | u32 rlid, slid, dlid = 0; | ||
440 | u8 hdr_type, sc, svc_type; | 442 | u8 hdr_type, sc, svc_type; |
441 | bool is_mcast = false; | 443 | bool is_mcast = false; |
442 | 444 | ||
445 | /* can be called from prescan */ | ||
443 | if (pkt->etype == RHF_RCV_TYPE_BYPASS) { | 446 | if (pkt->etype == RHF_RCV_TYPE_BYPASS) { |
444 | is_mcast = hfi1_is_16B_mcast(dlid); | 447 | is_mcast = hfi1_is_16B_mcast(dlid); |
445 | pkey = hfi1_16B_get_pkey(pkt->hdr); | 448 | pkey = hfi1_16B_get_pkey(pkt->hdr); |
446 | sc = hfi1_16B_get_sc(pkt->hdr); | 449 | sc = hfi1_16B_get_sc(pkt->hdr); |
450 | dlid = hfi1_16B_get_dlid(pkt->hdr); | ||
451 | slid = hfi1_16B_get_slid(pkt->hdr); | ||
447 | hdr_type = HFI1_PKT_TYPE_16B; | 452 | hdr_type = HFI1_PKT_TYPE_16B; |
448 | } else { | 453 | } else { |
449 | is_mcast = (dlid > be16_to_cpu(IB_MULTICAST_LID_BASE)) && | 454 | is_mcast = (dlid > be16_to_cpu(IB_MULTICAST_LID_BASE)) && |
450 | (dlid != be16_to_cpu(IB_LID_PERMISSIVE)); | 455 | (dlid != be16_to_cpu(IB_LID_PERMISSIVE)); |
451 | pkey = ib_bth_get_pkey(ohdr); | 456 | pkey = ib_bth_get_pkey(ohdr); |
452 | sc = hfi1_9B_get_sc5(pkt->hdr, pkt->rhf); | 457 | sc = hfi1_9B_get_sc5(pkt->hdr, pkt->rhf); |
458 | dlid = ib_get_dlid(pkt->hdr); | ||
459 | slid = ib_get_slid(pkt->hdr); | ||
453 | hdr_type = HFI1_PKT_TYPE_9B; | 460 | hdr_type = HFI1_PKT_TYPE_9B; |
454 | } | 461 | } |
455 | 462 | ||
456 | switch (qp->ibqp.qp_type) { | 463 | switch (qp->ibqp.qp_type) { |
464 | case IB_QPT_UD: | ||
465 | dlid = ppd->lid; | ||
466 | rlid = slid; | ||
467 | rqpn = ib_get_sqpn(pkt->ohdr); | ||
468 | svc_type = IB_CC_SVCTYPE_UD; | ||
469 | break; | ||
457 | case IB_QPT_SMI: | 470 | case IB_QPT_SMI: |
458 | case IB_QPT_GSI: | 471 | case IB_QPT_GSI: |
459 | case IB_QPT_UD: | 472 | rlid = slid; |
460 | rlid = ib_get_slid(pkt->hdr); | ||
461 | rqpn = ib_get_sqpn(pkt->ohdr); | 473 | rqpn = ib_get_sqpn(pkt->ohdr); |
462 | svc_type = IB_CC_SVCTYPE_UD; | 474 | svc_type = IB_CC_SVCTYPE_UD; |
463 | break; | 475 | break; |
@@ -482,7 +494,6 @@ void hfi1_process_ecn_slowpath(struct rvt_qp *qp, struct hfi1_packet *pkt, | |||
482 | dlid, rlid, sc, grh); | 494 | dlid, rlid, sc, grh); |
483 | 495 | ||
484 | if (!is_mcast && (bth1 & IB_BECN_SMASK)) { | 496 | if (!is_mcast && (bth1 & IB_BECN_SMASK)) { |
485 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); | ||
486 | u32 lqpn = bth1 & RVT_QPN_MASK; | 497 | u32 lqpn = bth1 & RVT_QPN_MASK; |
487 | u8 sl = ibp->sc_to_sl[sc]; | 498 | u8 sl = ibp->sc_to_sl[sc]; |
488 | 499 | ||
diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h index 32c48265405e..cac2c62bc42d 100644 --- a/drivers/infiniband/hw/hfi1/hfi.h +++ b/drivers/infiniband/hw/hfi1/hfi.h | |||
@@ -1537,13 +1537,13 @@ void set_link_ipg(struct hfi1_pportdata *ppd); | |||
1537 | void process_becn(struct hfi1_pportdata *ppd, u8 sl, u32 rlid, u32 lqpn, | 1537 | void process_becn(struct hfi1_pportdata *ppd, u8 sl, u32 rlid, u32 lqpn, |
1538 | u32 rqpn, u8 svc_type); | 1538 | u32 rqpn, u8 svc_type); |
1539 | void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, | 1539 | void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, |
1540 | u32 pkey, u32 slid, u32 dlid, u8 sc5, | 1540 | u16 pkey, u32 slid, u32 dlid, u8 sc5, |
1541 | const struct ib_grh *old_grh); | 1541 | const struct ib_grh *old_grh); |
1542 | void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, | 1542 | void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, |
1543 | u32 remote_qpn, u32 pkey, u32 slid, u32 dlid, | 1543 | u32 remote_qpn, u16 pkey, u32 slid, u32 dlid, |
1544 | u8 sc5, const struct ib_grh *old_grh); | 1544 | u8 sc5, const struct ib_grh *old_grh); |
1545 | typedef void (*hfi1_handle_cnp)(struct hfi1_ibport *ibp, struct rvt_qp *qp, | 1545 | typedef void (*hfi1_handle_cnp)(struct hfi1_ibport *ibp, struct rvt_qp *qp, |
1546 | u32 remote_qpn, u32 pkey, u32 slid, u32 dlid, | 1546 | u32 remote_qpn, u16 pkey, u32 slid, u32 dlid, |
1547 | u8 sc5, const struct ib_grh *old_grh); | 1547 | u8 sc5, const struct ib_grh *old_grh); |
1548 | 1548 | ||
1549 | #define PKEY_CHECK_INVALID -1 | 1549 | #define PKEY_CHECK_INVALID -1 |
@@ -2437,7 +2437,7 @@ static inline void hfi1_make_16b_hdr(struct hfi1_16b_header *hdr, | |||
2437 | ((slid >> OPA_16B_SLID_SHIFT) << OPA_16B_SLID_HIGH_SHIFT); | 2437 | ((slid >> OPA_16B_SLID_SHIFT) << OPA_16B_SLID_HIGH_SHIFT); |
2438 | lrh2 = (lrh2 & ~OPA_16B_DLID_MASK) | | 2438 | lrh2 = (lrh2 & ~OPA_16B_DLID_MASK) | |
2439 | ((dlid >> OPA_16B_DLID_SHIFT) << OPA_16B_DLID_HIGH_SHIFT); | 2439 | ((dlid >> OPA_16B_DLID_SHIFT) << OPA_16B_DLID_HIGH_SHIFT); |
2440 | lrh2 = (lrh2 & ~OPA_16B_PKEY_MASK) | (pkey << OPA_16B_PKEY_SHIFT); | 2440 | lrh2 = (lrh2 & ~OPA_16B_PKEY_MASK) | ((u32)pkey << OPA_16B_PKEY_SHIFT); |
2441 | lrh2 = (lrh2 & ~OPA_16B_L4_MASK) | l4; | 2441 | lrh2 = (lrh2 & ~OPA_16B_L4_MASK) | l4; |
2442 | 2442 | ||
2443 | hdr->lrh[0] = lrh0; | 2443 | hdr->lrh[0] = lrh0; |
diff --git a/drivers/infiniband/hw/hfi1/ud.c b/drivers/infiniband/hw/hfi1/ud.c index bcf3b0bebac8..69c17a5ef038 100644 --- a/drivers/infiniband/hw/hfi1/ud.c +++ b/drivers/infiniband/hw/hfi1/ud.c | |||
@@ -628,7 +628,7 @@ int hfi1_lookup_pkey_idx(struct hfi1_ibport *ibp, u16 pkey) | |||
628 | } | 628 | } |
629 | 629 | ||
630 | void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, | 630 | void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, |
631 | u32 remote_qpn, u32 pkey, u32 slid, u32 dlid, | 631 | u32 remote_qpn, u16 pkey, u32 slid, u32 dlid, |
632 | u8 sc5, const struct ib_grh *old_grh) | 632 | u8 sc5, const struct ib_grh *old_grh) |
633 | { | 633 | { |
634 | u64 pbc, pbc_flags = 0; | 634 | u64 pbc, pbc_flags = 0; |
@@ -687,7 +687,7 @@ void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, | |||
687 | } | 687 | } |
688 | 688 | ||
689 | void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, | 689 | void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, |
690 | u32 pkey, u32 slid, u32 dlid, u8 sc5, | 690 | u16 pkey, u32 slid, u32 dlid, u8 sc5, |
691 | const struct ib_grh *old_grh) | 691 | const struct ib_grh *old_grh) |
692 | { | 692 | { |
693 | u64 pbc, pbc_flags = 0; | 693 | u64 pbc, pbc_flags = 0; |