Exemple #1
0
static ssize_t sock_ep_rma_writedata(struct fid_ep *ep, const void *buf,
				      size_t len, void *desc, uint64_t data,
				      fi_addr_t dest_addr, uint64_t addr,
				      uint64_t key, void *context)
{
	struct fi_msg_rma msg;
	struct iovec msg_iov;
	struct fi_rma_iov rma_iov;

	msg_iov.iov_base = (void *) buf;
	msg_iov.iov_len = len;
	msg.desc = &desc;
	msg.iov_count = 1;
	msg.rma_iov_count = 1;

	rma_iov.addr = addr;
	rma_iov.key = key;
	rma_iov.len = len;

	msg.rma_iov = &rma_iov;
	msg.msg_iov = &msg_iov;

	msg.addr = dest_addr;
	msg.context = context;
	msg.data = data;

	return sock_ep_rma_writemsg(ep, &msg, FI_REMOTE_CQ_DATA |
					SOCK_USE_OP_FLAGS);
}
Exemple #2
0
static ssize_t sock_ep_rma_injectdata(struct fid_ep *ep, const void *buf,
					size_t len, uint64_t data,
					fi_addr_t dest_addr, uint64_t addr,
					uint64_t key)
{
	struct fi_msg_rma msg;
	struct iovec msg_iov;
	struct fi_rma_iov rma_iov;

	memset(&msg, 0, sizeof(msg));
	msg_iov.iov_base = (void *) buf;
	msg_iov.iov_len = len;
	msg.msg_iov = &msg_iov;
	msg.iov_count = 1;
	msg.rma_iov_count = 1;

	rma_iov.addr = addr;
	rma_iov.key = key;
	rma_iov.len = len;

	msg.rma_iov = &rma_iov;
	msg.msg_iov = &msg_iov;
	msg.addr = dest_addr;
	msg.data = data;
	return sock_ep_rma_writemsg(ep, &msg, FI_INJECT | FI_REMOTE_CQ_DATA |
		SOCK_NO_COMPLETION | SOCK_USE_OP_FLAGS);
}
Exemple #3
0
static ssize_t sock_ep_rma_writev(struct fid_ep *ep, const struct iovec *iov,
				void **desc, size_t count, fi_addr_t dest_addr,
				uint64_t addr, uint64_t key, void *context)
{
	int i;
	size_t len;
	struct fi_msg_rma msg;
	struct fi_rma_iov rma_iov;

	memset(&msg, 0, sizeof(msg));
	msg.msg_iov = iov;
	msg.desc = desc;
	msg.iov_count = count;
	msg.rma_iov_count = 1;

	for (i = 0, len = 0; i < count; i++)
		len += iov[i].iov_len;

	rma_iov.addr = addr;
	rma_iov.key = key;
	rma_iov.len = len;

	msg.rma_iov = &rma_iov;
	msg.context = context;
	msg.addr = dest_addr;

	return sock_ep_rma_writemsg(ep, &msg, SOCK_USE_OP_FLAGS);
}
Exemple #4
0
void sock_cntr_check_trigger_list(struct sock_cntr *cntr)
{
    struct sock_trigger *trigger;
    struct dlist_entry *entry;
    int ret = 0;

    fastlock_acquire(&cntr->trigger_lock);
    for (entry = cntr->trigger_list.next;
            entry != &cntr->trigger_list;) {

        trigger = container_of(entry, struct sock_trigger, entry);
        entry = entry->next;

        if (atomic_get(&cntr->value) < trigger->threshold)
            continue;

        switch (trigger->op_type) {
        case SOCK_OP_SEND:
            ret = sock_ep_sendmsg(trigger->ep, &trigger->op.msg.msg,
                                  trigger->flags & ~FI_TRIGGER);
            break;

        case SOCK_OP_RECV:
            ret = sock_ep_recvmsg(trigger->ep, &trigger->op.msg.msg,
                                  trigger->flags & ~FI_TRIGGER);
            break;

        case SOCK_OP_TSEND:
            ret = sock_ep_tsendmsg(trigger->ep,
                                   &trigger->op.tmsg.msg,
                                   trigger->flags & ~FI_TRIGGER);
            break;

        case SOCK_OP_TRECV:
            ret = sock_ep_trecvmsg(trigger->ep,
                                   &trigger->op.tmsg.msg,
                                   trigger->flags & ~FI_TRIGGER);
            break;

        case SOCK_OP_WRITE:
            ret = sock_ep_rma_writemsg(trigger->ep,
                                       &trigger->op.rma.msg,
                                       trigger->flags & ~FI_TRIGGER);
            break;

        case SOCK_OP_READ:
            ret = sock_ep_rma_readmsg(trigger->ep,
                                      &trigger->op.rma.msg,
                                      trigger->flags & ~FI_TRIGGER);
            break;

        case SOCK_OP_ATOMIC:
            ret = sock_ep_tx_atomic(trigger->ep,
                                    &trigger->op.atomic.msg,
                                    trigger->op.atomic.comparev,
                                    NULL,
                                    trigger->op.atomic.compare_count,
                                    trigger->op.atomic.resultv,
                                    NULL,
                                    trigger->op.atomic.result_count,
                                    trigger->flags & ~FI_TRIGGER);
            break;

        default:
            SOCK_LOG_ERROR("unsupported op\n");
            ret = 0;
            break;
        }

        if (ret != -FI_EAGAIN) {
            dlist_remove(&trigger->entry);
            free(trigger);
        } else {
            break;
        }
    }
    fastlock_release(&cntr->trigger_lock);
}