Revert "try to get next ... fails"
authorStefan Metzmacher <metze@samba.org>
Thu, 29 Sep 2016 08:03:04 +0000 (10:03 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 1 Jun 2018 12:35:06 +0000 (14:35 +0200)
This reverts commit a5886bff5e7431e3735df07947c8cd4b6b2e72f4.

libcli/smb/smb_direct.c

index 46075d8fad65e73b839636d09a253f96c956783a..d5099316b667c92af82f69837a42eccdaa9b53cb 100644 (file)
@@ -1625,7 +1625,6 @@ static void smb_direct_connection_ibv_handler(struct tevent_context *ev,
        uint16_t flags;
        uint32_t data_offset;
        struct smb_direct_io *io = NULL;
-       struct smb_direct_io *io_next = NULL;
 
        errno = 0;
        ret = ibv_get_cq_event(c->ibv.comp_channel,
@@ -1694,18 +1693,11 @@ static void smb_direct_connection_ibv_handler(struct tevent_context *ev,
        io = talloc_get_type_abort((void *)(uintptr_t)wc.wr_id,
                                   struct smb_direct_io);
 
- process_next:
        switch (wc.opcode) {
        case IBV_WC_SEND:
-               DEBUG(0,("%s:%s: GOT SEND[%p] next[%p] data_length[%u] remaining_length[%u] ret[%d] errno[%d]\n",
-                       __location__, __FUNCTION__, io, io->send_wr.next,
+               DEBUG(0,("%s:%s: GOT SEND[%p] data_length[%u] remaining_length[%u] ret[%d] errno[%d]\n",
+                       __location__, __FUNCTION__, io,
                        (unsigned)io->data_length, (unsigned)io->remaining_length, ret, errno));
-               if (io->send_wr.next != NULL) {
-                       io_next = talloc_get_type_abort(
-                                  (void *)(uintptr_t)io->send_wr.next->wr_id,
-                                  struct smb_direct_io);
-               }
-
                DLIST_REMOVE(c->s2r.posted, io);
                DLIST_ADD_END(c->s2r.idle, io);
 
@@ -1718,21 +1710,11 @@ static void smb_direct_connection_ibv_handler(struct tevent_context *ev,
                        smb_direct_connection_disconnect(c, status);
                        return;
                }
-               if (io_next != NULL) {
-                       io = io_next;
-                       io_next = NULL;
-                       goto process_next;
-               }
                return;
 
        case IBV_WC_RECV:
-               DEBUG(0,("%s:%s: GOT RECV[%p] next[%p] ret[%d] errno[%d]\n",
-                       __location__, __FUNCTION__, io, io->recv_wr.next, ret, errno));
-               if (io->recv_wr.next != NULL) {
-                       io_next = talloc_get_type_abort(
-                                  (void *)(uintptr_t)io->recv_wr.next->wr_id,
-                                  struct smb_direct_io);
-               }
+               DEBUG(0,("%s:%s: GOT RECV[%p] ret[%d] errno[%d]\n",
+                       __location__, __FUNCTION__, io, ret, errno));
                if (wc.byte_len > c->state.max_receive_size) {
                        status = NT_STATUS_INVALID_NETWORK_RESPONSE;
                        DEBUG(0,("%s:%s: wc.byte_len[%u/0x%x] max_receive_size[%u/0x%x] ret[%d] errno[%d] status[%s]\n",
@@ -1800,11 +1782,6 @@ smb_direct_connection_debug_credits(c, __location__, __func__);
                                smb_direct_connection_disconnect(c, status);
                                return;
                        }
-                       if (io_next != NULL) {
-                               io = io_next;
-                               io_next = NULL;
-                               goto process_next;
-                       }
                        return;
                } else if (data_offset == 0x18) {
                        if (io->data_length > (c->state.max_receive_size - data_offset)) {
@@ -1923,12 +1900,6 @@ smb_direct_connection_debug_credits(c, __location__, __func__);
                        smb_direct_connection_disconnect(c, status);
                        return;
                }
-
-               if (io_next != NULL) {
-                       io = io_next;
-                       io_next = NULL;
-                       goto process_next;
-               }
                return;
 
        case IBV_WC_RDMA_READ: