@@ -46,6 +46,7 @@
#include <util/compiler.h>
#include <util/symver.h>
+#include <infiniband/cmd_write.h>
#include "ibverbs.h"
#ifndef NRESOLVE_NEIGH
@@ -341,22 +342,18 @@ LATEST_SYMVER_FUNC(ibv_dereg_mr, 1_1, "IBVERBS_1.1",
struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context *context)
{
+ DECLARE_LEGACY_CORE_BUFS(IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL);
struct ibv_comp_channel *channel;
- struct ibv_create_comp_channel cmd;
- struct ib_uverbs_create_comp_channel_resp resp;
channel = malloc(sizeof *channel);
if (!channel)
return NULL;
- IBV_INIT_CMD_RESP(&cmd, sizeof cmd, CREATE_COMP_CHANNEL, &resp, sizeof resp);
- if (write(context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd) {
+ if (execute_write(context, req, &resp)) {
free(channel);
return NULL;
}
- (void) VALGRIND_MAKE_MEM_DEFINED(&resp, sizeof resp);
-
channel->context = context;
channel->fd = resp.fd;
channel->refcnt = 0;