<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>2/2 libibverbs + libmthca changes for query QP</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">note: this implementation don't know how to handle the masks.</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">libibverbs and libmthca changes to handle quering QPs. Essentially just adding</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">API and support for passing the call through to provider plug-ins.</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">Signed-off-by: Dotan Barak <dotanb@mellanox.co.il></FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">Index: openib_gen2/src/userspace/libibverbs/include/infiniband/driver.h</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">===================================================================</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">--- openib_gen2.orig/src/userspace/libibverbs/include/infiniband/driver.h 2006-02-07 17:00:24.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+++ openib_gen2/src/userspace/libibverbs/include/infiniband/driver.h 2006-02-08 15:54:22.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">@@ -115,6 +115,9 @@ int ibv_cmd_create_qp(struct ibv_pd *pd,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> int ibv_cmd_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> enum ibv_qp_attr_mask attr_mask,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> struct ibv_modify_qp *cmd, size_t cmd_size);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+int ibv_cmd_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *qp_attr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ int qp_attr_mask, struct ibv_qp_init_attr *qp_init_attr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ struct ibv_query_qp *cmd, size_t cmd_size);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> int ibv_cmd_destroy_qp(struct ibv_qp *qp);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> struct ibv_send_wr **bad_wr);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">Index: openib_gen2/src/userspace/libibverbs/include/infiniband/kern-abi.h</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">===================================================================</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">--- openib_gen2.orig/src/userspace/libibverbs/include/infiniband/kern-abi.h 2006-02-07 17:00:24.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+++ openib_gen2/src/userspace/libibverbs/include/infiniband/kern-abi.h 2006-02-08 15:54:22.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">@@ -509,6 +509,50 @@ struct ibv_modify_qp {</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> __u64 driver_data[0];</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> };</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+struct ibv_query_qp {</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u32 command;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u16 in_words;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u16 out_words;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u64 response;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u32 qp_handle;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u32 attr_mask;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u64 driver_data[0];</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+};</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+struct ibv_query_qp_resp {</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ struct ibv_qp_dest dest;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ struct ibv_qp_dest alt_dest;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u32 max_send_wr;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u32 max_recv_wr;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u32 max_send_sge;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u32 max_recv_sge;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u32 max_inline_data;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u32 qkey;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u32 rq_psn;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u32 sq_psn;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u32 dest_qp_num;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u32 qp_access_flags;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u16 pkey_index;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u16 alt_pkey_index;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 qp_state;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 cur_qp_state;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 path_mtu;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 path_mig_state;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 en_sqd_async_notify;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 max_rd_atomic;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 max_dest_rd_atomic;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 min_rnr_timer;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 port_num;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 timeout;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 retry_cnt;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 rnr_retry;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 alt_port_num;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 alt_timeout;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 sq_sig_all;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u8 reserved[5];</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ __u64 driver_data[0];</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+};</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> struct ibv_destroy_qp {</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> __u32 command;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> __u16 in_words;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">Index: openib_gen2/src/userspace/libibverbs/include/infiniband/verbs.h</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">===================================================================</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">--- openib_gen2.orig/src/userspace/libibverbs/include/infiniband/verbs.h 2006-02-07 17:00:24.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+++ openib_gen2/src/userspace/libibverbs/include/infiniband/verbs.h 2006-02-08 15:54:22.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">@@ -563,6 +563,10 @@ struct ibv_context_ops {</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> struct ibv_qp * (*create_qp)(struct ibv_pd *pd, struct ibv_qp_init_attr *attr);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> int (*modify_qp)(struct ibv_qp *qp, struct ibv_qp_attr *attr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> enum ibv_qp_attr_mask attr_mask);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ int (*query_qp)(struct ibv_qp *qp,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ struct ibv_qp_attr *qp_attr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ int qp_attr_mask,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ struct ibv_qp_init_attr *qp_init_attr);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> int (*destroy_qp)(struct ibv_qp *qp);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> int (*post_send)(struct ibv_qp *qp, struct ibv_send_wr *wr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> struct ibv_send_wr **bad_wr);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">@@ -847,6 +851,20 @@ int ibv_modify_qp(struct ibv_qp *qp, str</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> enum ibv_qp_attr_mask attr_mask);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> /**</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ * ibv_query_qp - Returns the attribute list and current values for the</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ * specified QP.</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ * @qp: The QP to query.</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ * @qp_attr: The attributes of the specified QP.</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ * @qp_attr_mask: A bit-mask used to select specific attributes to query.</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ * @qp_init_attr: Additional attributes of the selected QP.</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ *</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ * The qp_attr_mask may be used to limit the query to gathering only the</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ * selected attributes.</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ */</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+int ibv_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *qp_attr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ int qp_attr_mask, struct ibv_qp_init_attr *qp_init_attr);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+/**</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> * ibv_destroy_qp - Destroy a queue pair.</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> */</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> int ibv_destroy_qp(struct ibv_qp *qp);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">Index: openib_gen2/src/userspace/libibverbs/src/cmd.c</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">===================================================================</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">--- openib_gen2.orig/src/userspace/libibverbs/src/cmd.c 2006-02-07 17:00:24.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+++ openib_gen2/src/userspace/libibverbs/src/cmd.c 2006-02-08 15:58:21.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">@@ -629,6 +629,86 @@ int ibv_cmd_modify_qp(struct ibv_qp *qp,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> return 0;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> }</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+int ibv_cmd_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *qp_attr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ int qp_attr_mask,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ struct ibv_qp_init_attr *qp_init_attr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ struct ibv_query_qp *cmd, size_t cmd_size)</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+{</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ struct ibv_query_qp_resp resp;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ IBV_INIT_CMD_RESP(cmd, cmd_size, QUERY_QP, &resp, sizeof resp);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ cmd->qp_handle = qp->handle;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ cmd->attr_mask = qp_attr_mask;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ if (write(qp->context->cmd_fd, cmd, cmd_size) != cmd_size)</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ return errno;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->qkey = resp.qkey;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->rq_psn = resp.rq_psn;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->sq_psn = resp.sq_psn;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->dest_qp_num = resp.dest_qp_num;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->qp_access_flags = resp.qp_access_flags;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->pkey_index = resp.pkey_index;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->alt_pkey_index = resp.alt_pkey_index;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->qp_state = resp.qp_state;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->cur_qp_state = resp.cur_qp_state;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->path_mtu = resp.path_mtu;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->path_mig_state = resp.path_mig_state;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->en_sqd_async_notify = resp.en_sqd_async_notify;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->max_rd_atomic = resp.max_rd_atomic;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->max_dest_rd_atomic = resp.max_dest_rd_atomic;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->min_rnr_timer = resp.min_rnr_timer;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->port_num = resp.port_num;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->timeout = resp.timeout;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->retry_cnt = resp.retry_cnt;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->rnr_retry = resp.rnr_retry;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->alt_port_num = resp.alt_port_num;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->alt_timeout = resp.alt_timeout;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->cap.max_send_wr = resp.max_send_wr;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->cap.max_recv_wr = resp.max_recv_wr;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->cap.max_send_sge = resp.max_send_sge;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->cap.max_recv_sge = resp.max_recv_sge;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->cap.max_inline_data = resp.max_inline_data;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ memcpy(qp_attr->ah_attr.grh.dgid.raw, resp.dest.dgid, 16);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->ah_attr.grh.flow_label = resp.dest.flow_label;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->ah_attr.dlid = resp.dest.dlid;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->ah_attr.grh.sgid_index = resp.dest.sgid_index;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->ah_attr.grh.hop_limit = resp.dest.hop_limit;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->ah_attr.grh.traffic_class = resp.dest.traffic_class;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->ah_attr.sl = resp.dest.sl;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->ah_attr.src_path_bits = resp.dest.src_path_bits;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->ah_attr.static_rate = resp.dest.static_rate;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->ah_attr.is_global = resp.dest.is_global;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->ah_attr.port_num = resp.dest.port_num;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ memcpy(qp_attr->alt_ah_attr.grh.dgid.raw, resp.alt_dest.dgid, 16);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->alt_ah_attr.grh.flow_label = resp.alt_dest.flow_label;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->alt_ah_attr.dlid = resp.alt_dest.dlid;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->alt_ah_attr.grh.sgid_index = resp.alt_dest.sgid_index;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->alt_ah_attr.grh.hop_limit = resp.alt_dest.hop_limit;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->alt_ah_attr.grh.traffic_class = resp.alt_dest.traffic_class;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->alt_ah_attr.sl = resp.alt_dest.sl;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->alt_ah_attr.src_path_bits = resp.alt_dest.src_path_bits;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->alt_ah_attr.static_rate = resp.alt_dest.static_rate;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->alt_ah_attr.is_global = resp.alt_dest.is_global;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_attr->alt_ah_attr.port_num = resp.alt_dest.port_num;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_init_attr->qp_context = qp->qp_context;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_init_attr->send_cq = qp->send_cq;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_init_attr->recv_cq = qp->recv_cq;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_init_attr->srq = qp->srq;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_init_attr->qp_type = qp->qp_type;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_init_attr->cap.max_send_wr = resp.max_send_wr;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_init_attr->cap.max_recv_wr = resp.max_recv_wr;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_init_attr->cap.max_send_sge = resp.max_send_sge;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_init_attr->cap.max_recv_sge = resp.max_recv_sge;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_init_attr->cap.max_inline_data = resp.max_inline_data;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp_init_attr->sq_sig_all = resp.sq_sig_all;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ return 0;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+}</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> static int ibv_cmd_destroy_qp_v1(struct ibv_qp *qp)</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> {</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> struct ibv_destroy_qp_v1 cmd;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">Index: openib_gen2/src/userspace/libibverbs/src/libibverbs.map</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">===================================================================</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">--- openib_gen2.orig/src/userspace/libibverbs/src/libibverbs.map 2006-02-07 17:00:24.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+++ openib_gen2/src/userspace/libibverbs/src/libibverbs.map 2006-02-08 15:54:22.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">@@ -28,6 +28,7 @@ IBVERBS_1.0 {</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> ibv_destroy_srq;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> ibv_create_qp;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> ibv_modify_qp;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ ibv_query_qp;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> ibv_destroy_qp;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> ibv_create_ah;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> ibv_destroy_ah;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">@@ -52,6 +53,7 @@ IBVERBS_1.0 {</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> ibv_cmd_destroy_srq;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> ibv_cmd_create_qp;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> ibv_cmd_modify_qp;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ ibv_cmd_query_qp;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> ibv_cmd_destroy_qp;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> ibv_cmd_post_send;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> ibv_cmd_post_recv;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">Index: openib_gen2/src/userspace/libibverbs/src/verbs.c</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">===================================================================</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">--- openib_gen2.orig/src/userspace/libibverbs/src/verbs.c 2006-02-07 17:00:24.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+++ openib_gen2/src/userspace/libibverbs/src/verbs.c 2006-02-08 17:55:12.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">@@ -321,6 +321,21 @@ int ibv_modify_qp(struct ibv_qp *qp, str</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> return 0;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> }</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+int ibv_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *qp_attr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ int qp_attr_mask, struct ibv_qp_init_attr *qp_init_attr)</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+{</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ int ret;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ ret = qp->context->ops.query_qp(qp, qp_attr, qp_attr_mask, qp_init_attr);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ if (ret)</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ return ret;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ if (qp_attr_mask & IBV_QP_STATE)</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ qp->state = qp_attr->qp_state;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ return 0;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+}</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> int ibv_destroy_qp(struct ibv_qp *qp)</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> {</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> return qp->context->ops.destroy_qp(qp);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">Index: openib_gen2/src/userspace/libmthca/src/mthca.c</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">===================================================================</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">--- openib_gen2.orig/src/userspace/libmthca/src/mthca.c 2006-02-07 17:00:23.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+++ openib_gen2/src/userspace/libmthca/src/mthca.c 2006-02-08 15:54:22.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">@@ -113,6 +113,7 @@ static struct ibv_context_ops mthca_ctx_</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> .destroy_srq = mthca_destroy_srq,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> .create_qp = mthca_create_qp,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> .modify_qp = mthca_modify_qp,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ .query_qp = mthca_query_qp,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> .destroy_qp = mthca_destroy_qp,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> .create_ah = mthca_create_ah,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> .destroy_ah = mthca_destroy_ah,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">Index: openib_gen2/src/userspace/libmthca/src/mthca.h</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">===================================================================</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">--- openib_gen2.orig/src/userspace/libmthca/src/mthca.h 2006-02-07 17:00:23.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+++ openib_gen2/src/userspace/libmthca/src/mthca.h 2006-02-08 15:54:22.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">@@ -311,6 +311,8 @@ int mthca_arbel_post_srq_recv(struct ibv</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> struct ibv_qp *mthca_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> int mthca_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> enum ibv_qp_attr_mask attr_mask);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+int mthca_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ int qp_attr_mask, struct ibv_qp_init_attr *qp_init_attr);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> int mthca_destroy_qp(struct ibv_qp *qp);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> void mthca_init_qp_indices(struct mthca_qp *qp);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> int mthca_tavor_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">Index: openib_gen2/src/userspace/libmthca/src/verbs.c</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">===================================================================</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">--- openib_gen2.orig/src/userspace/libmthca/src/verbs.c 2006-02-07 17:00:23.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+++ openib_gen2/src/userspace/libmthca/src/verbs.c 2006-02-08 15:54:22.000000000 +0200</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">@@ -591,6 +591,14 @@ int mthca_modify_qp(struct ibv_qp *qp, s</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> return ret;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> }</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+int mthca_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ int qp_attr_mask, struct ibv_qp_init_attr *qp_init_attr)</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+{</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ struct ibv_query_qp cmd;</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+ return ibv_cmd_query_qp(qp, attr, qp_attr_mask, qp_init_attr, &cmd, sizeof cmd);</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+}</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New">+</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> int mthca_destroy_qp(struct ibv_qp *qp)</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> {</FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Courier New"> int ret;</FONT></P>
<BR>
<BR>
<P DIR=LTR><B><I><FONT COLOR="#008080" SIZE=6 FACE="Script">Dotan Barak</FONT></I></B></P>
<P DIR=LTR><FONT FACE="Times New Roman">Software Verification Engineer</FONT></P>
<P DIR=LTR><FONT FACE="Times New Roman">Mellanox Technologies</FONT></P>
<P DIR=LTR><FONT FACE="Times New Roman">Tel: +972-4-9097200 Ext: 231 Fax: +972-4-9593245</FONT></P>
<P DIR=LTR><FONT FACE="Times New Roman">P.O. Box 86 Yokneam 20692 ISRAEL.</FONT></P>
<P DIR=LTR><FONT FACE="Times New Roman">Home: +972-77-8841095 Cell: 0</FONT><FONT SIZE=2 FACE="Arial">52-4222383</FONT></P>
<P DIR=LTR><FONT COLOR="#008080" SIZE=2 FACE="Arial">[ May the fork be with you ]</FONT></P>
</BODY>
</HTML>