diff options
| author | Ingo Molnar <mingo@kernel.org> | 2019-06-24 19:19:53 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2019-06-24 19:19:53 +0200 |
| commit | d2abae71ebcc409828b24ce9da402548ecdf1311 (patch) | |
| tree | 5edfafc2828d3bcebb3698520ccba374cd4328c0 /drivers/infiniband/hw/hfi1/hfi.h | |
| parent | 66567fcbaecac455caa1b13643155d686b51ce63 (diff) | |
| parent | 4b972a01a7da614b4796475f933094751a295a2f (diff) | |
| download | linux-d2abae71ebcc409828b24ce9da402548ecdf1311.tar.gz linux-d2abae71ebcc409828b24ce9da402548ecdf1311.tar.bz2 linux-d2abae71ebcc409828b24ce9da402548ecdf1311.zip | |
Merge tag 'v5.2-rc6' into sched/core, to refresh the branch
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/hfi.h')
| -rw-r--r-- | drivers/infiniband/hw/hfi1/hfi.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h index b458c218842b..fa45350a9a1d 100644 --- a/drivers/infiniband/hw/hfi1/hfi.h +++ b/drivers/infiniband/hw/hfi1/hfi.h @@ -539,6 +539,37 @@ static inline void hfi1_16B_set_qpn(struct opa_16b_mgmt *mgmt, mgmt->src_qpn = cpu_to_be32(src_qp & OPA_16B_MGMT_QPN_MASK); } +/** + * hfi1_get_rc_ohdr - get extended header + * @opah - the opaheader + */ +static inline struct ib_other_headers * +hfi1_get_rc_ohdr(struct hfi1_opa_header *opah) +{ + struct ib_other_headers *ohdr; + struct ib_header *hdr = NULL; + struct hfi1_16b_header *hdr_16b = NULL; + + /* Find out where the BTH is */ + if (opah->hdr_type == HFI1_PKT_TYPE_9B) { + hdr = &opah->ibh; + if (ib_get_lnh(hdr) == HFI1_LRH_BTH) + ohdr = &hdr->u.oth; + else + ohdr = &hdr->u.l.oth; + } else { + u8 l4; + + hdr_16b = &opah->opah; + l4 = hfi1_16B_get_l4(hdr_16b); + if (l4 == OPA_16B_L4_IB_LOCAL) + ohdr = &hdr_16b->u.oth; + else + ohdr = &hdr_16b->u.l.oth; + } + return ohdr; +} + struct rvt_sge_state; /* |
