• Home
  • Raw
  • Download

Lines Matching refs:vf

191 static unsigned abs_index(struct siena_vf *vf, unsigned index)  in abs_index()  argument
193 return EFX_VI_BASE + vf->index * efx_vf_size(vf->efx) + index; in abs_index()
301 static void efx_siena_sriov_reset_tx_filter(struct siena_vf *vf) in efx_siena_sriov_reset_tx_filter() argument
303 struct efx_nic *efx = vf->efx; in efx_siena_sriov_reset_tx_filter()
308 if (vf->tx_filter_id != -1) { in efx_siena_sriov_reset_tx_filter()
310 vf->tx_filter_id); in efx_siena_sriov_reset_tx_filter()
312 vf->pci_name, vf->tx_filter_id); in efx_siena_sriov_reset_tx_filter()
313 vf->tx_filter_id = -1; in efx_siena_sriov_reset_tx_filter()
316 if (is_zero_ether_addr(vf->addr.mac_addr)) in efx_siena_sriov_reset_tx_filter()
322 if (vf->tx_filter_mode == VF_TX_FILTER_AUTO && vf_max_tx_channels <= 2) in efx_siena_sriov_reset_tx_filter()
323 vf->tx_filter_mode = VF_TX_FILTER_ON; in efx_siena_sriov_reset_tx_filter()
325 vlan = ntohs(vf->addr.tci) & VLAN_VID_MASK; in efx_siena_sriov_reset_tx_filter()
326 efx_filter_init_tx(&filter, abs_index(vf, 0)); in efx_siena_sriov_reset_tx_filter()
329 vf->addr.mac_addr); in efx_siena_sriov_reset_tx_filter()
336 vf->pci_name); in efx_siena_sriov_reset_tx_filter()
339 vf->pci_name, rc); in efx_siena_sriov_reset_tx_filter()
340 vf->tx_filter_id = rc; in efx_siena_sriov_reset_tx_filter()
345 static void efx_siena_sriov_reset_rx_filter(struct siena_vf *vf) in efx_siena_sriov_reset_rx_filter() argument
347 struct efx_nic *efx = vf->efx; in efx_siena_sriov_reset_rx_filter()
352 if (vf->rx_filter_id != -1) { in efx_siena_sriov_reset_rx_filter()
354 vf->rx_filter_id); in efx_siena_sriov_reset_rx_filter()
356 vf->pci_name, vf->rx_filter_id); in efx_siena_sriov_reset_rx_filter()
357 vf->rx_filter_id = -1; in efx_siena_sriov_reset_rx_filter()
360 if (!vf->rx_filtering || is_zero_ether_addr(vf->addr.mac_addr)) in efx_siena_sriov_reset_rx_filter()
363 vlan = ntohs(vf->addr.tci) & VLAN_VID_MASK; in efx_siena_sriov_reset_rx_filter()
365 vf->rx_filter_flags, in efx_siena_sriov_reset_rx_filter()
366 abs_index(vf, vf->rx_filter_qid)); in efx_siena_sriov_reset_rx_filter()
369 vf->addr.mac_addr); in efx_siena_sriov_reset_rx_filter()
376 vf->pci_name); in efx_siena_sriov_reset_rx_filter()
379 vf->pci_name, rc); in efx_siena_sriov_reset_rx_filter()
380 vf->rx_filter_id = rc; in efx_siena_sriov_reset_rx_filter()
384 static void __efx_siena_sriov_update_vf_addr(struct siena_vf *vf) in __efx_siena_sriov_update_vf_addr() argument
386 struct efx_nic *efx = vf->efx; in __efx_siena_sriov_update_vf_addr()
389 efx_siena_sriov_reset_tx_filter(vf); in __efx_siena_sriov_update_vf_addr()
390 efx_siena_sriov_reset_rx_filter(vf); in __efx_siena_sriov_update_vf_addr()
399 static void __efx_siena_sriov_push_vf_status(struct siena_vf *vf) in __efx_siena_sriov_push_vf_status() argument
401 struct efx_nic *efx = vf->efx; in __efx_siena_sriov_push_vf_status()
410 WARN_ON(!mutex_is_locked(&vf->status_lock)); in __efx_siena_sriov_push_vf_status()
411 WARN_ON(!vf->status_addr); in __efx_siena_sriov_push_vf_status()
413 status->local = vf->addr; in __efx_siena_sriov_push_vf_status()
419 copy[0].to_rid = vf->pci_rid; in __efx_siena_sriov_push_vf_status()
420 copy[0].to_addr = vf->status_addr + offsetof(struct vfdi_status, in __efx_siena_sriov_push_vf_status()
430 copy[1].to_rid = vf->pci_rid; in __efx_siena_sriov_push_vf_status()
431 copy[1].to_addr = vf->status_addr + data_offset; in __efx_siena_sriov_push_vf_status()
438 if (count == vf->peer_page_count) { in __efx_siena_sriov_push_vf_status()
447 copy[pos].to_rid = vf->pci_rid; in __efx_siena_sriov_push_vf_status()
448 copy[pos].to_addr = vf->peer_page_addrs[count]; in __efx_siena_sriov_push_vf_status()
460 copy[pos].to_rid = vf->pci_rid; in __efx_siena_sriov_push_vf_status()
461 copy[pos].to_addr = vf->status_addr + offsetof(struct vfdi_status, in __efx_siena_sriov_push_vf_status()
469 VFDI_EV_SEQ, (vf->msg_seqno & 0xff), in __efx_siena_sriov_push_vf_status()
471 ++vf->msg_seqno; in __efx_siena_sriov_push_vf_status()
473 EFX_VI_BASE + vf->index * efx_vf_size(efx), in __efx_siena_sriov_push_vf_status()
523 *vf_out = nic_data->vf + vf_i; in map_vi_index()
529 static int efx_vfdi_init_evq(struct siena_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 siena_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 siena_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 siena_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 siena_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 siena_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 siena_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 siena_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 siena_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 siena_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 siena_vf *vf);
873 struct siena_vf *vf = container_of(work, struct siena_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()
940 static void efx_siena_sriov_reset_vf(struct siena_vf *vf, in efx_siena_sriov_reset_vf() argument
943 struct efx_nic *efx = vf->efx; in efx_siena_sriov_reset_vf()
953 if (!vf->evq0_count) in efx_siena_sriov_reset_vf()
955 BUG_ON(vf->evq0_count & (vf->evq0_count - 1)); in efx_siena_sriov_reset_vf()
957 mutex_lock(&vf->status_lock); in efx_siena_sriov_reset_vf()
960 VFDI_EV_SEQ, vf->msg_seqno, in efx_siena_sriov_reset_vf()
962 vf->msg_seqno++; in efx_siena_sriov_reset_vf()
966 for (pos = 0; pos < vf->evq0_count; pos += count) { in efx_siena_sriov_reset_vf()
967 count = min_t(unsigned, vf->evq0_count - pos, in efx_siena_sriov_reset_vf()
973 copy_req[k].to_rid = vf->pci_rid; in efx_siena_sriov_reset_vf()
974 copy_req[k].to_addr = vf->evq0_addrs[pos + k]; in efx_siena_sriov_reset_vf()
982 ": %d\n", vf->pci_name, -rc); in efx_siena_sriov_reset_vf()
988 abs_evq = abs_index(vf, 0); in efx_siena_sriov_reset_vf()
989 buftbl = EFX_BUFTBL_EVQ_BASE(vf, 0); in efx_siena_sriov_reset_vf()
990 efx_siena_sriov_bufs(efx, buftbl, vf->evq0_addrs, vf->evq0_count); in efx_siena_sriov_reset_vf()
999 FRF_AZ_EVQ_SIZE, __ffs(vf->evq0_count), in efx_siena_sriov_reset_vf()
1005 mutex_unlock(&vf->status_lock); in efx_siena_sriov_reset_vf()
1010 struct siena_vf *vf = container_of(work, struct siena_vf, req); in efx_siena_sriov_reset_vf_work() local
1011 struct efx_nic *efx = vf->efx; in efx_siena_sriov_reset_vf_work()
1015 efx_siena_sriov_reset_vf(vf, &buf); in efx_siena_sriov_reset_vf_work()
1083 struct siena_vf *vf; in efx_siena_sriov_peer_work() local
1105 vf = nic_data->vf + pos; in efx_siena_sriov_peer_work()
1107 mutex_lock(&vf->status_lock); in efx_siena_sriov_peer_work()
1108 if (vf->rx_filtering && !is_zero_ether_addr(vf->addr.mac_addr)) { in efx_siena_sriov_peer_work()
1109 *peer++ = vf->addr; in efx_siena_sriov_peer_work()
1114 mutex_unlock(&vf->status_lock); in efx_siena_sriov_peer_work()
1161 vf = nic_data->vf + pos; in efx_siena_sriov_peer_work()
1163 mutex_lock(&vf->status_lock); in efx_siena_sriov_peer_work()
1164 if (vf->status_addr) in efx_siena_sriov_peer_work()
1165 __efx_siena_sriov_push_vf_status(vf); in efx_siena_sriov_peer_work()
1166 mutex_unlock(&vf->status_lock); in efx_siena_sriov_peer_work()
1196 struct siena_vf *vf; in efx_siena_sriov_vf_alloc() local
1199 nic_data->vf = kcalloc(efx->vf_count, sizeof(*nic_data->vf), in efx_siena_sriov_vf_alloc()
1201 if (!nic_data->vf) in efx_siena_sriov_vf_alloc()
1205 vf = nic_data->vf + index; in efx_siena_sriov_vf_alloc()
1207 vf->efx = efx; in efx_siena_sriov_vf_alloc()
1208 vf->index = index; in efx_siena_sriov_vf_alloc()
1209 vf->rx_filter_id = -1; in efx_siena_sriov_vf_alloc()
1210 vf->tx_filter_mode = VF_TX_FILTER_AUTO; in efx_siena_sriov_vf_alloc()
1211 vf->tx_filter_id = -1; in efx_siena_sriov_vf_alloc()
1212 INIT_WORK(&vf->req, efx_siena_sriov_vfdi); in efx_siena_sriov_vf_alloc()
1213 INIT_WORK(&vf->reset_work, efx_siena_sriov_reset_vf_work); in efx_siena_sriov_vf_alloc()
1214 init_waitqueue_head(&vf->flush_waitq); in efx_siena_sriov_vf_alloc()
1215 mutex_init(&vf->status_lock); in efx_siena_sriov_vf_alloc()
1216 mutex_init(&vf->txq_lock); in efx_siena_sriov_vf_alloc()
1225 struct siena_vf *vf; in efx_siena_sriov_vfs_fini() local
1229 vf = nic_data->vf + pos; in efx_siena_sriov_vfs_fini()
1231 efx_nic_free_buffer(efx, &vf->buf); in efx_siena_sriov_vfs_fini()
1232 kfree(vf->peer_page_addrs); in efx_siena_sriov_vfs_fini()
1233 vf->peer_page_addrs = NULL; in efx_siena_sriov_vfs_fini()
1234 vf->peer_page_count = 0; in efx_siena_sriov_vfs_fini()
1236 vf->evq0_count = 0; in efx_siena_sriov_vfs_fini()
1246 struct siena_vf *vf; in efx_siena_sriov_vfs_init() local
1259 vf = nic_data->vf + index; in efx_siena_sriov_vfs_init()
1262 vf->buftbl_base = buftbl_base; in efx_siena_sriov_vfs_init()
1265 vf->pci_rid = devfn; in efx_siena_sriov_vfs_init()
1266 snprintf(vf->pci_name, sizeof(vf->pci_name), in efx_siena_sriov_vfs_init()
1271 rc = efx_nic_alloc_buffer(efx, &vf->buf, EFX_PAGE_SIZE, in efx_siena_sriov_vfs_init()
1359 kfree(nic_data->vf); in efx_siena_sriov_init()
1370 struct siena_vf *vf; in efx_siena_sriov_fini() local
1386 vf = nic_data->vf + pos; in efx_siena_sriov_fini()
1387 cancel_work_sync(&vf->req); in efx_siena_sriov_fini()
1388 cancel_work_sync(&vf->reset_work); in efx_siena_sriov_fini()
1397 kfree(nic_data->vf); in efx_siena_sriov_fini()
1405 struct siena_vf *vf; in efx_siena_sriov_event() local
1420 if (map_vi_index(efx, qid, &vf, NULL)) in efx_siena_sriov_event()
1422 if (vf->busy) in efx_siena_sriov_event()
1427 vf->req_type = VFDI_EV_TYPE_REQ_WORD0; in efx_siena_sriov_event()
1428 vf->req_seqno = seq + 1; in efx_siena_sriov_event()
1429 vf->req_addr = 0; in efx_siena_sriov_event()
1430 } else if (seq != (vf->req_seqno++ & 0xff) || type != vf->req_type) in efx_siena_sriov_event()
1433 switch (vf->req_type) { in efx_siena_sriov_event()
1437 vf->req_addr |= (u64)data << (vf->req_type << 4); in efx_siena_sriov_event()
1438 ++vf->req_type; in efx_siena_sriov_event()
1442 vf->req_addr |= (u64)data << 48; in efx_siena_sriov_event()
1443 vf->req_type = VFDI_EV_TYPE_REQ_WORD0; in efx_siena_sriov_event()
1444 vf->busy = true; in efx_siena_sriov_event()
1445 queue_work(vfdi_workqueue, &vf->req); in efx_siena_sriov_event()
1453 vf->pci_name); in efx_siena_sriov_event()
1455 vf->req_type = VFDI_EV_TYPE_REQ_WORD0; in efx_siena_sriov_event()
1456 vf->req_seqno = seq + 1; in efx_siena_sriov_event()
1462 struct siena_vf *vf; in efx_siena_sriov_flr() local
1466 vf = nic_data->vf + vf_i; in efx_siena_sriov_flr()
1468 "FLR on VF %s\n", vf->pci_name); in efx_siena_sriov_flr()
1470 vf->status_addr = 0; in efx_siena_sriov_flr()
1471 efx_vfdi_remove_all_filters(vf); in efx_siena_sriov_flr()
1472 efx_vfdi_flush_clear(vf); in efx_siena_sriov_flr()
1474 vf->evq0_count = 0; in efx_siena_sriov_flr()
1493 struct siena_vf *vf; in efx_siena_sriov_tx_flush_done() local
1497 if (map_vi_index(efx, queue, &vf, &qid)) in efx_siena_sriov_tx_flush_done()
1500 if (!test_bit(qid, vf->txq_mask)) in efx_siena_sriov_tx_flush_done()
1503 __clear_bit(qid, vf->txq_mask); in efx_siena_sriov_tx_flush_done()
1504 --vf->txq_count; in efx_siena_sriov_tx_flush_done()
1506 if (efx_vfdi_flush_wake(vf)) in efx_siena_sriov_tx_flush_done()
1507 wake_up(&vf->flush_waitq); in efx_siena_sriov_tx_flush_done()
1512 struct siena_vf *vf; in efx_siena_sriov_rx_flush_done() local
1518 if (map_vi_index(efx, queue, &vf, &qid)) in efx_siena_sriov_rx_flush_done()
1520 if (!test_bit(qid, vf->rxq_mask)) in efx_siena_sriov_rx_flush_done()
1524 set_bit(qid, vf->rxq_retry_mask); in efx_siena_sriov_rx_flush_done()
1525 atomic_inc(&vf->rxq_retry_count); in efx_siena_sriov_rx_flush_done()
1527 __clear_bit(qid, vf->rxq_mask); in efx_siena_sriov_rx_flush_done()
1528 --vf->rxq_count; in efx_siena_sriov_rx_flush_done()
1530 if (efx_vfdi_flush_wake(vf)) in efx_siena_sriov_rx_flush_done()
1531 wake_up(&vf->flush_waitq); in efx_siena_sriov_rx_flush_done()
1537 struct siena_vf *vf; in efx_siena_sriov_desc_fetch_err() local
1540 if (map_vi_index(efx, dmaq, &vf, &rel)) in efx_siena_sriov_desc_fetch_err()
1546 vf->index, rel); in efx_siena_sriov_desc_fetch_err()
1547 queue_work(vfdi_workqueue, &vf->reset_work); in efx_siena_sriov_desc_fetch_err()
1556 struct siena_vf *vf; in efx_siena_sriov_reset() local
1570 vf = nic_data->vf + vf_i; in efx_siena_sriov_reset()
1571 efx_siena_sriov_reset_vf(vf, &buf); in efx_siena_sriov_reset()
1597 struct siena_vf *vf; in efx_siena_sriov_set_vf_mac() local
1601 vf = nic_data->vf + vf_i; in efx_siena_sriov_set_vf_mac()
1603 mutex_lock(&vf->status_lock); in efx_siena_sriov_set_vf_mac()
1604 ether_addr_copy(vf->addr.mac_addr, mac); in efx_siena_sriov_set_vf_mac()
1605 __efx_siena_sriov_update_vf_addr(vf); in efx_siena_sriov_set_vf_mac()
1606 mutex_unlock(&vf->status_lock); in efx_siena_sriov_set_vf_mac()
1615 struct siena_vf *vf; in efx_siena_sriov_set_vf_vlan() local
1620 vf = nic_data->vf + vf_i; in efx_siena_sriov_set_vf_vlan()
1622 mutex_lock(&vf->status_lock); in efx_siena_sriov_set_vf_vlan()
1624 vf->addr.tci = htons(tci); in efx_siena_sriov_set_vf_vlan()
1625 __efx_siena_sriov_update_vf_addr(vf); in efx_siena_sriov_set_vf_vlan()
1626 mutex_unlock(&vf->status_lock); in efx_siena_sriov_set_vf_vlan()
1635 struct siena_vf *vf; in efx_siena_sriov_set_vf_spoofchk() local
1640 vf = nic_data->vf + vf_i; in efx_siena_sriov_set_vf_spoofchk()
1642 mutex_lock(&vf->txq_lock); in efx_siena_sriov_set_vf_spoofchk()
1643 if (vf->txq_count == 0) { in efx_siena_sriov_set_vf_spoofchk()
1644 vf->tx_filter_mode = in efx_siena_sriov_set_vf_spoofchk()
1651 mutex_unlock(&vf->txq_lock); in efx_siena_sriov_set_vf_spoofchk()
1659 struct siena_vf *vf; in efx_siena_sriov_get_vf_config() local
1664 vf = nic_data->vf + vf_i; in efx_siena_sriov_get_vf_config()
1666 ivi->vf = vf_i; in efx_siena_sriov_get_vf_config()
1667 ether_addr_copy(ivi->mac, vf->addr.mac_addr); in efx_siena_sriov_get_vf_config()
1670 tci = ntohs(vf->addr.tci); in efx_siena_sriov_get_vf_config()
1673 ivi->spoofchk = vf->tx_filter_mode == VF_TX_FILTER_ON; in efx_siena_sriov_get_vf_config()