Lines Matching refs:srp_dev
240 iu->dma = ib_dma_map_single(host->srp_dev->dev, iu->buf, size, in srp_alloc_iu()
242 if (ib_dma_mapping_error(host->srp_dev->dev, iu->dma)) in srp_alloc_iu()
263 ib_dma_unmap_single(host->srp_dev->dev, iu->dma, iu->size, in srp_free_iu()
285 ret = ib_find_cached_pkey(target->srp_host->srp_dev->dev, in srp_init_ib_qp()
313 new_cm_id = ib_create_cm_id(target->srp_host->srp_dev->dev, in srp_new_ib_cm_id()
321 if (rdma_cap_opa_ah(target->srp_host->srp_dev->dev, in srp_new_ib_cm_id()
504 struct srp_device *dev = target->srp_host->srp_dev; in srp_alloc_fr_pool()
531 struct srp_device *dev = target->srp_host->srp_dev; in srp_create_ch_ib()
644 struct srp_device *dev = target->srp_host->srp_dev; in srp_free_ch_ib()
726 target->srp_host->srp_dev->dev, in srp_ib_lookup_path()
789 ret = ib_query_port(host->srp_dev->dev, host->port, &attr); in srp_get_subnet_timeout()
795 dev_name(&host->srp_dev->dev->dev), subnet_timeout); in srp_get_subnet_timeout()
912 memcpy(ipi + 8, &target->srp_host->srp_dev->dev->node_guid, 8); in srp_send_req()
971 struct srp_device *dev = target->srp_host->srp_dev; in srp_exit_cmd_priv()
989 struct srp_device *srp_dev = target->srp_host->srp_dev; in srp_init_cmd_priv() local
990 struct ib_device *ibdev = srp_dev->dev; in srp_init_cmd_priv()
995 if (srp_dev->use_fast_reg) { in srp_init_cmd_priv()
1186 struct srp_device *dev = target->srp_host->srp_dev; in srp_unmap_data()
1431 struct srp_device *dev = target->srp_host->srp_dev; in srp_map_finish_fr()
1560 struct srp_device *dev = target->srp_host->srp_dev; in srp_map_idb()
1598 struct srp_device *dev = ch->target->srp_host->srp_dev; in srp_check_mapping()
1658 dev = target->srp_host->srp_dev; in srp_map_data()
2005 struct ib_device *dev = target->srp_host->srp_dev->dev; in srp_response_common()
2073 struct ib_device *dev = target->srp_host->srp_dev->dev; in srp_recv_done()
2188 dev = target->srp_host->srp_dev->dev; in srp_queuecommand()
2728 struct ib_device *dev = target->srp_host->srp_dev->dev; in srp_send_tsk_mgmt()
3003 dev_name(&target->srp_host->srp_dev->dev->dev)); in local_ib_device_show()
3132 if (scsi_add_host(target->scsi_host, host->srp_dev->dev->dev.parent)) in srp_add_target()
3705 struct srp_device *srp_dev = host->srp_dev; in add_target_store() local
3706 struct ib_device *ibdev = srp_dev->dev; in add_target_store()
3725 target_host->virt_boundary_mask = ~srp_dev->mr_page_mask; in add_target_store()
3733 target->lkey = host->srp_dev->pd->local_dma_lkey; in add_target_store()
3734 target->global_rkey = host->srp_dev->global_rkey; in add_target_store()
3773 if (!srp_dev->has_fr && !target->allow_ext_sg && in add_target_store()
3779 if (srp_dev->use_fast_reg) { in add_target_store()
3783 max_sectors_per_mr = srp_dev->max_pages_per_mr << in add_target_store()
3784 (ilog2(srp_dev->mr_page_size) - 9); in add_target_store()
3805 srp_dev->max_pages_per_mr - 1) / in add_target_store()
3806 srp_dev->max_pages_per_mr; in add_target_store()
3809 target->scsi_host->max_sectors, srp_dev->max_pages_per_mr, srp_dev->mr_page_size, in add_target_store()
3948 return sysfs_emit(buf, "%s\n", dev_name(&host->srp_dev->dev->dev)); in ibdev_show()
3981 host->srp_dev = device; in srp_add_port()
4003 struct srp_device *srp_dev = client_data; in srp_rename_dev() local
4006 list_for_each_entry_safe(host, tmp_host, &srp_dev->dev_list, list) { in srp_rename_dev()
4017 struct srp_device *srp_dev; in srp_add_one() local
4025 srp_dev = kzalloc(sizeof(*srp_dev), GFP_KERNEL); in srp_add_one()
4026 if (!srp_dev) in srp_add_one()
4035 srp_dev->mr_page_size = 1 << mr_page_shift; in srp_add_one()
4036 srp_dev->mr_page_mask = ~((u64) srp_dev->mr_page_size - 1); in srp_add_one()
4038 do_div(max_pages_per_mr, srp_dev->mr_page_size); in srp_add_one()
4040 attr->max_mr_size, srp_dev->mr_page_size, in srp_add_one()
4042 srp_dev->max_pages_per_mr = min_t(u64, SRP_MAX_PAGES_PER_MR, in srp_add_one()
4045 srp_dev->has_fr = (attr->device_cap_flags & in srp_add_one()
4047 if (!never_register && !srp_dev->has_fr) in srp_add_one()
4050 attr->max_mr_size >= 2 * srp_dev->mr_page_size) in srp_add_one()
4051 srp_dev->use_fast_reg = srp_dev->has_fr; in srp_add_one()
4053 if (never_register || !register_always || !srp_dev->has_fr) in srp_add_one()
4056 if (srp_dev->use_fast_reg) { in srp_add_one()
4057 srp_dev->max_pages_per_mr = in srp_add_one()
4058 min_t(u32, srp_dev->max_pages_per_mr, in srp_add_one()
4061 srp_dev->mr_max_size = srp_dev->mr_page_size * in srp_add_one()
4062 srp_dev->max_pages_per_mr; in srp_add_one()
4066 srp_dev->max_pages_per_mr, srp_dev->mr_max_size); in srp_add_one()
4068 INIT_LIST_HEAD(&srp_dev->dev_list); in srp_add_one()
4070 srp_dev->dev = device; in srp_add_one()
4071 srp_dev->pd = ib_alloc_pd(device, flags); in srp_add_one()
4072 if (IS_ERR(srp_dev->pd)) { in srp_add_one()
4073 int ret = PTR_ERR(srp_dev->pd); in srp_add_one()
4075 kfree(srp_dev); in srp_add_one()
4080 srp_dev->global_rkey = srp_dev->pd->unsafe_global_rkey; in srp_add_one()
4081 WARN_ON_ONCE(srp_dev->global_rkey == 0); in srp_add_one()
4085 host = srp_add_port(srp_dev, p); in srp_add_one()
4087 list_add_tail(&host->list, &srp_dev->dev_list); in srp_add_one()
4090 ib_set_client_data(device, &srp_client, srp_dev); in srp_add_one()
4096 struct srp_device *srp_dev; in srp_remove_one() local
4100 srp_dev = client_data; in srp_remove_one()
4102 list_for_each_entry_safe(host, tmp_host, &srp_dev->dev_list, list) { in srp_remove_one()
4128 ib_dealloc_pd(srp_dev->pd); in srp_remove_one()
4130 kfree(srp_dev); in srp_remove_one()