[openib-general] [PATCH 4/7] libehca: Update to match new ibv_cmd_reg_mr() prototype

Roland Dreier rolandd at cisco.com
Wed Jan 10 14:12:44 PST 2007


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
libehca match the new prototype.

Signed-off-by: Roland Dreier <rolandd at cisco.com>
---
 src/ehca_u_mrmw.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/ehca_u_mrmw.c b/src/ehca_u_mrmw.c
index a10017d..72ffbc6 100644
--- a/src/ehca_u_mrmw.c
+++ b/src/ehca_u_mrmw.c
@@ -65,8 +65,18 @@ struct ibv_mr *ehcau_reg_mr(struct ibv_pd *pd,
 		return NULL;
 	}
 
+#ifdef IBV_CMD_REG_MR_HAS_RESP_PARAMS
+	{
+		struct ibv_reg_mr_resp resp;
+
+		ret = ibv_cmd_reg_mr(pd, addr, length, (u64)(unsigned long)addr,
+				     access, mr, &cmd, sizeof(struct ibv_reg_mr),
+				     &resp, sizeof(struct ibv_reg_mr_resp));
+	}
+#else
 	ret = ibv_cmd_reg_mr(pd, addr, length, (u64)(unsigned long)addr,
 			     access, mr, &cmd, sizeof(struct ibv_reg_mr));
+#endif
 	if (ret) {
 		EDEB_ERR(4, "ibv_cmd_reg_mr ret=%x", ret);
 		free(mr);
-- 
1.4.4.1





More information about the general mailing list