* [PATCH 1/4] RDMA/libocrdma: Add user space support for RoCE-v2
[not found] ` <1456386647-22315-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
@ 2016-02-25 7:50 ` Devesh Sharma
2016-02-25 7:50 ` [PATCH 2/4] RDMA/libocrdma: Fix compile time warnings Devesh Sharma
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Devesh Sharma @ 2016-02-25 7:50 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Devesh Sharma
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-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
src/ocrdma_abi.h | 2 +-
src/ocrdma_main.h | 5 ++++-
src/ocrdma_verbs.c | 4 ++++
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/ocrdma_abi.h b/src/ocrdma_abi.h
index 8102c1c..8670a1d 100644
--- a/src/ocrdma_abi.h
+++ b/src/ocrdma_abi.h
@@ -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__ */
diff --git a/src/ocrdma_main.h b/src/ocrdma_main.h
index 4e7be75..c81188b 100644
--- a/src/ocrdma_main.h
+++ b/src/ocrdma_main.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) \
diff --git a/src/ocrdma_verbs.c b/src/ocrdma_verbs.c
index cf6f72c..c62ced0 100644
--- a/src/ocrdma_verbs.c
+++ b/src/ocrdma_verbs.c
@@ -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);
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/4] RDMA/libocrdma: Fix compile time warnings
[not found] ` <1456386647-22315-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-02-25 7:50 ` [PATCH 1/4] RDMA/libocrdma: Add user space support for RoCE-v2 Devesh Sharma
@ 2016-02-25 7:50 ` Devesh Sharma
2016-02-25 7:50 ` [PATCH 3/4] RDMA/libocrdma: Remove async-event hook from context ops Devesh Sharma
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Devesh Sharma @ 2016-02-25 7:50 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Devesh Sharma
This patch fixes couple of build warnings.
Signed-off-by: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
src/ocrdma_verbs.c | 48 +++++++++++++-----------------------------------
1 file changed, 13 insertions(+), 35 deletions(-)
diff --git a/src/ocrdma_verbs.c b/src/ocrdma_verbs.c
index c62ced0..f04b3d6 100644
--- a/src/ocrdma_verbs.c
+++ b/src/ocrdma_verbs.c
@@ -453,41 +453,24 @@ cmd_err:
int ocrdma_modify_srq(struct ibv_srq *ibsrq,
struct ibv_srq_attr *attr, int attr_mask)
{
- int status;
- struct ocrdma_device *dev;
- struct ocrdma_srq *srq;
struct ibv_modify_srq cmd;
- srq = get_ocrdma_srq(ibsrq);
- dev = srq->dev;
-
- status = ibv_cmd_modify_srq(ibsrq, attr, attr_mask, &cmd, sizeof cmd);
- return status;
+ return ibv_cmd_modify_srq(ibsrq, attr, attr_mask, &cmd, sizeof cmd);
}
int ocrdma_query_srq(struct ibv_srq *ibsrq, struct ibv_srq_attr *attr)
{
- int status;
struct ibv_query_srq cmd;
- struct ocrdma_device *dev;
- struct ocrdma_srq *srq;
- srq = get_ocrdma_srq(ibsrq);
- dev = srq->dev;
- status = ibv_cmd_query_srq(ibsrq, attr, &cmd, sizeof cmd);
- return status;
+ return ibv_cmd_query_srq(ibsrq, attr, &cmd, sizeof cmd);
}
int ocrdma_destroy_srq(struct ibv_srq *ibsrq)
{
int status;
- int id;
struct ocrdma_srq *srq;
- struct ocrdma_device *dev;
srq = get_ocrdma_srq(ibsrq);
- dev = srq->dev;
- id = dev->id;
status = ibv_cmd_destroy_srq(ibsrq);
if (status)
return status;
@@ -668,6 +651,10 @@ enum ocrdma_qp_state get_ocrdma_qp_state(enum ibv_qp_state qps)
return OCRDMA_QPS_SQE;
case IBV_QPS_ERR:
return OCRDMA_QPS_ERR;
+ case IBV_QPS_UNKNOWN:
+ break;
+ default:
+ break;
};
return OCRDMA_QPS_ERR;
}
@@ -1096,10 +1083,9 @@ int ocrdma_destroy_qp(struct ibv_qp *ibqp)
int status = 0;
struct ocrdma_qp *qp;
struct ocrdma_device *dev;
- int id;
+
qp = get_ocrdma_qp(ibqp);
dev = qp->dev;
- id = dev->id;
/*
* acquire CQ lock while destroy is in progress, in order to
* protect against proessing in-flight CQEs for this QP.
@@ -2178,9 +2164,9 @@ int ocrdma_destroy_ah(struct ibv_ah *ibah)
{
int status;
struct ocrdma_ah *ah;
- struct ocrdma_device *dev;
+
ah = get_ocrdma_ah(ibah);
- dev = ah->pd->dev;
+
status = ibv_cmd_destroy_ah(ibah);
ocrdma_free_ah_tbl_id(ah->pd->uctx, ah->id);
free(ah);
@@ -2193,11 +2179,7 @@ int ocrdma_destroy_ah(struct ibv_ah *ibah)
int ocrdma_attach_mcast(struct ibv_qp *ibqp, const union ibv_gid *gid,
uint16_t lid)
{
- int status;
- struct ocrdma_qp *qp;
- qp = get_ocrdma_qp(ibqp);
- status = ibv_cmd_attach_mcast(ibqp, gid, lid);
- return status;
+ return ibv_cmd_attach_mcast(ibqp, gid, lid);
}
/*
@@ -2206,17 +2188,13 @@ int ocrdma_attach_mcast(struct ibv_qp *ibqp, const union ibv_gid *gid,
int ocrdma_detach_mcast(struct ibv_qp *ibqp, const union ibv_gid *gid,
uint16_t lid)
{
- int status;
- struct ocrdma_qp *qp;
- qp = get_ocrdma_qp(ibqp);
- status = ibv_cmd_detach_mcast(ibqp, gid, lid);
- return status;
+ return ibv_cmd_detach_mcast(ibqp, gid, lid);
}
void ocrdma_async_event(struct ibv_async_event *event)
{
- struct ocrdma_cq *cq = NULL;
- struct ocrdma_qp *qp = NULL;
+ struct ocrdma_cq *cq;
+ struct ocrdma_qp *qp;
switch (event->event_type) {
case IBV_EVENT_CQ_ERR:
cq = get_ocrdma_cq(event->element.cq);
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 3/4] RDMA/libocrdma: Remove async-event hook from context ops
[not found] ` <1456386647-22315-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-02-25 7:50 ` [PATCH 1/4] RDMA/libocrdma: Add user space support for RoCE-v2 Devesh Sharma
2016-02-25 7:50 ` [PATCH 2/4] RDMA/libocrdma: Fix compile time warnings Devesh Sharma
@ 2016-02-25 7:50 ` Devesh Sharma
2016-02-25 7:50 ` [PATCH 4/4] RDMA/libocrdma: Update libocrdma version string Devesh Sharma
2016-02-26 15:04 ` [PATCH 0/4] libocrdma update series Doug Ledford
4 siblings, 0 replies; 7+ messages in thread
From: Devesh Sharma @ 2016-02-25 7:50 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Devesh Sharma
libocrdma is not doing anything fruitful in ocrdma_async_event()
thus this hook is not required for us. Removing it.
Signed-off-by: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
src/ocrdma_main.c | 1 -
src/ocrdma_verbs.c | 28 ----------------------------
2 files changed, 29 deletions(-)
diff --git a/src/ocrdma_main.c b/src/ocrdma_main.c
index 4df6b99..5c494d8 100644
--- a/src/ocrdma_main.c
+++ b/src/ocrdma_main.c
@@ -94,7 +94,6 @@ static struct ibv_context_ops ocrdma_ctx_ops = {
.post_recv = ocrdma_post_recv,
.create_ah = ocrdma_create_ah,
.destroy_ah = ocrdma_destroy_ah,
- .async_event = ocrdma_async_event,
.create_srq = ocrdma_create_srq,
.modify_srq = ocrdma_modify_srq,
diff --git a/src/ocrdma_verbs.c b/src/ocrdma_verbs.c
index f04b3d6..5248e7e 100644
--- a/src/ocrdma_verbs.c
+++ b/src/ocrdma_verbs.c
@@ -2190,31 +2190,3 @@ int ocrdma_detach_mcast(struct ibv_qp *ibqp, const union ibv_gid *gid,
{
return ibv_cmd_detach_mcast(ibqp, gid, lid);
}
-
-void ocrdma_async_event(struct ibv_async_event *event)
-{
- struct ocrdma_cq *cq;
- struct ocrdma_qp *qp;
- switch (event->event_type) {
- case IBV_EVENT_CQ_ERR:
- cq = get_ocrdma_cq(event->element.cq);
- break;
- case IBV_EVENT_QP_FATAL:
- case IBV_EVENT_QP_REQ_ERR:
- case IBV_EVENT_QP_ACCESS_ERR:
- case IBV_EVENT_PATH_MIG_ERR:{
- qp = get_ocrdma_qp(event->element.qp);
- break;
- }
- case IBV_EVENT_SQ_DRAINED:
- case IBV_EVENT_PATH_MIG:
- case IBV_EVENT_COMM_EST:
- case IBV_EVENT_QP_LAST_WQE_REACHED:
- break;
- case IBV_EVENT_PORT_ACTIVE:
- case IBV_EVENT_PORT_ERR:
- break;
- default:
- break;
- }
-}
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 4/4] RDMA/libocrdma: Update libocrdma version string
[not found] ` <1456386647-22315-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
` (2 preceding siblings ...)
2016-02-25 7:50 ` [PATCH 3/4] RDMA/libocrdma: Remove async-event hook from context ops Devesh Sharma
@ 2016-02-25 7:50 ` Devesh Sharma
2016-02-26 15:04 ` [PATCH 0/4] libocrdma update series Doug Ledford
4 siblings, 0 replies; 7+ messages in thread
From: Devesh Sharma @ 2016-02-25 7:50 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Devesh Sharma
Updated version string from 1.0.6 to 1.0.7
Signed-off-by: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
configure.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.in b/configure.in
index 653bc43..c8f930b 100644
--- a/configure.in
+++ b/configure.in
@@ -1,11 +1,11 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
-AC_INIT(libocrdma, 1.0.6, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)
+AC_INIT(libocrdma, 1.0.7, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)
AC_CONFIG_SRCDIR([src/ocrdma_main.h])
AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(libocrdma, 1.0.6)
+AM_INIT_AUTOMAKE(libocrdma, 1.0.7)
AM_PROG_LIBTOOL
AC_ARG_ENABLE(libcheck, [ --disable-libcheck do not test for the presence of ib libraries],
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 0/4] libocrdma update series
[not found] ` <1456386647-22315-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
` (3 preceding siblings ...)
2016-02-25 7:50 ` [PATCH 4/4] RDMA/libocrdma: Update libocrdma version string Devesh Sharma
@ 2016-02-26 15:04 ` Doug Ledford
[not found] ` <56D06992.5030104-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
4 siblings, 1 reply; 7+ messages in thread
From: Doug Ledford @ 2016-02-26 15:04 UTC (permalink / raw)
To: Devesh Sharma, linux-rdma-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 985 bytes --]
On 02/25/2016 02:50 AM, Devesh Sharma wrote:
> This series includes couple of bug fixes and support for RoCE-v2
> for user space applicaitons.
>
> Patch 0001 adds support for RoCE-v2 to userland applications
>
> Patch 0002 and 0003 are bug fixes to avoid build warnings
>
> Patch 0004 updates the version string
>
> Devesh Sharma (4):
> RDMA/libocrdma: Add user space support for RoCE-v2
> RDMA/libocrdma: Fix compile time warnings
> RDMA/libocrdma: Remove async-event hook from context ops
> RDMA/libocrdma: Update libocrdma version string
>
> configure.in | 4 +--
> src/ocrdma_abi.h | 2 +-
> src/ocrdma_main.c | 1 -
> src/ocrdma_main.h | 5 +++-
> src/ocrdma_verbs.c | 76 +++++++++++-------------------------------------------
> 5 files changed, 22 insertions(+), 66 deletions(-)
>
Series looks reasonable to me.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread