From 002b572aeb589c77831964033a087de6f5ad2faa Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Fri, 18 Jan 2013 15:49:48 -0800 Subject: [PATCH] refresh (create temporary patch) --- meta | 5 +- patches/refresh-temp | 113 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 patches/refresh-temp diff --git a/meta b/meta index 679f6de5..edd6f3cd 100644 --- a/meta +++ b/meta @@ -1,8 +1,9 @@ Version: 1 -Previous: 034123185157d0adbfd419f925d888c7b8bbdce9 -Head: 4fc1991fa0247d496e51fb34f2d7bc3977205cf7 +Previous: 4db5b3aa0adcf82c7806035b6bf5121e3fb63297 +Head: 47aaa94098e9407bf603ddb90791246f76696044 Applied: af-ib-conn: 4fc1991fa0247d496e51fb34f2d7bc3977205cf7 + refresh-temp: 47aaa94098e9407bf603ddb90791246f76696044 Unapplied: resv-rs-len: 7b6ff5c4894f54b221d877adcd709795dffb2fe9 rs-target-sgl: 7a07c80f2242e80c076dcf3ec6bb4c94626b284f diff --git a/patches/refresh-temp b/patches/refresh-temp new file mode 100644 index 00000000..89fa6558 --- /dev/null +++ b/patches/refresh-temp @@ -0,0 +1,113 @@ +Bottom: 1d1da945e49647331f04f82a45cc353e9541a6ae +Top: c3c95597a157fcea6aa3cbdacf6b26631247389b +Author: Sean Hefty +Date: 2013-01-18 15:49:48 -0800 + +Refresh of af-ib-conn + +--- + +diff --git a/include/rdma/rdma_cma.h b/include/rdma/rdma_cma.h +index 4c4a057..70f7f6b 100755 +--- a/include/rdma/rdma_cma.h ++++ b/include/rdma/rdma_cma.h +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #ifdef __cplusplus + extern "C" { +@@ -96,12 +97,14 @@ struct rdma_addr { + struct sockaddr src_addr; + struct sockaddr_in src_sin; + struct sockaddr_in6 src_sin6; ++ struct sockaddr_ib src_ib; + struct sockaddr_storage src_storage; + }; + union { + struct sockaddr dst_addr; + struct sockaddr_in dst_sin; + struct sockaddr_in6 dst_sin6; ++ struct sockaddr_ib dst_ib; + struct sockaddr_storage dst_storage; + }; + union { +diff --git a/src/acm.c b/src/acm.c +index c9ca5b5..187125f 100755 +--- a/src/acm.c ++++ b/src/acm.c +@@ -170,9 +170,6 @@ static int ucma_ib_set_connect(struct rdma_addrinfo *ib_rai, + { + struct ib_connect_hdr *hdr; + +- if (rai->ai_family == AF_IB) +- return 0; +- + hdr = calloc(1, sizeof *hdr); + if (!hdr) + return ERR(ENOMEM); +@@ -183,12 +180,21 @@ static int ucma_ib_set_connect(struct rdma_addrinfo *ib_rai, + &((struct sockaddr_in *) rai->ai_src_addr)->sin_addr, 4); + memcpy(&hdr->cma_dst_ip4, + &((struct sockaddr_in *) rai->ai_dst_addr)->sin_addr, 4); +- } else { ++ } else if (rai->ai_family == AF_INET6) { + hdr->ip_version = 6 << 4; + memcpy(&hdr->cma_src_ip6, + &((struct sockaddr_in6 *) rai->ai_src_addr)->sin6_addr, 16); + memcpy(&hdr->cma_dst_ip6, + &((struct sockaddr_in6 *) rai->ai_dst_addr)->sin6_addr, 16); ++ } else if (rai->ai_family == AF_IB) { ++ hdr->ip_version = 6 << 4; ++ memcpy(&hdr->cma_src_ip6, ++ &((struct sockaddr_ib *) rai->ai_src_addr)->sib_addr, 16); ++ memcpy(&hdr->cma_dst_ip6, ++ &((struct sockaddr_ib *) rai->ai_dst_addr)->sib_addr, 16); ++ } else { ++ free(hdr); ++ return ERR(EINVAL); + } + + ib_rai->ai_connect = hdr; +diff --git a/src/cma.c b/src/cma.c +index ff9b426..85f32eb 100755 +--- a/src/cma.c ++++ b/src/cma.c +@@ -1285,6 +1285,12 @@ static void ucma_copy_conn_param_to_kern(struct cma_id_private *id_priv, + if (id_priv->connect_len) { + memcpy(dst->private_data, id_priv->connect, id_priv->connect_len); + dst->private_data_len = id_priv->connect_len; ++ } else if (id_priv->id.route.addr.src_addr.sa_family == AF_IB) { ++ struct ib_connect_hdr *hdr = (struct ib_connect_hdr *) dst->private_data; ++ hdr->ip_version = 6 << 4; ++ memcpy(&hdr->cma_src_ip6, &id_priv->id.route.addr.src_ib.sib_addr, 16); ++ memcpy(&hdr->cma_dst_ip6, &id_priv->id.route.addr.dst_ib.sib_addr, 16); ++ dst->private_data_len = sizeof(*hdr); + } + + if (src) { +diff --git a/src/cma.h b/src/cma.h +index 7135a61..04bea01 100644 +--- a/src/cma.h ++++ b/src/cma.h +@@ -170,6 +170,18 @@ void ucma_ib_resolve(struct rdma_addrinfo **rai, struct rdma_addrinfo *hints); + #define ucma_ib_resolve(x, y) + #endif + ++struct ib_connect_hdr { ++ uint8_t cma_version; ++ uint8_t ip_version; /* IP version: 7:4 */ ++ uint16_t port; ++ uint32_t src_addr[4]; ++ uint32_t dst_addr[4]; ++#define cma_src_ip4 src_addr[3] ++#define cma_src_ip6 src_addr[0] ++#define cma_dst_ip4 dst_addr[3] ++#define cma_dst_ip6 dst_addr[0] ++}; ++ + /* Define path record definition if using older version of libibverbs */ + #ifdef DEFINE_PATH_RECORD + #define IBV_PATH_RECORD_REVERSIBLE 0x80 -- 2.46.0