Commit 834d16d6 authored by Devesh Sharma's avatar Devesh Sharma Committed by Doug Ledford

RDMA/ocrdma: Support user AH creation for RoCE-v2

This patch adds support to create RoCE-v2 compatible AH. It uses ahid
field to tell network-header-type to user space library. The library
has to decode network-header-type from ahid field.
Signed-off-by: default avatarSomnath Kotur <somnath.kotur@avagotech.com>
Signed-off-by: default avatarDevesh Sharma <devesh.sharma@avagotech.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent bcf117e2
...@@ -218,6 +218,11 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr) ...@@ -218,6 +218,11 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
ahid_addr = pd->uctx->ah_tbl.va + attr->dlid; ahid_addr = pd->uctx->ah_tbl.va + attr->dlid;
*ahid_addr = 0; *ahid_addr = 0;
*ahid_addr |= ah->id & OCRDMA_AH_ID_MASK; *ahid_addr |= ah->id & OCRDMA_AH_ID_MASK;
if (ocrdma_is_udp_encap_supported(dev)) {
*ahid_addr |= ((u32)ah->hdr_type &
OCRDMA_AH_L3_TYPE_MASK) <<
OCRDMA_AH_L3_TYPE_SHIFT;
}
if (isvlan) if (isvlan)
*ahid_addr |= (OCRDMA_AH_VLAN_VALID_MASK << *ahid_addr |= (OCRDMA_AH_VLAN_VALID_MASK <<
OCRDMA_AH_VLAN_VALID_SHIFT); OCRDMA_AH_VLAN_VALID_SHIFT);
......
...@@ -46,9 +46,10 @@ ...@@ -46,9 +46,10 @@
enum { enum {
OCRDMA_AH_ID_MASK = 0x3FF, OCRDMA_AH_ID_MASK = 0x3FF,
OCRDMA_AH_VLAN_VALID_MASK = 0x01, 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 /* 29 bits */
}; };
struct ib_ah *ocrdma_create_ah(struct ib_pd *, struct ib_ah_attr *); struct ib_ah *ocrdma_create_ah(struct ib_pd *, struct ib_ah_attr *);
int ocrdma_destroy_ah(struct ib_ah *); int ocrdma_destroy_ah(struct ib_ah *);
int ocrdma_query_ah(struct ib_ah *, struct ib_ah_attr *); int ocrdma_query_ah(struct ib_ah *, struct ib_ah_attr *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment