RoCE-v2 is a recently added extension to original RoCE protocol
it uses UDP encapsulation to achieve routability of RoCE packets.
This patch avails RoCE-v2 for userland applications.
Signed-off-by: Devesh Sharma <devesh.sharma@broadcom.com>
uint32_t rsvd_dest_qpn;
uint32_t qkey;
uint32_t rsvd_ahid;
- uint32_t rsvd;
+ uint32_t hdr_type;
} __attribute__ ((packed));
#endif /* __OCRDMA_ABI_H__ */
enum {
OCRDMA_AH_ID_MASK = 0x3FF,
OCRDMA_AH_VLAN_VALID_MASK = 0x01,
- OCRDMA_AH_VLAN_VALID_SHIFT = 0x1F
+ OCRDMA_AH_VLAN_VALID_SHIFT = 0x1F,
+ OCRDMA_AH_L3_TYPE_MASK = 0x03,
+ OCRDMA_AH_L3_TYPE_SHIFT = 0x1D
};
struct ocrdma_ah {
struct ocrdma_pd *pd;
uint16_t id;
uint8_t isvlan;
+ uint8_t hdr_type;
};
#define get_ocrdma_xxx(xxx, type) \
if (ah->isvlan)
hdr->cw |= (OCRDMA_FLAG_AH_VLAN_PR <<
OCRDMA_WQE_FLAGS_SHIFT);
+ ud_hdr->hdr_type = ah->hdr_type;
}
static void ocrdma_build_sges(struct ocrdma_hdr_wqe *hdr,
ah->id = pd->uctx->ah_tbl[ahtbl_idx] & OCRDMA_AH_ID_MASK;
ah->isvlan = (pd->uctx->ah_tbl[ahtbl_idx] >>
OCRDMA_AH_VLAN_VALID_SHIFT);
+ ah->hdr_type = ((pd->uctx->ah_tbl[ahtbl_idx] >> OCRDMA_AH_L3_TYPE_SHIFT)
+ & OCRDMA_AH_L3_TYPE_MASK);
+
return &ah->ibv_ah;
cmd_err:
ocrdma_free_ah_tbl_id(pd->uctx, ahtbl_idx);