aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2006-11-16 15:48:35 -0800
committerRoland Dreier <rolandd@cisco.com>2006-11-16 15:48:35 -0800
commit633f2a309ec28b603fc480ff513cb3aeff9c2f54 (patch)
treeeb3ed8c0074fdba99bb6ef5c1e95d011b1760342
parent2d41bf8bd750e67080003aed290239c5b3ca8c5d (diff)
downloadlibmthca-633f2a309ec28b603fc480ff513cb3aeff9c2f54.tar.gz
Update to match new ibv_cmd_reg_mr() prototype
ibv_cmd_reg_mr() now takes extra parameters to allow low-level drivers to pass back a response. Add a test for the preprocessor define IBV_CMD_REG_MR_HAS_RESP_PARAMS, and if it exists, have libmthca match the new prototype. Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--src/verbs.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/verbs.c b/src/verbs.c
index cb218cf..ef1b52c 100644
--- a/src/verbs.c
+++ b/src/verbs.c
@@ -121,13 +121,24 @@ static struct ibv_mr *__mthca_reg_mr(struct ibv_pd *pd, void *addr,
{
struct ibv_mr *mr;
struct ibv_reg_mr cmd;
+ int ret;
mr = malloc(sizeof *mr);
if (!mr)
return NULL;
- if (ibv_cmd_reg_mr(pd, addr, length, hca_va,
- access, mr, &cmd, sizeof cmd)) {
+#ifdef IBV_CMD_REG_MR_HAS_RESP_PARAMS
+ {
+ struct ibv_reg_mr_resp resp;
+
+ ret = ibv_cmd_reg_mr(pd, addr, length, hca_va, access, mr,
+ &cmd, sizeof cmd, &resp, sizeof resp);
+ }
+#else
+ ret = ibv_cmd_reg_mr(pd, addr, length, hca_va, access, mr,
+ &cmd, sizeof cmd);
+#endif
+ if (ret) {
free(mr);
return NULL;
}