+2006-02-16 Roland Dreier <rdreier@cisco.com>
+
+ * src/cmd.c (ibv_cmd_create_qp): Add support for kernel ABI
+ version 5 (properly aligned struct ibv_create_qp_resp).
+
2006-02-15 Roland Dreier <rdreier@cisco.com>
* src/cmd.c (ibv_cmd_create_qp): Allow userspace device-specific
* The minimum and maximum kernel ABI that we can handle.
*/
#define IB_USER_VERBS_MIN_ABI_VERSION 1
-#define IB_USER_VERBS_MAX_ABI_VERSION 4
+#define IB_USER_VERBS_MAX_ABI_VERSION 5
enum {
IB_USER_VERBS_CMD_GET_CONTEXT,
__u32 max_send_sge;
__u32 max_recv_sge;
__u32 max_inline_data;
+ __u32 reserved;
};
struct ibv_qp_dest {
__u32 qpn;
};
+struct ibv_create_qp_resp_v4 {
+ __u32 qp_handle;
+ __u32 qpn;
+ __u32 max_send_wr;
+ __u32 max_recv_wr;
+ __u32 max_send_sge;
+ __u32 max_recv_sge;
+ __u32 max_inline_data;
+};
+
#endif /* KERN_ABI_H */
if (write(pd->context->cmd_fd, cmd, cmd_size) != cmd_size)
return errno;
+ qp->handle = resp->qp_handle;
+ qp->qp_num = resp->qpn;
+
if (abi_ver > 3) {
- qp->handle = resp->qp_handle;
- qp->qp_num = resp->qpn;
attr->cap.max_recv_sge = resp->max_recv_sge;
attr->cap.max_send_sge = resp->max_send_sge;
attr->cap.max_recv_wr = resp->max_recv_wr;
attr->cap.max_send_wr = resp->max_send_wr;
attr->cap.max_inline_data = resp->max_inline_data;
- } else {
+ }
+
+ if (abi_ver == 4) {
+ struct ibv_create_qp_resp_v4 *resp_v4 =
+ (struct ibv_create_qp_resp_v4 *) resp;
+
+ memmove((void *) resp + sizeof *resp,
+ (void *) resp_v4 + sizeof *resp_v4,
+ resp_size - sizeof *resp);
+ } else if (abi_ver <= 3) {
struct ibv_create_qp_resp_v3 *resp_v3 =
(struct ibv_create_qp_resp_v3 *) resp;
- qp->handle = resp_v3->qp_handle;
- qp->qp_num = resp_v3->qpn;
memmove((void *) resp + sizeof *resp,
(void *) resp_v3 + sizeof *resp_v3,
resp_size - sizeof *resp);