static void uct_ugni_unalign_fma_get_cb(uct_completion_t *self, ucs_status_t status) { uct_ugni_rdma_fetch_desc_t *fma = (uct_ugni_rdma_fetch_desc_t *) ucs_container_of(self, uct_ugni_rdma_fetch_desc_t, tmp); /* Call the orignal callback and skip padding */ fma->super.unpack_cb(fma->user_buffer, (char *)(fma + 1) + fma->padding, fma->super.desc.length - fma->padding - fma->tail); uct_ugni_invoke_orig_comp(fma, status); }
static void assemble_composed_unaligned(uct_completion_t *self, ucs_status_t status) { uct_ugni_rdma_fetch_desc_t *fma_head = (uct_ugni_rdma_fetch_desc_t *) ucs_container_of(self, uct_ugni_rdma_fetch_desc_t, tmp); void *buffer = fma_head->user_buffer; uct_ugni_rdma_fetch_desc_t *rdma = fma_head->head; if(fma_head->head == NULL){ memcpy(buffer, (char *)(fma_head + 1) + fma_head->padding, fma_head->super.desc.length - fma_head->padding - fma_head->tail); } else { memmove(buffer, buffer + rdma->padding, rdma->super.desc.length); memcpy(buffer + rdma->super.desc.length - rdma->padding, (char *)(fma_head + 1) + rdma->tail, fma_head->super.desc.length - (fma_head->tail + rdma->tail)); } uct_ugni_invoke_orig_comp(fma_head, status); }
static void uct_ugni_unalign_rdma_composed_cb(uct_completion_t *self, ucs_status_t status) { uct_ugni_rdma_fetch_desc_t *rdma = (uct_ugni_rdma_fetch_desc_t *) ucs_container_of(self, uct_ugni_rdma_fetch_desc_t, tmp); uct_ugni_rdma_fetch_desc_t *head_fma = rdma->head; head_fma->network_completed_bytes += rdma->super.desc.length; ucs_assert(head_fma->network_completed_bytes <= rdma->expected_bytes); /* Check if messages is completed */ if (head_fma->network_completed_bytes == head_fma->expected_bytes) { assemble_composed_unaligned(head_fma); uct_ugni_invoke_orig_comp(head_fma, status); head_fma->super.not_ready_to_free = 0; ucs_mpool_put(head_fma); } else { rdma->super.not_ready_to_free = 1; } }