more...
authorStefan Metzmacher <metze@samba.org>
Fri, 30 Sep 2016 06:29:31 +0000 (08:29 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 1 Jun 2018 12:35:11 +0000 (14:35 +0200)
libcli/smb/smb_direct.c
libcli/smb/smb_direct.h
libcli/smb/smb_direct_daemon.c

index ed6a31a8db5ad70a1fdea147bd79d85f05b06320..155a2ba6e7feed592a7319b146eac451dc92e3f1 100644 (file)
@@ -58,6 +58,7 @@ struct smb_direct_connection {
                struct tevent_fd *fde;
        } sock;
        struct {
+               struct smb_direct_rdma_context context;
                struct rdma_cm_id *cm_id;
                struct rdma_event_channel *cm_channel;
                struct tevent_fd *fde_channel;
@@ -261,15 +262,17 @@ DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        smb_set_close_on_exec(c->rdma.cm_channel->fd);
        set_blocking(c->rdma.cm_channel->fd, false);
 
+       c->rdma.context.c = c;
 #if RDMA_USER_CM_MAX_ABI_VERSION >= 2
        ret = rdma_create_id(c->rdma.cm_channel,
                             &c->rdma.cm_id,
-                            c, RDMA_PS_TCP);
+                            &c->rdma.context,
+                            RDMA_PS_TCP);
 #else
 #error
        ret = rdma_create_id(c->rdma.cm_channel,
                             &c->rdma.cm_id,
-                            c);
+                            &c->rdma.context);
 #endif
        if (ret != 0) {
                TALLOC_FREE(c);
index 38e773f5debdac03db21925efcd9bd1118f416b7..3dda5986af32ee0510694c83622773219e3b22c0 100644 (file)
 #ifndef _LIBCLI_SMB_SMB_DIRECT_H_
 #define _LIBCLI_SMB_SMB_DIRECT_H_
 
+struct smb_direct_daemon_state;
 struct smb_direct_connection;
+struct smb_direct_listener;
+
 struct rdma_cm_id;
 
+struct smb_direct_rdma_context {
+       struct smb_direct_daemon_state *d;
+       struct smb_direct_connection *c;
+       struct smb_direct_listener *l;
+};
+
 //Hack...
 extern struct smb_direct_connection *smb_direct_conn;
 
index be9fa4a3f08f8f36861be741a44c6fd46ba50187..9c325b0d8019e08db075f96b57ee932d9f4cf6a4 100644 (file)
@@ -70,6 +70,7 @@ struct smb_direct_daemon_state {
        struct smb_direct_daemon_conn *listening_conn;
 
        struct {
+               struct smb_direct_rdma_context context;
                struct rdma_cm_id *cm_id;
                struct rdma_event_channel *cm_channel;
                struct tevent_fd *cm_channel_fde;
@@ -81,6 +82,8 @@ struct smb_direct_daemon_conn {
         * Connection object, one for each peer.
         */
 
+       struct smb_direct_rdma_context context;
+
        /* Backpointer to the global daemon state */
        struct smb_direct_daemon_state *daemon_state;
 
@@ -551,15 +554,16 @@ static NTSTATUS smbd_direct_daemon_listen(
        set_close_on_exec(daemon_state->rdma.cm_channel->fd);
        set_blocking(daemon_state->rdma.cm_channel->fd, false);
 
+       daemon_state->rdma.context.d = daemon_state;
 #if RDMA_USER_CM_MAX_ABI_VERSION >= 2
        result = rdma_create_id(daemon_state->rdma.cm_channel,
                                &daemon_state->rdma.cm_id,
-                               conn,
+                               &daemon_state->rdma.context,
                                RDMA_PS_TCP);
 #else
        result = rdma_create_id(daemon_state->rdma.cm_channel,
                                &daemon_state->rdma.cm_id,
-                               conn);
+                               &daemon_state->rdma.context);
 #endif
        if (result != 0) {
                DBG_ERR("rdma_create_id failed [%s]\n",