Exemplo n.º 1
0
int fi_ibv_getinfo(uint32_t version, const char *node, const char *service,
		   uint64_t flags, struct fi_info *hints, struct fi_info **info)
{
	struct rdma_cm_id *id = NULL;
	struct rdma_addrinfo *rai;
	int ret;

	ret = fi_ibv_init_info();
	if (ret)
		goto out;

	ret = fi_ibv_create_ep(node, service, flags, hints, &rai, &id);
	if (ret)
		goto out;

	if (id->verbs) {
		ret = fi_ibv_get_matching_info(ibv_get_device_name(id->verbs->device),
					       hints, rai, info);
	} else {
		ret = fi_ibv_get_matching_info(NULL, hints, rai, info);
	}

	ofi_alter_info(*info, hints);

	fi_ibv_destroy_ep(rai, &id);

out:
	if (!ret || ret == -FI_ENOMEM || ret == -FI_ENODEV)
		return ret;
	else
		return -FI_ENODATA;
}
Exemplo n.º 2
0
int fi_ibv_getinfo(uint32_t version, const char *node, const char *service,
		   uint64_t flags, struct fi_info *hints, struct fi_info **info)
{
	struct rdma_cm_id *id = NULL;
	struct rdma_addrinfo *rai;
	int ret;

	ret = fi_ibv_init_info();
	if (ret)
		goto out;

	ret = fi_ibv_create_ep(node, service, flags, hints, &rai, &id);
	if (ret)
		goto out;

	if (id->verbs) {
		ret = fi_ibv_get_matching_info(ibv_get_device_name(id->verbs->device),
					       hints, rai, info);
	} else {
		ret = fi_ibv_get_matching_info(NULL, hints, rai, info);
		if (!ret && !(flags & FI_SOURCE) && !node 
		&& (!hints || (!hints->src_addr && !hints->dest_addr))) {
			ret = fi_ibv_getifaddrs(service, flags, *info);
			if (ret) {
				fi_freeinfo(*info);
				fi_ibv_destroy_ep(rai, &id);
				goto out;
			}
		}
	}

	if (!ret) {
		ret = fi_ibv_rdm_remove_nonaddr_info(info);
	}

	ofi_alter_info(*info, hints);

	fi_ibv_destroy_ep(rai, &id);

out:
	if (!ret || ret == -FI_ENOMEM || ret == -FI_ENODEV)
		return ret;
	else
		return -FI_ENODATA;
}
Exemplo n.º 3
0
int fi_ibv_getinfo(uint32_t version, const char *node, const char *service,
		   uint64_t flags, struct fi_info *hints, struct fi_info **info)
{
	struct rdma_cm_id *id = NULL;
	struct rdma_addrinfo *rai;
	struct fi_ibv_rdm_cm rdm_cm;
	int ret;

	ret = fi_ibv_init_info();
	if (ret)
		goto out;

	if (FI_IBV_EP_TYPE_IS_RDM(hints)) {
		memset(&rdm_cm, 0, sizeof(struct fi_ibv_rdm_cm));
		ret = fi_ibv_create_ep(node, service, flags, hints, &rai,
				       &(rdm_cm.listener));
		id = rdm_cm.listener;
	} else {
		ret = fi_ibv_create_ep(node, service, flags, hints, &rai, &id);
	}

	if (ret)
		goto out;

	if (id->verbs) {
		ret = fi_ibv_get_matching_info(ibv_get_device_name(id->verbs->device),
					       hints, rai, info);
	} else {
		ret = fi_ibv_get_matching_info(NULL, hints, rai, info);
	}

	ofi_alter_info(*info, hints);

	if (hints && hints->ep_attr)
		fi_ibv_destroy_ep(hints->ep_attr->type, rai,
			FI_IBV_EP_TYPE_IS_RDM(hints) ? &(rdm_cm.listener) : &id);

out:
	if (!ret || ret == -FI_ENOMEM || ret == -FI_ENODEV)
		return ret;
	else
		return -FI_ENODATA;
}