Example #1
0
static int
usdf_pep_bind(fid_t fid, fid_t bfid, uint64_t flags)
{
    struct usdf_pep *pep;

    USDF_TRACE_SYS(EP_CTRL, "\n");

    pep = pep_fidtou(fid);

    switch (bfid->fclass) {

    case FI_CLASS_EQ:
        if (pep->pep_eq != NULL) {
            return -FI_EINVAL;
        }
        pep->pep_eq = eq_fidtou(bfid);
        atomic_inc(&pep->pep_eq->eq_refcnt);
        break;

    default:
        return -FI_EINVAL;
    }

    return 0;
}
Example #2
0
static int
usdf_eq_close(fid_t fid)
{
	struct usdf_eq *eq;

	eq = eq_fidtou(fid);

	if (atomic_get(&eq->eq_refcnt) > 0) {
		return -FI_EBUSY;
	}
	atomic_dec(&eq->eq_fabric->fab_refcnt);

	/* release wait obj */
	switch (eq->eq_wait_obj) {
	case FI_WAIT_FD:
		close(eq->eq_fd);
		break;
	default:
		break;
	}

	free(eq);

	return 0;
}
Example #3
0
static int
usdf_domain_bind(struct fid *fid, struct fid *bfid, uint64_t flags)
{
        struct usdf_domain *udp;

	USDF_TRACE_SYS(DOMAIN, "\n");

	if (flags & FI_REG_MR) {
		USDF_WARN_SYS(DOMAIN,
			"FI_REG_MR for EQs is not supported by the usnic provider");
		return -FI_EOPNOTSUPP;
	}

        udp = dom_fidtou(fid);

        switch (bfid->fclass) {
        case FI_CLASS_EQ:
                if (udp->dom_eq != NULL) {
                        return -FI_EINVAL;
                }
                udp->dom_eq = eq_fidtou(bfid);
                ofi_atomic_inc32(&udp->dom_eq->eq_refcnt);
                break;
        default:
                return -FI_EINVAL;
        }

        return 0;
}
Example #4
0
static int
usdf_eq_control(fid_t fid, int command, void *arg)
{
	struct usdf_eq *eq;

	eq = eq_fidtou(fid);

	switch (command) {
	case FI_GETWAIT:
		if (eq->eq_wait_obj == FI_WAIT_FD) {
			*(int *)arg = eq->eq_fd;
		} else {
			return -FI_ENODATA;
		}
		break;
	default:
		return -FI_EINVAL;
	}

	return 0;
}
Example #5
0
static int
usdf_domain_bind(struct fid *fid, struct fid *bfid, uint64_t flags)
{
        struct usdf_domain *udp;

        udp = dom_fidtou(fid);

        switch (bfid->fclass) {
        case FI_CLASS_EQ:
                if (udp->dom_eq != NULL) {
                        return -FI_EINVAL;
                }
                udp->dom_eq = eq_fidtou(bfid);
                atomic_inc(&udp->dom_eq->eq_refcnt);
                break;
        default:
                return -FI_EINVAL;
        }

        return 0;
}