cma_dev           276 drivers/infiniband/core/cma.c void cma_ref_dev(struct cma_device *cma_dev)
cma_dev           278 drivers/infiniband/core/cma.c 	atomic_inc(&cma_dev->refcount);
cma_dev           284 drivers/infiniband/core/cma.c 	struct cma_device *cma_dev;
cma_dev           289 drivers/infiniband/core/cma.c 	list_for_each_entry(cma_dev, &dev_list, list)
cma_dev           290 drivers/infiniband/core/cma.c 		if (filter(cma_dev->device, cookie)) {
cma_dev           291 drivers/infiniband/core/cma.c 			found_cma_dev = cma_dev;
cma_dev           301 drivers/infiniband/core/cma.c int cma_get_default_gid_type(struct cma_device *cma_dev,
cma_dev           304 drivers/infiniband/core/cma.c 	if (!rdma_is_port_valid(cma_dev->device, port))
cma_dev           307 drivers/infiniband/core/cma.c 	return cma_dev->default_gid_type[port - rdma_start_port(cma_dev->device)];
cma_dev           310 drivers/infiniband/core/cma.c int cma_set_default_gid_type(struct cma_device *cma_dev,
cma_dev           316 drivers/infiniband/core/cma.c 	if (!rdma_is_port_valid(cma_dev->device, port))
cma_dev           319 drivers/infiniband/core/cma.c 	supported_gids = roce_gid_type_mask_support(cma_dev->device, port);
cma_dev           324 drivers/infiniband/core/cma.c 	cma_dev->default_gid_type[port - rdma_start_port(cma_dev->device)] =
cma_dev           330 drivers/infiniband/core/cma.c int cma_get_default_roce_tos(struct cma_device *cma_dev, unsigned int port)
cma_dev           332 drivers/infiniband/core/cma.c 	if (!rdma_is_port_valid(cma_dev->device, port))
cma_dev           335 drivers/infiniband/core/cma.c 	return cma_dev->default_roce_tos[port - rdma_start_port(cma_dev->device)];
cma_dev           338 drivers/infiniband/core/cma.c int cma_set_default_roce_tos(struct cma_device *cma_dev, unsigned int port,
cma_dev           341 drivers/infiniband/core/cma.c 	if (!rdma_is_port_valid(cma_dev->device, port))
cma_dev           344 drivers/infiniband/core/cma.c 	cma_dev->default_roce_tos[port - rdma_start_port(cma_dev->device)] =
cma_dev           349 drivers/infiniband/core/cma.c struct ib_device *cma_get_ib_dev(struct cma_device *cma_dev)
cma_dev           351 drivers/infiniband/core/cma.c 	return cma_dev->device;
cma_dev           490 drivers/infiniband/core/cma.c 			       struct cma_device *cma_dev)
cma_dev           492 drivers/infiniband/core/cma.c 	cma_ref_dev(cma_dev);
cma_dev           493 drivers/infiniband/core/cma.c 	id_priv->cma_dev = cma_dev;
cma_dev           494 drivers/infiniband/core/cma.c 	id_priv->id.device = cma_dev->device;
cma_dev           496 drivers/infiniband/core/cma.c 		rdma_node_get_transport(cma_dev->device->node_type);
cma_dev           497 drivers/infiniband/core/cma.c 	list_add_tail(&id_priv->list, &cma_dev->id_list);
cma_dev           505 drivers/infiniband/core/cma.c 			      struct cma_device *cma_dev)
cma_dev           507 drivers/infiniband/core/cma.c 	_cma_attach_to_dev(id_priv, cma_dev);
cma_dev           509 drivers/infiniband/core/cma.c 		cma_dev->default_gid_type[id_priv->id.port_num -
cma_dev           510 drivers/infiniband/core/cma.c 					  rdma_start_port(cma_dev->device)];
cma_dev           513 drivers/infiniband/core/cma.c void cma_deref_dev(struct cma_device *cma_dev)
cma_dev           515 drivers/infiniband/core/cma.c 	if (atomic_dec_and_test(&cma_dev->refcount))
cma_dev           516 drivers/infiniband/core/cma.c 		complete(&cma_dev->comp);
cma_dev           531 drivers/infiniband/core/cma.c 	cma_deref_dev(id_priv->cma_dev);
cma_dev           532 drivers/infiniband/core/cma.c 	id_priv->cma_dev = NULL;
cma_dev           663 drivers/infiniband/core/cma.c 	struct cma_device *cma_dev;
cma_dev           679 drivers/infiniband/core/cma.c 	list_for_each_entry(cma_dev, &dev_list, list) {
cma_dev           680 drivers/infiniband/core/cma.c 		rdma_for_each_port (cma_dev->device, port) {
cma_dev           681 drivers/infiniband/core/cma.c 			gidp = rdma_protocol_roce(cma_dev->device, port) ?
cma_dev           683 drivers/infiniband/core/cma.c 			gid_type = cma_dev->default_gid_type[port - 1];
cma_dev           684 drivers/infiniband/core/cma.c 			sgid_attr = cma_validate_port(cma_dev->device, port,
cma_dev           689 drivers/infiniband/core/cma.c 				cma_attach_to_dev(id_priv, cma_dev);
cma_dev           731 drivers/infiniband/core/cma.c 	gid_type = listen_id_priv->cma_dev->default_gid_type[req->port - 1];
cma_dev           744 drivers/infiniband/core/cma.c 	cma_attach_to_dev(id_priv, listen_id_priv->cma_dev);
cma_dev           754 drivers/infiniband/core/cma.c 	struct cma_device *cma_dev;
cma_dev           769 drivers/infiniband/core/cma.c 	cma_dev = listen_id_priv->cma_dev;
cma_dev           772 drivers/infiniband/core/cma.c 	sgid_attr = cma_validate_port(cma_dev->device, port,
cma_dev           781 drivers/infiniband/core/cma.c 	list_for_each_entry(cma_dev, &dev_list, list) {
cma_dev           782 drivers/infiniband/core/cma.c 		for (port = 1; port <= cma_dev->device->phys_port_cnt; ++port) {
cma_dev           783 drivers/infiniband/core/cma.c 			if (listen_id_priv->cma_dev == cma_dev &&
cma_dev           787 drivers/infiniband/core/cma.c 			gid_type = cma_dev->default_gid_type[port - 1];
cma_dev           788 drivers/infiniband/core/cma.c 			sgid_attr = cma_validate_port(cma_dev->device, port,
cma_dev           801 drivers/infiniband/core/cma.c 		cma_attach_to_dev(id_priv, cma_dev);
cma_dev           812 drivers/infiniband/core/cma.c 	struct cma_device *cma_dev, *cur_dev;
cma_dev           820 drivers/infiniband/core/cma.c 	cma_dev = NULL;
cma_dev           840 drivers/infiniband/core/cma.c 					cma_dev = cur_dev;
cma_dev           846 drivers/infiniband/core/cma.c 				if (!cma_dev && (gid.global.subnet_prefix ==
cma_dev           849 drivers/infiniband/core/cma.c 					cma_dev = cur_dev;
cma_dev           861 drivers/infiniband/core/cma.c 	cma_attach_to_dev(id_priv, cma_dev);
cma_dev          1022 drivers/infiniband/core/cma.c 	BUG_ON(id_priv->cma_dev->device != id_priv->id.device);
cma_dev          1777 drivers/infiniband/core/cma.c 		if (cma_any_addr(cma_src_addr(id_priv)) && !id_priv->cma_dev)
cma_dev          1825 drivers/infiniband/core/cma.c 		if (rdma_cap_ib_mcast(id_priv->cma_dev->device,
cma_dev          1852 drivers/infiniband/core/cma.c 	if (id_priv->cma_dev) {
cma_dev          2469 drivers/infiniband/core/cma.c 			      struct cma_device *cma_dev)
cma_dev          2476 drivers/infiniband/core/cma.c 	if (cma_family(id_priv) == AF_IB && !rdma_cap_ib_cm(cma_dev->device, 1))
cma_dev          2490 drivers/infiniband/core/cma.c 	_cma_attach_to_dev(dev_id_priv, cma_dev);
cma_dev          2500 drivers/infiniband/core/cma.c 		dev_warn(&cma_dev->device->dev,
cma_dev          2506 drivers/infiniband/core/cma.c 	struct cma_device *cma_dev;
cma_dev          2510 drivers/infiniband/core/cma.c 	list_for_each_entry(cma_dev, &dev_list, list)
cma_dev          2511 drivers/infiniband/core/cma.c 		cma_listen_on_dev(id_priv, cma_dev);
cma_dev          2857 drivers/infiniband/core/cma.c 	u8 default_roce_tos = id_priv->cma_dev->default_roce_tos[id_priv->id.port_num -
cma_dev          2858 drivers/infiniband/core/cma.c 					rdma_start_port(id_priv->cma_dev->device)];
cma_dev          2969 drivers/infiniband/core/cma.c 	struct cma_device *cma_dev, *cur_dev;
cma_dev          2976 drivers/infiniband/core/cma.c 	cma_dev = NULL;
cma_dev          2983 drivers/infiniband/core/cma.c 		if (!cma_dev)
cma_dev          2984 drivers/infiniband/core/cma.c 			cma_dev = cur_dev;
cma_dev          2989 drivers/infiniband/core/cma.c 				cma_dev = cur_dev;
cma_dev          2995 drivers/infiniband/core/cma.c 	if (!cma_dev) {
cma_dev          3003 drivers/infiniband/core/cma.c 	ret = rdma_query_gid(cma_dev->device, p, 0, &gid);
cma_dev          3007 drivers/infiniband/core/cma.c 	ret = ib_get_cached_pkey(cma_dev->device, p, 0, &pkey);
cma_dev          3012 drivers/infiniband/core/cma.c 		(rdma_protocol_ib(cma_dev->device, p)) ?
cma_dev          3018 drivers/infiniband/core/cma.c 	cma_attach_to_dev(id_priv, cma_dev);
cma_dev          3046 drivers/infiniband/core/cma.c 	if (!status && !id_priv->cma_dev) {
cma_dev          3086 drivers/infiniband/core/cma.c 	if (!id_priv->cma_dev) {
cma_dev          3113 drivers/infiniband/core/cma.c 	if (!id_priv->cma_dev) {
cma_dev          3633 drivers/infiniband/core/cma.c 	if (id_priv->cma_dev)
cma_dev          4185 drivers/infiniband/core/cma.c 			id_priv->cma_dev->default_gid_type[id_priv->id.port_num -
cma_dev          4186 drivers/infiniband/core/cma.c 			rdma_start_port(id_priv->cma_dev->device)];
cma_dev          4371 drivers/infiniband/core/cma.c 	gid_type = id_priv->cma_dev->default_gid_type[id_priv->id.port_num -
cma_dev          4372 drivers/infiniband/core/cma.c 		   rdma_start_port(id_priv->cma_dev->device)];
cma_dev          4490 drivers/infiniband/core/cma.c 			BUG_ON(id_priv->cma_dev->device != id->device);
cma_dev          4535 drivers/infiniband/core/cma.c 	struct cma_device *cma_dev;
cma_dev          4546 drivers/infiniband/core/cma.c 	list_for_each_entry(cma_dev, &dev_list, list)
cma_dev          4547 drivers/infiniband/core/cma.c 		list_for_each_entry(id_priv, &cma_dev->id_list, list) {
cma_dev          4564 drivers/infiniband/core/cma.c 	struct cma_device *cma_dev;
cma_dev          4569 drivers/infiniband/core/cma.c 	cma_dev = kmalloc(sizeof *cma_dev, GFP_KERNEL);
cma_dev          4570 drivers/infiniband/core/cma.c 	if (!cma_dev)
cma_dev          4573 drivers/infiniband/core/cma.c 	cma_dev->device = device;
cma_dev          4574 drivers/infiniband/core/cma.c 	cma_dev->default_gid_type = kcalloc(device->phys_port_cnt,
cma_dev          4575 drivers/infiniband/core/cma.c 					    sizeof(*cma_dev->default_gid_type),
cma_dev          4577 drivers/infiniband/core/cma.c 	if (!cma_dev->default_gid_type)
cma_dev          4580 drivers/infiniband/core/cma.c 	cma_dev->default_roce_tos = kcalloc(device->phys_port_cnt,
cma_dev          4581 drivers/infiniband/core/cma.c 					    sizeof(*cma_dev->default_roce_tos),
cma_dev          4583 drivers/infiniband/core/cma.c 	if (!cma_dev->default_roce_tos)
cma_dev          4590 drivers/infiniband/core/cma.c 			cma_dev->default_gid_type[i - rdma_start_port(device)] =
cma_dev          4593 drivers/infiniband/core/cma.c 			cma_dev->default_gid_type[i - rdma_start_port(device)] =
cma_dev          4595 drivers/infiniband/core/cma.c 		cma_dev->default_roce_tos[i - rdma_start_port(device)] = 0;
cma_dev          4598 drivers/infiniband/core/cma.c 	init_completion(&cma_dev->comp);
cma_dev          4599 drivers/infiniband/core/cma.c 	atomic_set(&cma_dev->refcount, 1);
cma_dev          4600 drivers/infiniband/core/cma.c 	INIT_LIST_HEAD(&cma_dev->id_list);
cma_dev          4601 drivers/infiniband/core/cma.c 	ib_set_client_data(device, &cma_client, cma_dev);
cma_dev          4604 drivers/infiniband/core/cma.c 	list_add_tail(&cma_dev->list, &dev_list);
cma_dev          4606 drivers/infiniband/core/cma.c 		cma_listen_on_dev(id_priv, cma_dev);
cma_dev          4612 drivers/infiniband/core/cma.c 	kfree(cma_dev->default_gid_type);
cma_dev          4615 drivers/infiniband/core/cma.c 	kfree(cma_dev);
cma_dev          4645 drivers/infiniband/core/cma.c static void cma_process_remove(struct cma_device *cma_dev)
cma_dev          4651 drivers/infiniband/core/cma.c 	while (!list_empty(&cma_dev->id_list)) {
cma_dev          4652 drivers/infiniband/core/cma.c 		id_priv = list_entry(cma_dev->id_list.next,
cma_dev          4669 drivers/infiniband/core/cma.c 	cma_deref_dev(cma_dev);
cma_dev          4670 drivers/infiniband/core/cma.c 	wait_for_completion(&cma_dev->comp);
cma_dev          4675 drivers/infiniband/core/cma.c 	struct cma_device *cma_dev = client_data;
cma_dev          4677 drivers/infiniband/core/cma.c 	if (!cma_dev)
cma_dev          4681 drivers/infiniband/core/cma.c 	list_del(&cma_dev->list);
cma_dev          4684 drivers/infiniband/core/cma.c 	cma_process_remove(cma_dev);
cma_dev          4685 drivers/infiniband/core/cma.c 	kfree(cma_dev->default_roce_tos);
cma_dev          4686 drivers/infiniband/core/cma.c 	kfree(cma_dev->default_gid_type);
cma_dev          4687 drivers/infiniband/core/cma.c 	kfree(cma_dev);
cma_dev            79 drivers/infiniband/core/cma_configfs.c 	struct cma_device *cma_dev;
cma_dev            84 drivers/infiniband/core/cma_configfs.c 	cma_dev = cma_enum_devices_by_ibdev(filter_by_name,
cma_dev            86 drivers/infiniband/core/cma_configfs.c 	if (!cma_dev)
cma_dev            89 drivers/infiniband/core/cma_configfs.c 	*pcma_dev = cma_dev;
cma_dev            95 drivers/infiniband/core/cma_configfs.c static void cma_configfs_params_put(struct cma_device *cma_dev)
cma_dev            97 drivers/infiniband/core/cma_configfs.c 	cma_deref_dev(cma_dev);
cma_dev           103 drivers/infiniband/core/cma_configfs.c 	struct cma_device *cma_dev;
cma_dev           108 drivers/infiniband/core/cma_configfs.c 	ret = cma_configfs_params_get(item, &cma_dev, &group);
cma_dev           112 drivers/infiniband/core/cma_configfs.c 	gid_type = cma_get_default_gid_type(cma_dev, group->port_num);
cma_dev           113 drivers/infiniband/core/cma_configfs.c 	cma_configfs_params_put(cma_dev);
cma_dev           124 drivers/infiniband/core/cma_configfs.c 	struct cma_device *cma_dev;
cma_dev           132 drivers/infiniband/core/cma_configfs.c 	ret = cma_configfs_params_get(item, &cma_dev, &group);
cma_dev           136 drivers/infiniband/core/cma_configfs.c 	ret = cma_set_default_gid_type(cma_dev, group->port_num, gid_type);
cma_dev           138 drivers/infiniband/core/cma_configfs.c 	cma_configfs_params_put(cma_dev);
cma_dev           147 drivers/infiniband/core/cma_configfs.c 	struct cma_device *cma_dev;
cma_dev           152 drivers/infiniband/core/cma_configfs.c 	ret = cma_configfs_params_get(item, &cma_dev, &group);
cma_dev           156 drivers/infiniband/core/cma_configfs.c 	tos = cma_get_default_roce_tos(cma_dev, group->port_num);
cma_dev           157 drivers/infiniband/core/cma_configfs.c 	cma_configfs_params_put(cma_dev);
cma_dev           165 drivers/infiniband/core/cma_configfs.c 	struct cma_device *cma_dev;
cma_dev           174 drivers/infiniband/core/cma_configfs.c 	ret = cma_configfs_params_get(item, &cma_dev, &group);
cma_dev           178 drivers/infiniband/core/cma_configfs.c 	ret = cma_set_default_roce_tos(cma_dev, group->port_num, tos);
cma_dev           179 drivers/infiniband/core/cma_configfs.c 	cma_configfs_params_put(cma_dev);
cma_dev           198 drivers/infiniband/core/cma_configfs.c 			  struct cma_device *cma_dev)
cma_dev           206 drivers/infiniband/core/cma_configfs.c 	ibdev = cma_get_ib_dev(cma_dev);
cma_dev           287 drivers/infiniband/core/cma_configfs.c 	struct cma_device *cma_dev = cma_enum_devices_by_ibdev(filter_by_name,
cma_dev           291 drivers/infiniband/core/cma_configfs.c 	if (!cma_dev)
cma_dev           306 drivers/infiniband/core/cma_configfs.c 	err = make_cma_ports(cma_dev_group, cma_dev);
cma_dev           315 drivers/infiniband/core/cma_configfs.c 	cma_deref_dev(cma_dev);
cma_dev           319 drivers/infiniband/core/cma_configfs.c 	if (cma_dev)
cma_dev           320 drivers/infiniband/core/cma_configfs.c 		cma_deref_dev(cma_dev);
cma_dev            60 drivers/infiniband/core/cma_priv.h 	struct cma_device	*cma_dev;