hfi.h (4171a693a5159e47f72eea3331bebf538dea9b83) hfi.h (81cd3891f021b88319f7243715c30945aaabe9ea)
1#ifndef _HFI1_KERNEL_H
2#define _HFI1_KERNEL_H
3/*
4 * Copyright(c) 2015-2018 Intel Corporation.
5 *
6 * This file is provided under a dual BSD/GPLv2 license. When using or
7 * redistributing this file, you may do so under either license.
8 *

--- 319 unchanged lines hidden (view full) ---

328 void *ebuf;
329 void *hdr;
330 void *payload;
331 struct hfi1_ctxtdata *rcd;
332 __le32 *rhf_addr;
333 struct rvt_qp *qp;
334 struct ib_other_headers *ohdr;
335 struct ib_grh *grh;
1#ifndef _HFI1_KERNEL_H
2#define _HFI1_KERNEL_H
3/*
4 * Copyright(c) 2015-2018 Intel Corporation.
5 *
6 * This file is provided under a dual BSD/GPLv2 license. When using or
7 * redistributing this file, you may do so under either license.
8 *

--- 319 unchanged lines hidden (view full) ---

328 void *ebuf;
329 void *hdr;
330 void *payload;
331 struct hfi1_ctxtdata *rcd;
332 __le32 *rhf_addr;
333 struct rvt_qp *qp;
334 struct ib_other_headers *ohdr;
335 struct ib_grh *grh;
336 struct opa_16b_mgmt *mgmt;
336 u64 rhf;
337 u32 maxcnt;
338 u32 rhqoff;
339 u32 dlid;
340 u32 slid;
341 u16 tlen;
342 s16 etail;
343 u16 pkey;

--- 48 unchanged lines hidden (view full) ---

392 */
393#define OPA_16B_L4_9B 0x00
394#define OPA_16B_L2_TYPE 0x02
395#define OPA_16B_L4_FM 0x08
396#define OPA_16B_L4_IB_LOCAL 0x09
397#define OPA_16B_L4_IB_GLOBAL 0x0A
398#define OPA_16B_L4_ETHR OPA_VNIC_L4_ETHR
399
337 u64 rhf;
338 u32 maxcnt;
339 u32 rhqoff;
340 u32 dlid;
341 u32 slid;
342 u16 tlen;
343 s16 etail;
344 u16 pkey;

--- 48 unchanged lines hidden (view full) ---

393 */
394#define OPA_16B_L4_9B 0x00
395#define OPA_16B_L2_TYPE 0x02
396#define OPA_16B_L4_FM 0x08
397#define OPA_16B_L4_IB_LOCAL 0x09
398#define OPA_16B_L4_IB_GLOBAL 0x0A
399#define OPA_16B_L4_ETHR OPA_VNIC_L4_ETHR
400
401/*
402 * OPA 16B Management
403 */
404#define OPA_16B_L4_FM_PAD 3 /* fixed 3B pad */
405#define OPA_16B_L4_FM_HLEN 24 /* 16B(16) + L4_FM(8) */
406
400static inline u8 hfi1_16B_get_l4(struct hfi1_16b_header *hdr)
401{
402 return (u8)(hdr->lrh[2] & OPA_16B_L4_MASK);
403}
404
405static inline u8 hfi1_16B_get_sc(struct hfi1_16b_header *hdr)
406{
407 return (u8)((hdr->lrh[1] & OPA_16B_SC_MASK) >> OPA_16B_SC_SHIFT);

--- 60 unchanged lines hidden (view full) ---

468 */
469#define OPA_16B_BTH_PAD_MASK 7
470static inline u8 hfi1_16B_bth_get_pad(struct ib_other_headers *ohdr)
471{
472 return (u8)((be32_to_cpu(ohdr->bth[0]) >> IB_BTH_PAD_SHIFT) &
473 OPA_16B_BTH_PAD_MASK);
474}
475
407static inline u8 hfi1_16B_get_l4(struct hfi1_16b_header *hdr)
408{
409 return (u8)(hdr->lrh[2] & OPA_16B_L4_MASK);
410}
411
412static inline u8 hfi1_16B_get_sc(struct hfi1_16b_header *hdr)
413{
414 return (u8)((hdr->lrh[1] & OPA_16B_SC_MASK) >> OPA_16B_SC_SHIFT);

--- 60 unchanged lines hidden (view full) ---

475 */
476#define OPA_16B_BTH_PAD_MASK 7
477static inline u8 hfi1_16B_bth_get_pad(struct ib_other_headers *ohdr)
478{
479 return (u8)((be32_to_cpu(ohdr->bth[0]) >> IB_BTH_PAD_SHIFT) &
480 OPA_16B_BTH_PAD_MASK);
481}
482
483/*
484 * 16B Management
485 */
486#define OPA_16B_MGMT_QPN_MASK 0xFFFFFF
487static inline u32 hfi1_16B_get_dest_qpn(struct opa_16b_mgmt *mgmt)
488{
489 return be32_to_cpu(mgmt->dest_qpn) & OPA_16B_MGMT_QPN_MASK;
490}
491
492static inline u32 hfi1_16B_get_src_qpn(struct opa_16b_mgmt *mgmt)
493{
494 return be32_to_cpu(mgmt->src_qpn) & OPA_16B_MGMT_QPN_MASK;
495}
496
497static inline void hfi1_16B_set_qpn(struct opa_16b_mgmt *mgmt,
498 u32 dest_qp, u32 src_qp)
499{
500 mgmt->dest_qpn = cpu_to_be32(dest_qp & OPA_16B_MGMT_QPN_MASK);
501 mgmt->src_qpn = cpu_to_be32(src_qp & OPA_16B_MGMT_QPN_MASK);
502}
503
476struct rvt_sge_state;
477
478/*
479 * Get/Set IB link-level config parameters for f_get/set_ib_cfg()
480 * Mostly for MADs that set or query link parameters, also ipath
481 * config interfaces
482 */
483#define HFI1_IB_CFG_LIDLMC 0 /* LID (LS16b) and Mask (MS16b) */

--- 1976 unchanged lines hidden ---
504struct rvt_sge_state;
505
506/*
507 * Get/Set IB link-level config parameters for f_get/set_ib_cfg()
508 * Mostly for MADs that set or query link parameters, also ipath
509 * config interfaces
510 */
511#define HFI1_IB_CFG_LIDLMC 0 /* LID (LS16b) and Mask (MS16b) */

--- 1976 unchanged lines hidden ---