debug more...
authorStefan Metzmacher <metze@samba.org>
Thu, 29 Sep 2016 08:00:33 +0000 (10:00 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 1 Jun 2018 12:35:06 +0000 (14:35 +0200)
libcli/smb/smb_direct.c

index 506b432425fa23a14b34e660bd841ffeea81fa62..d5099316b667c92af82f69837a42eccdaa9b53cb 100644 (file)
@@ -209,14 +209,14 @@ struct smb_direct_connection *smb_direct_connection_create(TALLOC_CTX *mem_ctx)
        }
        c->sock.fd = -1;
        c->sock.tmp_fd = -1;
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        talloc_set_destructor(c, smb_direct_connection_destructor);
 
        c->state.max_send_size       = 1364;
        c->state.max_receive_size    = SMB_DIRECT_IO_MAX_DATA;
        c->state.max_fragmented_size = 1048576;
        c->state.max_read_write_size = 0;
-       c->state.receive_credit_max  = 128;//255;
+       c->state.receive_credit_max  = 10;//255;
        c->state.send_credit_target  = 255;
        c->state.keep_alive_internal = 5;
 
@@ -263,7 +263,7 @@ DEBUG(0,("%s:%s: here...\n", __location__, __func__));
                return NULL;
        }
 
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        return c;
 }
 
@@ -272,7 +272,7 @@ static struct smb_direct_connection *smb_direct_connection_complete_alloc(struct
        int ret;
        uint16_t i;
 
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        c->ibv.pd = ibv_alloc_pd(c->rdma.cm_id->verbs);
        if (c->ibv.pd == NULL) {
                TALLOC_FREE(c);
@@ -355,7 +355,7 @@ DEBUG(0,("%s:%s: SETUP r2s here...\n", __location__, __func__));
                        return NULL;
                }
                DLIST_ADD_END(c->r2s.idle, io);
-DEBUG(0,("%s:%s: SETUP r2s here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: SETUP r2s here...\n", __location__, __func__));
        }
 
        for (i = 0; i < c->state.send_credit_target; i++) {
@@ -368,10 +368,10 @@ DEBUG(0,("%s:%s: SETUP s2r here...\n", __location__, __func__));
                        return NULL;
                }
                DLIST_ADD_END(c->s2r.idle, io);
-DEBUG(0,("%s:%s: SETUP s2r here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: SETUP s2r here...\n", __location__, __func__));
        }
 
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        return c;
 }
 
@@ -457,10 +457,10 @@ static int smb_direct_connection_post_recv(struct smb_direct_connection *c)
        struct ibv_recv_wr *bad_recv_wr = NULL;
        int ret;
 
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
 smb_direct_connection_debug_credits(c, __location__, __func__);
        if (c->r2s.idle == NULL) {
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
                return 0;
        }
 
@@ -470,6 +470,7 @@ DEBUG(0,("%s:%s: here...\n", __location__, __func__));
                        break;
                }
 
+DEBUG(0,("%s:%s: POST RECV[%p]\n", __location__, __func__, io));
                io->recv_wr.next = &io->next->recv_wr;
        }
 
@@ -486,7 +487,7 @@ DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        DLIST_CONCATENATE(c->r2s.posted, c->r2s.idle);
        c->r2s.idle = NULL;
 
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        return 0;
 }
 
@@ -499,15 +500,15 @@ static int smb_direct_connection_post_send(struct smb_direct_connection *c)
        struct ibv_send_wr *bad_send_wr = NULL;
        int ret;
 
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
 smb_direct_connection_debug_credits(c, __location__, __func__);
        if (c->s2r.ready == NULL) {
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+DEBUG(0,("%s:%s: none READY\n", __location__, __func__));
                return 0;
        }
 
        if (c->state.send_credits == 0) {
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+DEBUG(0,("%s:%s: no credits\n", __location__, __func__));
                return 0;
        }
 
@@ -526,7 +527,7 @@ DEBUG(0,("%s:%s: TODO: REMOVE me ...here...\n", __location__, __func__));
                next = io->next;
 
                if (c->state.send_credits == 0) {
-smb_direct_connection_debug_credits(c, __location__, __func__);
+//smb_direct_connection_debug_credits(c, __location__, __func__);
                        break;
                }
 
@@ -540,7 +541,7 @@ smb_direct_connection_debug_credits(c, __location__, __func__);
                granted -= c->state.receive_credits;
                granted = MIN(granted, c->state.receive_credit_target);
                c->state.receive_credits += granted;
-smb_direct_connection_debug_credits(c, __location__, __func__);
+//smb_direct_connection_debug_credits(c, __location__, __func__);
 
 //             if (c->state.receive_credits == 0) {
 //                     granted = 1;
@@ -603,23 +604,23 @@ static int smb_direct_connection_post_keep(struct smb_direct_connection *c)
        int ret;
 
 DEBUG(0,("%s:%s: KEEP posted[%p] ready[%p] idle[%p]\n",
-       __location__, __func__, ));
+       __location__, __func__, c->s2r.posted, c->s2r.ready, c->s2r.idle));
        if (c->s2r.posted != NULL) {
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
 //             return 0;
        }
 
        if (c->s2r.ready != NULL) {
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
                return 0;
        }
 
        if (c->s2r.idle == NULL) {
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
                return 0;
        }
 
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        io = c->s2r.idle;
        DLIST_REMOVE(c->s2r.idle, io);
 
@@ -636,7 +637,7 @@ DEBUG(0,("%s:%s: here...\n", __location__, __func__));
                        __location__, __FUNCTION__, ret, errno, nt_errstr(status)));
                return ret;
        }
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
 
        return 0;
 }
@@ -911,8 +912,8 @@ static void smb_direct_connection_rdma_connect_handler(struct tevent_context *ev
        case RDMA_CM_EVENT_ESTABLISHED:
                errno = 0;
                ret = 0;
-               DEBUG(0,("%s:%s: ret[%d] errno[%d]\n",
-                       __location__, __FUNCTION__, ret, errno));
+               //DEBUG(0,("%s:%s: ret[%d] errno[%d]\n",
+               //      __location__, __FUNCTION__, ret, errno));
 
                c->rdma.expected_event = RDMA_CM_EVENT_DISCONNECTED;
                TALLOC_FREE(c->rdma.fde_channel);
@@ -1219,7 +1220,7 @@ static void smb_direct_connection_negotiate_connect_ibv_handler(struct tevent_co
        ibv_ack_cq_events(cq, 1);
 
        if (cq_context != c) {
-               status = NT_STATUS_INTERNAL_ERROR;;
+               status = NT_STATUS_INTERNAL_ERROR;
                DEBUG(0,("%s:%s: ret[%d] errno[%d] status[%s]\n",
                        __location__, __FUNCTION__, ret, errno, nt_errstr(status)));
                tevent_req_nterror(req, status);
@@ -1273,18 +1274,18 @@ static void smb_direct_connection_negotiate_connect_ibv_handler(struct tevent_co
 
        switch (wc.opcode) {
        case IBV_WC_SEND:
-               DEBUG(0,("%s:%s: GOT SEND[%p] ret[%d] errno[%d]\n",
-                       __location__, __FUNCTION__, io, ret, errno));
+               DEBUG(0,("%s:%s: GOT SEND[%p] next[%p] ret[%d] errno[%d]\n",
+                       __location__, __FUNCTION__, io, io->send_wr.next, ret, errno));
                TALLOC_FREE(io);
                break;
        case IBV_WC_RDMA_READ:
-               DEBUG(0,("%s:%s: GOT RDMA_READ[%p] ret[%d] errno[%d]\n",
-                       __location__, __FUNCTION__, io, ret, errno));
+               DEBUG(0,("%s:%s: GOT RDMA_READ[%p] next[%p] ret[%d] errno[%d]\n",
+                       __location__, __FUNCTION__, io, io->send_wr.next, ret, errno));
                TALLOC_FREE(io);
                break;
        case IBV_WC_RECV:
-               DEBUG(0,("%s:%s: GOT RECV[%p] ret[%d] errno[%d]\n",
-                       __location__, __FUNCTION__, io, ret, errno));
+               DEBUG(0,("%s:%s: GOT RECV[%p] next[%p] ret[%d] errno[%d]\n",
+                       __location__, __FUNCTION__, io, io->recv_wr.next, ret, errno));
                dump_data(0, io->data, wc.byte_len);
                if (wc.byte_len < 0x20) {
                        status = NT_STATUS_INVALID_NETWORK_RESPONSE;
@@ -1446,7 +1447,7 @@ struct tevent_req *smb_direct_connection_connect_send(TALLOC_CTX *mem_ctx,
        state->ev = ev;
        state->c = c;
 
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        subreq = smb_direct_connection_rdma_connect_send(state, ev, c, src, dst, NULL, NULL);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
@@ -1455,7 +1456,7 @@ DEBUG(0,("%s:%s: here...\n", __location__, __func__));
                                smb_direct_connection_connect_done_rdma,
                                req);
 
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        return req;
 }
 
@@ -1469,14 +1470,14 @@ static void smb_direct_connection_connect_done_rdma(struct tevent_req *subreq)
                struct smb_direct_connection_connect_state);
        NTSTATUS status;
 
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        status = smb_direct_connection_rdma_connect_recv(subreq);
        TALLOC_FREE(subreq);
        if (tevent_req_nterror(req, status)) {
                return;
        }
 
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        subreq = smb_direct_connection_negotiate_connect_send(state, state->ev, state->c);
        if (tevent_req_nomem(subreq, req)) {
                return;
@@ -1484,7 +1485,7 @@ DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        tevent_req_set_callback(subreq,
                                smb_direct_connection_connect_done_negotiate,
                                req);
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
 }
 
 static void smb_direct_connection_connect_done_negotiate(struct tevent_req *subreq)
@@ -1494,14 +1495,14 @@ static void smb_direct_connection_connect_done_negotiate(struct tevent_req *subr
                struct tevent_req);
        NTSTATUS status;
 
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        status = smb_direct_connection_negotiate_connect_recv(subreq);
        TALLOC_FREE(subreq);
        if (tevent_req_nterror(req, status)) {
                return;
        }
 
-DEBUG(0,("%s:%s: here...\n", __location__, __func__));
+//DEBUG(0,("%s:%s: here...\n", __location__, __func__));
        tevent_req_done(req);
 }