@@ -350,7 +350,7 @@ struct ocrdma_ewqe_ud_hdr {
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__ */
@@ -214,7 +214,9 @@ struct ocrdma_qp {
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 {
@@ -222,6 +224,7 @@ struct ocrdma_ah {
struct ocrdma_pd *pd;
uint16_t id;
uint8_t isvlan;
+ uint8_t hdr_type;
};
#define get_ocrdma_xxx(xxx, type) \
@@ -1199,6 +1199,7 @@ static void ocrdma_build_ud_hdr(struct ocrdma_qp *qp,
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,
@@ -2159,6 +2160,9 @@ struct ibv_ah *ocrdma_create_ah(struct ibv_pd *ibpd, struct ibv_ah_attr *attr)
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);
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> --- src/ocrdma_abi.h | 2 +- src/ocrdma_main.h | 5 ++++- src/ocrdma_verbs.c | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-)