Lines Matching defs:device

47 	ISER_ERR("async event %d on device %s port %d",
48 event->event, event->device->name,
194 * Queue (CQ), DMA Memory Region (DMA MR) with the device associated with
200 iser_create_device_ib_res(struct iser_device *device)
202 struct ib_device *ib_dev = device->ib_device;
206 ISER_ERR("device %s doesn't support Fastreg, "
207 "can't register memory", device->ib_device->name);
211 device->comps_used = min(mp_ncpus, device->ib_device->num_comp_vectors);
213 device->comps = malloc(device->comps_used * sizeof(*device->comps),
218 ISER_DBG("using %d CQs, device %s supports %d vectors max_cqe %d",
219 device->comps_used, device->ib_device->name,
220 device->ib_device->num_comp_vectors, max_cqe);
222 device->pd = ib_alloc_pd(device->ib_device, IB_PD_UNSAFE_GLOBAL_RKEY);
223 if (IS_ERR(device->pd))
226 for (i = 0; i < device->comps_used; i++) {
227 struct iser_comp *comp = &device->comps[i];
233 comp->device = device;
234 comp->cq = ib_create_cq(device->ib_device,
255 device->mr = device->pd->__internal_mr;
256 if (IS_ERR(device->mr))
259 INIT_IB_EVENT_HANDLER(&device->event_handler, device->ib_device,
261 if (ib_register_event_handler(&device->event_handler))
267 for (i = 0; i < device->comps_used; i++) {
268 struct iser_comp *comp = &device->comps[i];
273 for (i = 0; i < device->comps_used; i++) {
274 struct iser_comp *comp = &device->comps[i];
278 ib_dealloc_pd(device->pd);
280 free(device->comps, M_ISER_VERBS);
287 * CQ and PD created with the device associated with the adapator.
290 iser_free_device_ib_res(struct iser_device *device)
294 for (i = 0; i < device->comps_used; i++) {
295 struct iser_comp *comp = &device->comps[i];
302 (void)ib_unregister_event_handler(&device->event_handler);
303 (void)ib_dealloc_pd(device->pd);
305 free(device->comps, M_ISER_VERBS);
306 device->comps = NULL;
308 device->mr = NULL;
309 device->pd = NULL;
363 struct iser_device *device = ib_conn->device;
370 desc = iser_create_fastreg_desc(device->ib_device, device->pd);
422 struct iser_device *device;
429 device = ib_conn->device;
430 dev_attr = &device->dev_attr;
434 for (index = 0; index < device->comps_used; index++) {
435 if (device->comps[index].active_qps <
436 device->comps[min_index].active_qps)
439 ib_conn->comp = &device->comps[min_index];
464 ISER_DBG("device %s supports max_send_wr %d",
465 device->ib_device->name, dev_attr->max_qp_wr);
467 ret = rdma_create_qp(ib_conn->cma_id, device->pd, &init_attr);
488 * based on the resolved device node GUID see if there already allocated
489 * device for this device. If there's no such, create one.
494 struct iser_device *device;
498 list_for_each_entry(device, &ig.device_list, ig_list)
500 if (device->ib_device->node_guid == cma_id->device->node_guid)
503 device = malloc(sizeof *device, M_ISER_VERBS, M_WAITOK | M_ZERO);
504 /* assign this device to the device */
505 device->ib_device = cma_id->device;
506 /* init the device and link it into ig device list */
507 if (iser_create_device_ib_res(device)) {
508 free(device, M_ISER_VERBS);
509 device = NULL;
512 list_add(&device->ig_list, &ig.device_list);
515 device->refcount++;
516 ISER_INFO("device %p refcount %d", device, device->refcount);
519 return (device);
522 /* if there's no demand for this device, release it */
524 iser_device_try_release(struct iser_device *device)
527 device->refcount--;
528 ISER_INFO("device %p refcount %d", device, device->refcount);
529 if (!device->refcount) {
530 iser_free_device_ib_res(device);
531 list_del(&device->ig_list);
532 free(device, M_ISER_VERBS);
533 device = NULL;
558 * iser device and memory regoins pool (only iscsi
570 struct iser_device *device = ib_conn->device;
590 if (device != NULL) {
591 iser_device_try_release(device);
592 ib_conn->device = NULL;
701 struct iser_device *device;
709 device = iser_device_find_by_ib_device(cma_id);
710 if (!device) {
711 ISER_ERR("conn %p device lookup/creation failed",
717 ib_conn->device = device;
738 struct iser_device *device = ib_conn->device;
745 conn_param.responder_resources = device->dev_attr.max_qp_rd_atom;
859 sge.lkey = ib_conn->device->mr->lkey;
921 ib_dma_sync_single_for_device(ib_conn->device->ib_device,