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,
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] data_length[%u] remaining_length[%u] ret[%d] errno[%d]\n",
- __location__, __FUNCTION__, io,
+ 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,
(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);
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] 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));
+ 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);
+ }
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",
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)) {
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: