]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
import
authorSean Hefty <sean.hefty@intel.com>
Fri, 20 Jun 2014 17:49:24 +0000 (10:49 -0700)
committerSean Hefty <sean.hefty@intel.com>
Fri, 20 Jun 2014 17:49:24 +0000 (10:49 -0700)
meta
patches/librdmacm-trivial-cma-in-ucma_ [new file with mode: 0644]
patches/rsocket-add-support-for-rdma_r [new file with mode: 0644]

diff --git a/meta b/meta
index 84271186696d0590e5317a4b21a26bd6b68662bc..e58595ab805fd094c95bed0a227d55f445914f6f 100644 (file)
--- a/meta
+++ b/meta
@@ -1,7 +1,9 @@
 Version: 1
-Previous: 53090a8f894e273dc5e2d27e428c712128f94345
-Head: 106899eccc5fa61dd5e69c90bc0651ccd57e725f
+Previous: 7f3fe75165618bff267c5b35ac58c8cdf2350eb8
+Head: 6f396165f59e627ad8f50c015c3fc6686e04ca82
 Applied:
+  rsocket-add-support-for-rdma_r: b15aac4e41025f4db220e7efb0478bfbe72b832a
+  librdmacm-trivial-cma-in-ucma_: 6f396165f59e627ad8f50c015c3fc6686e04ca82
 Unapplied:
   old-af-ib: aaa0d9ca917c8c361a978e5a116963c2cceac5ba
   old-seterr: 47eb0c419687c2690292c1910acae83a46e5388c
diff --git a/patches/librdmacm-trivial-cma-in-ucma_ b/patches/librdmacm-trivial-cma-in-ucma_
new file mode 100644 (file)
index 0000000..679d4c0
--- /dev/null
@@ -0,0 +1,34 @@
+Bottom: 2490dec4b0d82730355b60c6be57f040b1e26505
+Top:    34e7fe6d90ff2e1271470ff705ad105d17a0e073
+Author: Hal Rosenstock <hal@dev.mellanox.co.il>
+Date:   2014-06-19 13:08:02 -0400
+
+[librdmacm,TRIVIAL] cma: In ucma_convert_path, fix selector values
+
+Intent is for the selectors to be equal to (exactly) rather than less than.
+Selector for exactly is value of 2 rather than 1.
+
+Signed-off-by: Hal Rosenstock <hal@mellanox.com>
+
+
+---
+
+diff --git a/src/cma.c b/src/cma.c
+index bedc95f..9a49a5b 100644
+--- a/src/cma.c
++++ b/src/cma.c
+@@ -701,11 +701,11 @@ static void ucma_convert_path(struct ibv_path_data *path_data,
+       sa_path->numb_path = 1;
+       sa_path->pkey = path_data->path.pkey;
+       sa_path->sl = ntohs(path_data->path.qosclass_sl) & 0xF;
+-      sa_path->mtu_selector = 1;
++      sa_path->mtu_selector = 2;      /* exactly */
+       sa_path->mtu = path_data->path.mtu & 0x1F;
+-      sa_path->rate_selector = 1;
++      sa_path->rate_selector = 2;
+       sa_path->rate = path_data->path.rate & 0x1F;
+-      sa_path->packet_life_time_selector = 1;
++      sa_path->packet_life_time_selector = 2;
+       sa_path->packet_life_time = path_data->path.packetlifetime & 0x1F;
+       sa_path->preference = (uint8_t) path_data->flags;
diff --git a/patches/rsocket-add-support-for-rdma_r b/patches/rsocket-add-support-for-rdma_r
new file mode 100644 (file)
index 0000000..be14fb8
--- /dev/null
@@ -0,0 +1,96 @@
+Bottom: 79f3da6e7d372faf3133c25289d9c3592f9b8b34
+Top:    2490dec4b0d82730355b60c6be57f040b1e26505
+Author: Hal Rosenstock <hal@dev.mellanox.co.il>
+Date:   2014-06-19 11:54:11 -0400
+
+rsocket: Add support for RDMA_ROUTE option in rgetsockopt
+
+Create as many ibv_path_data structs from the RDMA route
+ibv_sa_path_rec struct for the rsocket based on how
+many fit into the supplied buffer.
+
+Signed-off-by: Hal Rosenstock <hal@mellanox.com>
+
+
+---
+
+diff --git a/src/rsocket.c b/src/rsocket.c
+index 0e5635f..947e678 100644
+--- a/src/rsocket.c
++++ b/src/rsocket.c
+@@ -3500,11 +3500,38 @@ int rsetsockopt(int socket, int level, int optname,
+       return ret;
+ }
++static void rs_convert_sa_path(struct ibv_sa_path_rec *sa_path,
++                             struct ibv_path_data *path_data)
++{
++      uint32_t fl_hop;
++
++      memset(path_data, 0, sizeof(*path_data));
++      path_data->path.dgid = sa_path->dgid;
++      path_data->path.sgid = sa_path->sgid;
++      path_data->path.dlid = sa_path->dlid;
++      path_data->path.slid = sa_path->slid;
++      fl_hop = ntohl(sa_path->flow_label) << 8;
++      path_data->path.flowlabel_hoplimit = htonl(fl_hop) | sa_path->hop_limit;
++      path_data->path.tclass = sa_path->traffic_class;
++      path_data->path.reversible_numpath = sa_path->reversible << 7 | 1;
++      path_data->path.pkey = sa_path->pkey;
++      path_data->path.qosclass_sl = sa_path->sl;
++      path_data->path.mtu = sa_path->mtu | 2 << 6;    /* exactly */
++      path_data->path.rate = sa_path->rate | 2 << 6;
++      path_data->path.packetlifetime = sa_path->packet_life_time | 2 << 6;
++      path_data->flags= sa_path->preference;
++}
++
+ int rgetsockopt(int socket, int level, int optname,
+               void *optval, socklen_t *optlen)
+ {
+       struct rsocket *rs;
++      void *opt;
++      struct ibv_sa_path_rec *path_rec;
++      struct ibv_path_data path_data;
++      socklen_t len;
+       int ret = 0;
++      int num_paths;
+       rs = idm_lookup(&idm, socket);
+       if (!rs)
+@@ -3597,6 +3624,36 @@ int rgetsockopt(int socket, int level, int optname,
+                       *((int *) optval) = rs->target_iomap_size;
+                       *optlen = sizeof(int);
+                       break;
++              case RDMA_ROUTE:
++                      if (rs->optval) {
++                              if (*optlen < rs->optlen) {
++                                      ret = EINVAL;
++                              } else {
++                                      memcpy(rs->optval, optval, rs->optlen);
++                                      *optlen = rs->optlen;
++                              }
++                      } else {
++                              if (*optlen < sizeof(path_data)) {
++                                      ret = EINVAL;
++                              } else {
++                                      len = 0;
++                                      opt = optval;
++                                      path_rec = rs->cm_id->route.path_rec;
++                                      num_paths = 0;
++                                      while (len + sizeof(path_data) <= *optlen &&
++                                             num_paths < rs->cm_id->route.num_paths) {
++                                              rs_convert_sa_path(path_rec, &path_data);
++                                              memcpy(opt, &path_data, sizeof(path_data));
++                                              len += sizeof(path_data);
++                                              opt += sizeof(path_data);
++                                              path_rec++;
++                                              num_paths++;
++                                      }
++                                      *optlen = len;
++                                      ret = 0;
++                              }
++                      }
++                      break;
+               default:
+                       ret = ENOTSUP;
+                       break;