Lines Matching refs:vf

22 	struct ifcvf_hw *vf = arg;  in ifcvf_config_changed()  local
24 if (vf->config_cb.callback) in ifcvf_config_changed()
25 return vf->config_cb.callback(vf->config_cb.private); in ifcvf_config_changed()
42 struct ifcvf_hw *vf = arg; in ifcvf_vqs_reused_intr_handler() local
46 for (i = 0; i < vf->nr_vring; i++) { in ifcvf_vqs_reused_intr_handler()
47 vring = &vf->vring[i]; in ifcvf_vqs_reused_intr_handler()
57 struct ifcvf_hw *vf = arg; in ifcvf_dev_intr_handler() local
60 isr = vp_ioread8(vf->isr); in ifcvf_dev_intr_handler()
75 struct ifcvf_hw *vf = &adapter->vf; in ifcvf_free_per_vq_irq() local
78 for (i = 0; i < vf->nr_vring; i++) { in ifcvf_free_per_vq_irq()
79 if (vf->vring[i].irq != -EINVAL) { in ifcvf_free_per_vq_irq()
80 devm_free_irq(&pdev->dev, vf->vring[i].irq, &vf->vring[i]); in ifcvf_free_per_vq_irq()
81 vf->vring[i].irq = -EINVAL; in ifcvf_free_per_vq_irq()
89 struct ifcvf_hw *vf = &adapter->vf; in ifcvf_free_vqs_reused_irq() local
91 if (vf->vqs_reused_irq != -EINVAL) { in ifcvf_free_vqs_reused_irq()
92 devm_free_irq(&pdev->dev, vf->vqs_reused_irq, vf); in ifcvf_free_vqs_reused_irq()
93 vf->vqs_reused_irq = -EINVAL; in ifcvf_free_vqs_reused_irq()
100 struct ifcvf_hw *vf = &adapter->vf; in ifcvf_free_vq_irq() local
102 if (vf->msix_vector_status == MSIX_VECTOR_PER_VQ_AND_CONFIG) in ifcvf_free_vq_irq()
111 struct ifcvf_hw *vf = &adapter->vf; in ifcvf_free_config_irq() local
113 if (vf->config_irq == -EINVAL) in ifcvf_free_config_irq()
120 if (vf->msix_vector_status != MSIX_VECTOR_DEV_SHARED) { in ifcvf_free_config_irq()
121 devm_free_irq(&pdev->dev, vf->config_irq, vf); in ifcvf_free_config_irq()
122 vf->config_irq = -EINVAL; in ifcvf_free_config_irq()
143 struct ifcvf_hw *vf = &adapter->vf; in ifcvf_alloc_vectors() local
147 max_intr = vf->nr_vring + 1; in ifcvf_alloc_vectors()
166 struct ifcvf_hw *vf = &adapter->vf; in ifcvf_request_per_vq_irq() local
169 vf->vqs_reused_irq = -EINVAL; in ifcvf_request_per_vq_irq()
170 for (i = 0; i < vf->nr_vring; i++) { in ifcvf_request_per_vq_irq()
171 snprintf(vf->vring[i].msix_name, 256, "ifcvf[%s]-%d\n", pci_name(pdev), i); in ifcvf_request_per_vq_irq()
176 vf->vring[i].msix_name, in ifcvf_request_per_vq_irq()
177 &vf->vring[i]); in ifcvf_request_per_vq_irq()
183 vf->vring[i].irq = irq; in ifcvf_request_per_vq_irq()
184 ret = ifcvf_set_vq_vector(vf, i, vector); in ifcvf_request_per_vq_irq()
201 struct ifcvf_hw *vf = &adapter->vf; in ifcvf_request_vqs_reused_irq() local
205 snprintf(vf->vring[0].msix_name, 256, "ifcvf[%s]-vqs-reused-irq\n", pci_name(pdev)); in ifcvf_request_vqs_reused_irq()
209 vf->vring[0].msix_name, vf); in ifcvf_request_vqs_reused_irq()
215 vf->vqs_reused_irq = irq; in ifcvf_request_vqs_reused_irq()
216 for (i = 0; i < vf->nr_vring; i++) { in ifcvf_request_vqs_reused_irq()
217 vf->vring[i].irq = -EINVAL; in ifcvf_request_vqs_reused_irq()
218 ret = ifcvf_set_vq_vector(vf, i, vector); in ifcvf_request_vqs_reused_irq()
235 struct ifcvf_hw *vf = &adapter->vf; in ifcvf_request_dev_irq() local
239 snprintf(vf->vring[0].msix_name, 256, "ifcvf[%s]-dev-irq\n", pci_name(pdev)); in ifcvf_request_dev_irq()
243 vf->vring[0].msix_name, vf); in ifcvf_request_dev_irq()
249 vf->vqs_reused_irq = irq; in ifcvf_request_dev_irq()
250 for (i = 0; i < vf->nr_vring; i++) { in ifcvf_request_dev_irq()
251 vf->vring[i].irq = -EINVAL; in ifcvf_request_dev_irq()
252 ret = ifcvf_set_vq_vector(vf, i, vector); in ifcvf_request_dev_irq()
259 vf->config_irq = irq; in ifcvf_request_dev_irq()
260 ret = ifcvf_set_config_vector(vf, vector); in ifcvf_request_dev_irq()
276 struct ifcvf_hw *vf = &adapter->vf; in ifcvf_request_vq_irq() local
279 if (vf->msix_vector_status == MSIX_VECTOR_PER_VQ_AND_CONFIG) in ifcvf_request_vq_irq()
290 struct ifcvf_hw *vf = &adapter->vf; in ifcvf_request_config_irq() local
293 if (vf->msix_vector_status == MSIX_VECTOR_PER_VQ_AND_CONFIG) in ifcvf_request_config_irq()
294 config_vector = vf->nr_vring; in ifcvf_request_config_irq()
295 else if (vf->msix_vector_status == MSIX_VECTOR_SHARED_VQ_AND_CONFIG) in ifcvf_request_config_irq()
298 else if (vf->msix_vector_status == MSIX_VECTOR_DEV_SHARED) in ifcvf_request_config_irq()
304 snprintf(vf->config_msix_name, 256, "ifcvf[%s]-config\n", in ifcvf_request_config_irq()
306 vf->config_irq = pci_irq_vector(pdev, config_vector); in ifcvf_request_config_irq()
307 ret = devm_request_irq(&pdev->dev, vf->config_irq, in ifcvf_request_config_irq()
309 vf->config_msix_name, vf); in ifcvf_request_config_irq()
315 ret = ifcvf_set_config_vector(vf, config_vector); in ifcvf_request_config_irq()
330 struct ifcvf_hw *vf = &adapter->vf; in ifcvf_request_irq() local
337 vf->msix_vector_status = MSIX_VECTOR_PER_VQ_AND_CONFIG; in ifcvf_request_irq()
338 max_intr = vf->nr_vring + 1; in ifcvf_request_irq()
340 vf->msix_vector_status = MSIX_VECTOR_SHARED_VQ_AND_CONFIG; in ifcvf_request_irq()
343 vf->msix_vector_status = MSIX_VECTOR_DEV_SHARED; in ifcvf_request_irq()
363 struct ifcvf_hw *vf = ifcvf_private_to_vf(private); in ifcvf_start_datapath() local
367 ret = ifcvf_start_hw(vf); in ifcvf_start_datapath()
369 status = ifcvf_get_status(vf); in ifcvf_start_datapath()
371 ifcvf_set_status(vf, status); in ifcvf_start_datapath()
379 struct ifcvf_hw *vf = ifcvf_private_to_vf(private); in ifcvf_stop_datapath() local
382 for (i = 0; i < vf->nr_vring; i++) in ifcvf_stop_datapath()
383 vf->vring[i].cb.callback = NULL; in ifcvf_stop_datapath()
385 ifcvf_stop_hw(vf); in ifcvf_stop_datapath()
392 struct ifcvf_hw *vf = ifcvf_private_to_vf(adapter); in ifcvf_reset_vring() local
395 for (i = 0; i < vf->nr_vring; i++) { in ifcvf_reset_vring()
396 vf->vring[i].last_avail_idx = 0; in ifcvf_reset_vring()
397 vf->vring[i].desc = 0; in ifcvf_reset_vring()
398 vf->vring[i].avail = 0; in ifcvf_reset_vring()
399 vf->vring[i].used = 0; in ifcvf_reset_vring()
400 vf->vring[i].ready = 0; in ifcvf_reset_vring()
401 vf->vring[i].cb.callback = NULL; in ifcvf_reset_vring()
402 vf->vring[i].cb.private = NULL; in ifcvf_reset_vring()
405 ifcvf_reset(vf); in ifcvf_reset_vring()
417 return &adapter->vf; in vdpa_to_vf()
423 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_get_device_features() local
425 u32 type = vf->dev_type; in ifcvf_vdpa_get_device_features()
429 features = ifcvf_get_features(vf); in ifcvf_vdpa_get_device_features()
432 IFCVF_ERR(pdev, "VIRTIO ID %u not supported\n", vf->dev_type); in ifcvf_vdpa_get_device_features()
440 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_set_driver_features() local
443 ret = ifcvf_verify_min_features(vf, features); in ifcvf_vdpa_set_driver_features()
447 vf->req_features = features; in ifcvf_vdpa_set_driver_features()
454 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_get_driver_features() local
456 return vf->req_features; in ifcvf_vdpa_get_driver_features()
461 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_get_status() local
463 return ifcvf_get_status(vf); in ifcvf_vdpa_get_status()
469 struct ifcvf_hw *vf; in ifcvf_vdpa_set_status() local
473 vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_set_status()
475 status_old = ifcvf_get_status(vf); in ifcvf_vdpa_set_status()
484 status = ifcvf_get_status(vf); in ifcvf_vdpa_set_status()
486 ifcvf_set_status(vf, status); in ifcvf_vdpa_set_status()
496 ifcvf_set_status(vf, status); in ifcvf_vdpa_set_status()
502 struct ifcvf_hw *vf; in ifcvf_vdpa_reset() local
505 vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_reset()
507 status_old = ifcvf_get_status(vf); in ifcvf_vdpa_reset()
530 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_get_vq_state() local
532 state->split.avail_index = ifcvf_get_vq_state(vf, qid); in ifcvf_vdpa_get_vq_state()
539 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_set_vq_state() local
541 return ifcvf_set_vq_state(vf, qid, state->split.avail_index); in ifcvf_vdpa_set_vq_state()
547 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_set_vq_cb() local
549 vf->vring[qid].cb = *cb; in ifcvf_vdpa_set_vq_cb()
555 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_set_vq_ready() local
557 vf->vring[qid].ready = ready; in ifcvf_vdpa_set_vq_ready()
562 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_get_vq_ready() local
564 return vf->vring[qid].ready; in ifcvf_vdpa_get_vq_ready()
570 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_set_vq_num() local
572 vf->vring[qid].size = num; in ifcvf_vdpa_set_vq_num()
579 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_set_vq_address() local
581 vf->vring[qid].desc = desc_area; in ifcvf_vdpa_set_vq_address()
582 vf->vring[qid].avail = driver_area; in ifcvf_vdpa_set_vq_address()
583 vf->vring[qid].used = device_area; in ifcvf_vdpa_set_vq_address()
590 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_kick_vq() local
592 ifcvf_notify_queue(vf, qid); in ifcvf_vdpa_kick_vq()
597 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_get_generation() local
599 return vp_ioread8(&vf->common_cfg->config_generation); in ifcvf_vdpa_get_generation()
604 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_get_device_id() local
606 return vf->dev_type; in ifcvf_vdpa_get_device_id()
624 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_get_config_size() local
626 return vf->config_size; in ifcvf_vdpa_get_config_size()
638 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_get_config() local
640 ifcvf_read_dev_config(vf, offset, buf, len); in ifcvf_vdpa_get_config()
647 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_set_config() local
649 ifcvf_write_dev_config(vf, offset, buf, len); in ifcvf_vdpa_set_config()
655 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_set_config_cb() local
657 vf->config_cb.callback = cb->callback; in ifcvf_vdpa_set_config_cb()
658 vf->config_cb.private = cb->private; in ifcvf_vdpa_set_config_cb()
664 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_vdpa_get_vq_irq() local
666 if (vf->vqs_reused_irq < 0) in ifcvf_vdpa_get_vq_irq()
667 return vf->vring[qid].irq; in ifcvf_vdpa_get_vq_irq()
675 struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); in ifcvf_get_vq_notification() local
678 area.addr = vf->vring[idx].notify_pa; in ifcvf_get_vq_notification()
679 if (!vf->notify_off_multiplier) in ifcvf_get_vq_notification()
682 area.size = vf->notify_off_multiplier; in ifcvf_get_vq_notification()
756 struct ifcvf_hw *vf; in ifcvf_vdpa_dev_add() local
775 vf = &adapter->vf; in ifcvf_vdpa_dev_add()
776 vf->dev_type = get_dev_type(pdev); in ifcvf_vdpa_dev_add()
777 vf->base = pcim_iomap_table(pdev); in ifcvf_vdpa_dev_add()
782 ret = ifcvf_init_hw(vf, pdev); in ifcvf_vdpa_dev_add()
788 for (i = 0; i < vf->nr_vring; i++) in ifcvf_vdpa_dev_add()
789 vf->vring[i].irq = -EINVAL; in ifcvf_vdpa_dev_add()
791 vf->hw_features = ifcvf_get_hw_features(vf); in ifcvf_vdpa_dev_add()
792 vf->config_size = ifcvf_get_config_size(vf); in ifcvf_vdpa_dev_add()
795 ret = _vdpa_register_device(&adapter->vdpa, vf->nr_vring); in ifcvf_vdpa_dev_add()