@@ -45,6 +45,14 @@
#include <rdma/rdma_cma.h>
#include <infiniband/ib.h>
+#ifdef IBV_XRC_OPS
+#define RDMA_QPT_XRC_SEND IBV_QPT_XRC_SEND
+#define RDMA_QPT_XRC_RECV IBV_QPT_XRC_RECV
+#else
+#define RDMA_QPT_XRC_SEND 0
+#define RDMA_QPT_XRC_RECV 0
+#endif
+
static void ucma_convert_to_ai(struct addrinfo *ai, struct rdma_addrinfo *rai)
{
memset(ai, 0, sizeof *ai);
@@ -54,6 +62,9 @@ static void ucma_convert_to_ai(struct addrinfo *ai, struct rdma_addrinfo *rai)
switch (rai->ai_qp_type) {
case IBV_QPT_RC:
+ case IBV_QPT_UC:
+ case RDMA_QPT_XRC_SEND:
+ case RDMA_QPT_XRC_RECV:
ai->ai_socktype = SOCK_STREAM;
break;
case IBV_QPT_UD:
@@ -96,13 +107,17 @@ static int ucma_convert_to_rai(struct rdma_addrinfo *rai,
rai->ai_family = ai->ai_family;
- switch (ai->ai_socktype) {
- case SOCK_STREAM:
- rai->ai_qp_type = IBV_QPT_RC;
- break;
- case SOCK_DGRAM:
- rai->ai_qp_type = IBV_QPT_UD;
- break;
+ if (hints && hints->ai_qp_type) {
+ rai->ai_qp_type = hints->ai_qp_type;
+ } else {
+ switch (ai->ai_socktype) {
+ case SOCK_STREAM:
+ rai->ai_qp_type = IBV_QPT_RC;
+ break;
+ case SOCK_DGRAM:
+ rai->ai_qp_type = IBV_QPT_UD;
+ break;
+ }
}
if (hints && hints->ai_port_space) {
Support XRC send/receive qp types. Signed-off-by: Sean Hefty <sean.hefty@intel.com> --- src/addrinfo.c | 29 ++++++++++++++++++++++------- 1 files changed, 22 insertions(+), 7 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html