Lines Matching refs:vf
192 static unsigned abs_index(struct efx_vf *vf, unsigned index) in abs_index() argument
194 return EFX_VI_BASE + vf->index * efx_vf_size(vf->efx) + index; in abs_index()
302 static void efx_siena_sriov_reset_tx_filter(struct efx_vf *vf) in efx_siena_sriov_reset_tx_filter() argument
304 struct efx_nic *efx = vf->efx; in efx_siena_sriov_reset_tx_filter()
309 if (vf->tx_filter_id != -1) { in efx_siena_sriov_reset_tx_filter()
311 vf->tx_filter_id); in efx_siena_sriov_reset_tx_filter()
313 vf->pci_name, vf->tx_filter_id); in efx_siena_sriov_reset_tx_filter()
314 vf->tx_filter_id = -1; in efx_siena_sriov_reset_tx_filter()
317 if (is_zero_ether_addr(vf->addr.mac_addr)) in efx_siena_sriov_reset_tx_filter()
323 if (vf->tx_filter_mode == VF_TX_FILTER_AUTO && vf_max_tx_channels <= 2) in efx_siena_sriov_reset_tx_filter()
324 vf->tx_filter_mode = VF_TX_FILTER_ON; in efx_siena_sriov_reset_tx_filter()
326 vlan = ntohs(vf->addr.tci) & VLAN_VID_MASK; in efx_siena_sriov_reset_tx_filter()
327 efx_filter_init_tx(&filter, abs_index(vf, 0)); in efx_siena_sriov_reset_tx_filter()
330 vf->addr.mac_addr); in efx_siena_sriov_reset_tx_filter()
337 vf->pci_name); in efx_siena_sriov_reset_tx_filter()
340 vf->pci_name, rc); in efx_siena_sriov_reset_tx_filter()
341 vf->tx_filter_id = rc; in efx_siena_sriov_reset_tx_filter()
346 static void efx_siena_sriov_reset_rx_filter(struct efx_vf *vf) in efx_siena_sriov_reset_rx_filter() argument
348 struct efx_nic *efx = vf->efx; in efx_siena_sriov_reset_rx_filter()
353 if (vf->rx_filter_id != -1) { in efx_siena_sriov_reset_rx_filter()
355 vf->rx_filter_id); in efx_siena_sriov_reset_rx_filter()
357 vf->pci_name, vf->rx_filter_id); in efx_siena_sriov_reset_rx_filter()
358 vf->rx_filter_id = -1; in efx_siena_sriov_reset_rx_filter()
361 if (!vf->rx_filtering || is_zero_ether_addr(vf->addr.mac_addr)) in efx_siena_sriov_reset_rx_filter()
364 vlan = ntohs(vf->addr.tci) & VLAN_VID_MASK; in efx_siena_sriov_reset_rx_filter()
366 vf->rx_filter_flags, in efx_siena_sriov_reset_rx_filter()
367 abs_index(vf, vf->rx_filter_qid)); in efx_siena_sriov_reset_rx_filter()
370 vf->addr.mac_addr); in efx_siena_sriov_reset_rx_filter()
377 vf->pci_name); in efx_siena_sriov_reset_rx_filter()
380 vf->pci_name, rc); in efx_siena_sriov_reset_rx_filter()
381 vf->rx_filter_id = rc; in efx_siena_sriov_reset_rx_filter()
385 static void __efx_siena_sriov_update_vf_addr(struct efx_vf *vf) in __efx_siena_sriov_update_vf_addr() argument
387 struct efx_nic *efx = vf->efx; in __efx_siena_sriov_update_vf_addr()
390 efx_siena_sriov_reset_tx_filter(vf); in __efx_siena_sriov_update_vf_addr()
391 efx_siena_sriov_reset_rx_filter(vf); in __efx_siena_sriov_update_vf_addr()
400 static void __efx_siena_sriov_push_vf_status(struct efx_vf *vf) in __efx_siena_sriov_push_vf_status() argument
402 struct efx_nic *efx = vf->efx; in __efx_siena_sriov_push_vf_status()
411 WARN_ON(!mutex_is_locked(&vf->status_lock)); in __efx_siena_sriov_push_vf_status()
412 WARN_ON(!vf->status_addr); in __efx_siena_sriov_push_vf_status()
414 status->local = vf->addr; in __efx_siena_sriov_push_vf_status()
420 copy[0].to_rid = vf->pci_rid; in __efx_siena_sriov_push_vf_status()
421 copy[0].to_addr = vf->status_addr + offsetof(struct vfdi_status, in __efx_siena_sriov_push_vf_status()
431 copy[1].to_rid = vf->pci_rid; in __efx_siena_sriov_push_vf_status()
432 copy[1].to_addr = vf->status_addr + data_offset; in __efx_siena_sriov_push_vf_status()
439 if (count == vf->peer_page_count) { in __efx_siena_sriov_push_vf_status()
448 copy[pos].to_rid = vf->pci_rid; in __efx_siena_sriov_push_vf_status()
449 copy[pos].to_addr = vf->peer_page_addrs[count]; in __efx_siena_sriov_push_vf_status()
461 copy[pos].to_rid = vf->pci_rid; in __efx_siena_sriov_push_vf_status()
462 copy[pos].to_addr = vf->status_addr + offsetof(struct vfdi_status, in __efx_siena_sriov_push_vf_status()
470 VFDI_EV_SEQ, (vf->msg_seqno & 0xff), in __efx_siena_sriov_push_vf_status()
472 ++vf->msg_seqno; in __efx_siena_sriov_push_vf_status()
474 EFX_VI_BASE + vf->index * efx_vf_size(efx), in __efx_siena_sriov_push_vf_status()
523 *vf_out = efx->vf + vf_i; in map_vi_index()
529 static int efx_vfdi_init_evq(struct efx_vf *vf) in efx_vfdi_init_evq() argument
531 struct efx_nic *efx = vf->efx; in efx_vfdi_init_evq()
532 struct vfdi_req *req = vf->buf.addr; in efx_vfdi_init_evq()
535 unsigned abs_evq = abs_index(vf, vf_evq); in efx_vfdi_init_evq()
536 unsigned buftbl = EFX_BUFTBL_EVQ_BASE(vf, vf_evq); in efx_vfdi_init_evq()
544 vf->pci_name, vf_evq, buf_count); in efx_vfdi_init_evq()
562 memcpy(vf->evq0_addrs, req->u.init_evq.addr, in efx_vfdi_init_evq()
564 vf->evq0_count = buf_count; in efx_vfdi_init_evq()
570 static int efx_vfdi_init_rxq(struct efx_vf *vf) in efx_vfdi_init_rxq() argument
572 struct efx_nic *efx = vf->efx; in efx_vfdi_init_rxq()
573 struct vfdi_req *req = vf->buf.addr; in efx_vfdi_init_rxq()
577 unsigned buftbl = EFX_BUFTBL_RXQ_BASE(vf, vf_rxq); in efx_vfdi_init_rxq()
587 "buf_count %d\n", vf->pci_name, vf_rxq, in efx_vfdi_init_rxq()
591 if (__test_and_set_bit(req->u.init_rxq.index, vf->rxq_mask)) in efx_vfdi_init_rxq()
592 ++vf->rxq_count; in efx_vfdi_init_rxq()
598 FRF_AZ_RX_DESCQ_EVQ_ID, abs_index(vf, vf_evq), in efx_vfdi_init_rxq()
606 abs_index(vf, vf_rxq)); in efx_vfdi_init_rxq()
611 static int efx_vfdi_init_txq(struct efx_vf *vf) in efx_vfdi_init_txq() argument
613 struct efx_nic *efx = vf->efx; in efx_vfdi_init_txq()
614 struct vfdi_req *req = vf->buf.addr; in efx_vfdi_init_txq()
618 unsigned buftbl = EFX_BUFTBL_TXQ_BASE(vf, vf_txq); in efx_vfdi_init_txq()
628 "buf_count %d\n", vf->pci_name, vf_txq, in efx_vfdi_init_txq()
633 mutex_lock(&vf->txq_lock); in efx_vfdi_init_txq()
634 if (__test_and_set_bit(req->u.init_txq.index, vf->txq_mask)) in efx_vfdi_init_txq()
635 ++vf->txq_count; in efx_vfdi_init_txq()
636 mutex_unlock(&vf->txq_lock); in efx_vfdi_init_txq()
639 eth_filt_en = vf->tx_filter_mode == VF_TX_FILTER_ON; in efx_vfdi_init_txq()
647 FRF_AZ_TX_DESCQ_EVQ_ID, abs_index(vf, vf_evq), in efx_vfdi_init_txq()
652 abs_index(vf, vf_txq)); in efx_vfdi_init_txq()
658 static bool efx_vfdi_flush_wake(struct efx_vf *vf) in efx_vfdi_flush_wake() argument
663 return (!vf->txq_count && !vf->rxq_count) || in efx_vfdi_flush_wake()
664 atomic_read(&vf->rxq_retry_count); in efx_vfdi_flush_wake()
667 static void efx_vfdi_flush_clear(struct efx_vf *vf) in efx_vfdi_flush_clear() argument
669 memset(vf->txq_mask, 0, sizeof(vf->txq_mask)); in efx_vfdi_flush_clear()
670 vf->txq_count = 0; in efx_vfdi_flush_clear()
671 memset(vf->rxq_mask, 0, sizeof(vf->rxq_mask)); in efx_vfdi_flush_clear()
672 vf->rxq_count = 0; in efx_vfdi_flush_clear()
673 memset(vf->rxq_retry_mask, 0, sizeof(vf->rxq_retry_mask)); in efx_vfdi_flush_clear()
674 atomic_set(&vf->rxq_retry_count, 0); in efx_vfdi_flush_clear()
677 static int efx_vfdi_fini_all_queues(struct efx_vf *vf) in efx_vfdi_fini_all_queues() argument
679 struct efx_nic *efx = vf->efx; in efx_vfdi_fini_all_queues()
682 unsigned vf_offset = EFX_VI_BASE + vf->index * efx_vf_size(efx); in efx_vfdi_fini_all_queues()
698 if (test_bit(index, vf->txq_mask)) { in efx_vfdi_fini_all_queues()
705 if (test_bit(index, vf->rxq_mask)) { in efx_vfdi_fini_all_queues()
713 atomic_set(&vf->rxq_retry_count, 0); in efx_vfdi_fini_all_queues()
714 while (timeout && (vf->rxq_count || vf->txq_count)) { in efx_vfdi_fini_all_queues()
720 timeout = wait_event_timeout(vf->flush_waitq, in efx_vfdi_fini_all_queues()
721 efx_vfdi_flush_wake(vf), in efx_vfdi_fini_all_queues()
725 if (test_and_clear_bit(index, vf->rxq_retry_mask)) { in efx_vfdi_fini_all_queues()
726 atomic_dec(&vf->rxq_retry_count); in efx_vfdi_fini_all_queues()
751 efx_siena_sriov_bufs(efx, vf->buftbl_base, NULL, in efx_vfdi_fini_all_queues()
753 efx_vfdi_flush_clear(vf); in efx_vfdi_fini_all_queues()
755 vf->evq0_count = 0; in efx_vfdi_fini_all_queues()
760 static int efx_vfdi_insert_filter(struct efx_vf *vf) in efx_vfdi_insert_filter() argument
762 struct efx_nic *efx = vf->efx; in efx_vfdi_insert_filter()
764 struct vfdi_req *req = vf->buf.addr; in efx_vfdi_insert_filter()
768 if (bad_vf_index(efx, vf_rxq) || vf->rx_filtering) { in efx_vfdi_insert_filter()
772 "flags 0x%x\n", vf->pci_name, vf_rxq, in efx_vfdi_insert_filter()
782 vf->rx_filter_flags = flags; in efx_vfdi_insert_filter()
783 vf->rx_filter_qid = vf_rxq; in efx_vfdi_insert_filter()
784 vf->rx_filtering = true; in efx_vfdi_insert_filter()
786 efx_siena_sriov_reset_rx_filter(vf); in efx_vfdi_insert_filter()
792 static int efx_vfdi_remove_all_filters(struct efx_vf *vf) in efx_vfdi_remove_all_filters() argument
794 struct efx_nic *efx = vf->efx; in efx_vfdi_remove_all_filters()
797 vf->rx_filtering = false; in efx_vfdi_remove_all_filters()
798 efx_siena_sriov_reset_rx_filter(vf); in efx_vfdi_remove_all_filters()
804 static int efx_vfdi_set_status_page(struct efx_vf *vf) in efx_vfdi_set_status_page() argument
806 struct efx_nic *efx = vf->efx; in efx_vfdi_set_status_page()
808 struct vfdi_req *req = vf->buf.addr; in efx_vfdi_set_status_page()
819 vf->pci_name); in efx_vfdi_set_status_page()
824 mutex_lock(&vf->status_lock); in efx_vfdi_set_status_page()
825 vf->status_addr = req->u.set_status_page.dma_addr; in efx_vfdi_set_status_page()
827 kfree(vf->peer_page_addrs); in efx_vfdi_set_status_page()
828 vf->peer_page_addrs = NULL; in efx_vfdi_set_status_page()
829 vf->peer_page_count = 0; in efx_vfdi_set_status_page()
832 vf->peer_page_addrs = kcalloc(page_count, sizeof(u64), in efx_vfdi_set_status_page()
834 if (vf->peer_page_addrs) { in efx_vfdi_set_status_page()
835 memcpy(vf->peer_page_addrs, in efx_vfdi_set_status_page()
838 vf->peer_page_count = page_count; in efx_vfdi_set_status_page()
842 __efx_siena_sriov_push_vf_status(vf); in efx_vfdi_set_status_page()
843 mutex_unlock(&vf->status_lock); in efx_vfdi_set_status_page()
849 static int efx_vfdi_clear_status_page(struct efx_vf *vf) in efx_vfdi_clear_status_page() argument
851 mutex_lock(&vf->status_lock); in efx_vfdi_clear_status_page()
852 vf->status_addr = 0; in efx_vfdi_clear_status_page()
853 mutex_unlock(&vf->status_lock); in efx_vfdi_clear_status_page()
858 typedef int (*efx_vfdi_op_t)(struct efx_vf *vf);
873 struct efx_vf *vf = container_of(work, struct efx_vf, req); in efx_siena_sriov_vfdi() local
874 struct efx_nic *efx = vf->efx; in efx_siena_sriov_vfdi()
875 struct vfdi_req *req = vf->buf.addr; in efx_siena_sriov_vfdi()
881 copy[0].from_rid = vf->pci_rid; in efx_siena_sriov_vfdi()
882 copy[0].from_addr = vf->req_addr; in efx_siena_sriov_vfdi()
884 copy[0].to_addr = vf->buf.dma_addr; in efx_siena_sriov_vfdi()
892 vf->pci_name, -rc); in efx_siena_sriov_vfdi()
893 vf->busy = false; in efx_siena_sriov_vfdi()
898 rc = vfdi_ops[req->op](vf); in efx_siena_sriov_vfdi()
902 req->op, vf->pci_name); in efx_siena_sriov_vfdi()
907 "%llx\n", req->op, vf->pci_name, in efx_siena_sriov_vfdi()
908 (unsigned long long)vf->req_addr); in efx_siena_sriov_vfdi()
913 vf->busy = false; in efx_siena_sriov_vfdi()
922 copy[0].to_rid = vf->pci_rid; in efx_siena_sriov_vfdi()
923 copy[0].to_addr = vf->req_addr + offsetof(struct vfdi_req, rc); in efx_siena_sriov_vfdi()
926 copy[1].to_rid = vf->pci_rid; in efx_siena_sriov_vfdi()
927 copy[1].to_addr = vf->req_addr + offsetof(struct vfdi_req, op); in efx_siena_sriov_vfdi()
939 static void efx_siena_sriov_reset_vf(struct efx_vf *vf, in efx_siena_sriov_reset_vf() argument
942 struct efx_nic *efx = vf->efx; in efx_siena_sriov_reset_vf()
952 if (!vf->evq0_count) in efx_siena_sriov_reset_vf()
954 BUG_ON(vf->evq0_count & (vf->evq0_count - 1)); in efx_siena_sriov_reset_vf()
956 mutex_lock(&vf->status_lock); in efx_siena_sriov_reset_vf()
959 VFDI_EV_SEQ, vf->msg_seqno, in efx_siena_sriov_reset_vf()
961 vf->msg_seqno++; in efx_siena_sriov_reset_vf()
965 for (pos = 0; pos < vf->evq0_count; pos += count) { in efx_siena_sriov_reset_vf()
966 count = min_t(unsigned, vf->evq0_count - pos, in efx_siena_sriov_reset_vf()
972 copy_req[k].to_rid = vf->pci_rid; in efx_siena_sriov_reset_vf()
973 copy_req[k].to_addr = vf->evq0_addrs[pos + k]; in efx_siena_sriov_reset_vf()
981 ": %d\n", vf->pci_name, -rc); in efx_siena_sriov_reset_vf()
987 abs_evq = abs_index(vf, 0); in efx_siena_sriov_reset_vf()
988 buftbl = EFX_BUFTBL_EVQ_BASE(vf, 0); in efx_siena_sriov_reset_vf()
989 efx_siena_sriov_bufs(efx, buftbl, vf->evq0_addrs, vf->evq0_count); in efx_siena_sriov_reset_vf()
998 FRF_AZ_EVQ_SIZE, __ffs(vf->evq0_count), in efx_siena_sriov_reset_vf()
1004 mutex_unlock(&vf->status_lock); in efx_siena_sriov_reset_vf()
1009 struct efx_vf *vf = container_of(work, struct efx_vf, req); in efx_siena_sriov_reset_vf_work() local
1010 struct efx_nic *efx = vf->efx; in efx_siena_sriov_reset_vf_work()
1014 efx_siena_sriov_reset_vf(vf, &buf); in efx_siena_sriov_reset_vf_work()
1080 struct efx_vf *vf; in efx_siena_sriov_peer_work() local
1102 vf = efx->vf + pos; in efx_siena_sriov_peer_work()
1104 mutex_lock(&vf->status_lock); in efx_siena_sriov_peer_work()
1105 if (vf->rx_filtering && !is_zero_ether_addr(vf->addr.mac_addr)) { in efx_siena_sriov_peer_work()
1106 *peer++ = vf->addr; in efx_siena_sriov_peer_work()
1111 mutex_unlock(&vf->status_lock); in efx_siena_sriov_peer_work()
1158 vf = efx->vf + pos; in efx_siena_sriov_peer_work()
1160 mutex_lock(&vf->status_lock); in efx_siena_sriov_peer_work()
1161 if (vf->status_addr) in efx_siena_sriov_peer_work()
1162 __efx_siena_sriov_push_vf_status(vf); in efx_siena_sriov_peer_work()
1163 mutex_unlock(&vf->status_lock); in efx_siena_sriov_peer_work()
1193 struct efx_vf *vf; in efx_siena_sriov_vf_alloc() local
1195 efx->vf = kzalloc(sizeof(struct efx_vf) * efx->vf_count, GFP_KERNEL); in efx_siena_sriov_vf_alloc()
1196 if (!efx->vf) in efx_siena_sriov_vf_alloc()
1200 vf = efx->vf + index; in efx_siena_sriov_vf_alloc()
1202 vf->efx = efx; in efx_siena_sriov_vf_alloc()
1203 vf->index = index; in efx_siena_sriov_vf_alloc()
1204 vf->rx_filter_id = -1; in efx_siena_sriov_vf_alloc()
1205 vf->tx_filter_mode = VF_TX_FILTER_AUTO; in efx_siena_sriov_vf_alloc()
1206 vf->tx_filter_id = -1; in efx_siena_sriov_vf_alloc()
1207 INIT_WORK(&vf->req, efx_siena_sriov_vfdi); in efx_siena_sriov_vf_alloc()
1208 INIT_WORK(&vf->reset_work, efx_siena_sriov_reset_vf_work); in efx_siena_sriov_vf_alloc()
1209 init_waitqueue_head(&vf->flush_waitq); in efx_siena_sriov_vf_alloc()
1210 mutex_init(&vf->status_lock); in efx_siena_sriov_vf_alloc()
1211 mutex_init(&vf->txq_lock); in efx_siena_sriov_vf_alloc()
1219 struct efx_vf *vf; in efx_siena_sriov_vfs_fini() local
1223 vf = efx->vf + pos; in efx_siena_sriov_vfs_fini()
1225 efx_nic_free_buffer(efx, &vf->buf); in efx_siena_sriov_vfs_fini()
1226 kfree(vf->peer_page_addrs); in efx_siena_sriov_vfs_fini()
1227 vf->peer_page_addrs = NULL; in efx_siena_sriov_vfs_fini()
1228 vf->peer_page_count = 0; in efx_siena_sriov_vfs_fini()
1230 vf->evq0_count = 0; in efx_siena_sriov_vfs_fini()
1240 struct efx_vf *vf; in efx_siena_sriov_vfs_init() local
1253 vf = efx->vf + index; in efx_siena_sriov_vfs_init()
1256 vf->buftbl_base = buftbl_base; in efx_siena_sriov_vfs_init()
1259 vf->pci_rid = devfn; in efx_siena_sriov_vfs_init()
1260 snprintf(vf->pci_name, sizeof(vf->pci_name), in efx_siena_sriov_vfs_init()
1265 rc = efx_nic_alloc_buffer(efx, &vf->buf, EFX_PAGE_SIZE, in efx_siena_sriov_vfs_init()
1353 kfree(efx->vf); in efx_siena_sriov_init()
1364 struct efx_vf *vf; in efx_siena_sriov_fini() local
1380 vf = efx->vf + pos; in efx_siena_sriov_fini()
1381 cancel_work_sync(&vf->req); in efx_siena_sriov_fini()
1382 cancel_work_sync(&vf->reset_work); in efx_siena_sriov_fini()
1391 kfree(efx->vf); in efx_siena_sriov_fini()
1399 struct efx_vf *vf; in efx_siena_sriov_event() local
1414 if (map_vi_index(efx, qid, &vf, NULL)) in efx_siena_sriov_event()
1416 if (vf->busy) in efx_siena_sriov_event()
1421 vf->req_type = VFDI_EV_TYPE_REQ_WORD0; in efx_siena_sriov_event()
1422 vf->req_seqno = seq + 1; in efx_siena_sriov_event()
1423 vf->req_addr = 0; in efx_siena_sriov_event()
1424 } else if (seq != (vf->req_seqno++ & 0xff) || type != vf->req_type) in efx_siena_sriov_event()
1427 switch (vf->req_type) { in efx_siena_sriov_event()
1431 vf->req_addr |= (u64)data << (vf->req_type << 4); in efx_siena_sriov_event()
1432 ++vf->req_type; in efx_siena_sriov_event()
1436 vf->req_addr |= (u64)data << 48; in efx_siena_sriov_event()
1437 vf->req_type = VFDI_EV_TYPE_REQ_WORD0; in efx_siena_sriov_event()
1438 vf->busy = true; in efx_siena_sriov_event()
1439 queue_work(vfdi_workqueue, &vf->req); in efx_siena_sriov_event()
1447 vf->pci_name); in efx_siena_sriov_event()
1449 vf->req_type = VFDI_EV_TYPE_REQ_WORD0; in efx_siena_sriov_event()
1450 vf->req_seqno = seq + 1; in efx_siena_sriov_event()
1455 struct efx_vf *vf; in efx_siena_sriov_flr() local
1459 vf = efx->vf + vf_i; in efx_siena_sriov_flr()
1461 "FLR on VF %s\n", vf->pci_name); in efx_siena_sriov_flr()
1463 vf->status_addr = 0; in efx_siena_sriov_flr()
1464 efx_vfdi_remove_all_filters(vf); in efx_siena_sriov_flr()
1465 efx_vfdi_flush_clear(vf); in efx_siena_sriov_flr()
1467 vf->evq0_count = 0; in efx_siena_sriov_flr()
1484 struct efx_vf *vf; in efx_siena_sriov_tx_flush_done() local
1488 if (map_vi_index(efx, queue, &vf, &qid)) in efx_siena_sriov_tx_flush_done()
1491 if (!test_bit(qid, vf->txq_mask)) in efx_siena_sriov_tx_flush_done()
1494 __clear_bit(qid, vf->txq_mask); in efx_siena_sriov_tx_flush_done()
1495 --vf->txq_count; in efx_siena_sriov_tx_flush_done()
1497 if (efx_vfdi_flush_wake(vf)) in efx_siena_sriov_tx_flush_done()
1498 wake_up(&vf->flush_waitq); in efx_siena_sriov_tx_flush_done()
1503 struct efx_vf *vf; in efx_siena_sriov_rx_flush_done() local
1509 if (map_vi_index(efx, queue, &vf, &qid)) in efx_siena_sriov_rx_flush_done()
1511 if (!test_bit(qid, vf->rxq_mask)) in efx_siena_sriov_rx_flush_done()
1515 set_bit(qid, vf->rxq_retry_mask); in efx_siena_sriov_rx_flush_done()
1516 atomic_inc(&vf->rxq_retry_count); in efx_siena_sriov_rx_flush_done()
1518 __clear_bit(qid, vf->rxq_mask); in efx_siena_sriov_rx_flush_done()
1519 --vf->rxq_count; in efx_siena_sriov_rx_flush_done()
1521 if (efx_vfdi_flush_wake(vf)) in efx_siena_sriov_rx_flush_done()
1522 wake_up(&vf->flush_waitq); in efx_siena_sriov_rx_flush_done()
1528 struct efx_vf *vf; in efx_siena_sriov_desc_fetch_err() local
1531 if (map_vi_index(efx, dmaq, &vf, &rel)) in efx_siena_sriov_desc_fetch_err()
1537 vf->index, rel); in efx_siena_sriov_desc_fetch_err()
1538 queue_work(vfdi_workqueue, &vf->reset_work); in efx_siena_sriov_desc_fetch_err()
1546 struct efx_vf *vf; in efx_siena_sriov_reset() local
1560 vf = efx->vf + vf_i; in efx_siena_sriov_reset()
1561 efx_siena_sriov_reset_vf(vf, &buf); in efx_siena_sriov_reset()
1588 struct efx_vf *vf; in efx_siena_sriov_set_vf_mac() local
1592 vf = efx->vf + vf_i; in efx_siena_sriov_set_vf_mac()
1594 mutex_lock(&vf->status_lock); in efx_siena_sriov_set_vf_mac()
1595 ether_addr_copy(vf->addr.mac_addr, mac); in efx_siena_sriov_set_vf_mac()
1596 __efx_siena_sriov_update_vf_addr(vf); in efx_siena_sriov_set_vf_mac()
1597 mutex_unlock(&vf->status_lock); in efx_siena_sriov_set_vf_mac()
1606 struct efx_vf *vf; in efx_siena_sriov_set_vf_vlan() local
1611 vf = efx->vf + vf_i; in efx_siena_sriov_set_vf_vlan()
1613 mutex_lock(&vf->status_lock); in efx_siena_sriov_set_vf_vlan()
1615 vf->addr.tci = htons(tci); in efx_siena_sriov_set_vf_vlan()
1616 __efx_siena_sriov_update_vf_addr(vf); in efx_siena_sriov_set_vf_vlan()
1617 mutex_unlock(&vf->status_lock); in efx_siena_sriov_set_vf_vlan()
1626 struct efx_vf *vf; in efx_siena_sriov_set_vf_spoofchk() local
1631 vf = efx->vf + vf_i; in efx_siena_sriov_set_vf_spoofchk()
1633 mutex_lock(&vf->txq_lock); in efx_siena_sriov_set_vf_spoofchk()
1634 if (vf->txq_count == 0) { in efx_siena_sriov_set_vf_spoofchk()
1635 vf->tx_filter_mode = in efx_siena_sriov_set_vf_spoofchk()
1642 mutex_unlock(&vf->txq_lock); in efx_siena_sriov_set_vf_spoofchk()
1650 struct efx_vf *vf; in efx_siena_sriov_get_vf_config() local
1655 vf = efx->vf + vf_i; in efx_siena_sriov_get_vf_config()
1657 ivi->vf = vf_i; in efx_siena_sriov_get_vf_config()
1658 ether_addr_copy(ivi->mac, vf->addr.mac_addr); in efx_siena_sriov_get_vf_config()
1661 tci = ntohs(vf->addr.tci); in efx_siena_sriov_get_vf_config()
1664 ivi->spoofchk = vf->tx_filter_mode == VF_TX_FILTER_ON; in efx_siena_sriov_get_vf_config()