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()
309 static void efx_sriov_reset_tx_filter(struct efx_vf *vf) in efx_sriov_reset_tx_filter() argument
311 struct efx_nic *efx = vf->efx; in efx_sriov_reset_tx_filter()
316 if (vf->tx_filter_id != -1) { in efx_sriov_reset_tx_filter()
318 vf->tx_filter_id); in efx_sriov_reset_tx_filter()
320 vf->pci_name, vf->tx_filter_id); in efx_sriov_reset_tx_filter()
321 vf->tx_filter_id = -1; in efx_sriov_reset_tx_filter()
324 if (is_zero_ether_addr(vf->addr.mac_addr)) in efx_sriov_reset_tx_filter()
330 if (vf->tx_filter_mode == VF_TX_FILTER_AUTO && vf_max_tx_channels <= 2) in efx_sriov_reset_tx_filter()
331 vf->tx_filter_mode = VF_TX_FILTER_ON; in efx_sriov_reset_tx_filter()
333 vlan = ntohs(vf->addr.tci) & VLAN_VID_MASK; in efx_sriov_reset_tx_filter()
334 efx_filter_init_tx(&filter, abs_index(vf, 0)); in efx_sriov_reset_tx_filter()
337 vf->addr.mac_addr); in efx_sriov_reset_tx_filter()
344 vf->pci_name); in efx_sriov_reset_tx_filter()
347 vf->pci_name, rc); in efx_sriov_reset_tx_filter()
348 vf->tx_filter_id = rc; in efx_sriov_reset_tx_filter()
353 static void efx_sriov_reset_rx_filter(struct efx_vf *vf) in efx_sriov_reset_rx_filter() argument
355 struct efx_nic *efx = vf->efx; in efx_sriov_reset_rx_filter()
360 if (vf->rx_filter_id != -1) { in efx_sriov_reset_rx_filter()
362 vf->rx_filter_id); in efx_sriov_reset_rx_filter()
364 vf->pci_name, vf->rx_filter_id); in efx_sriov_reset_rx_filter()
365 vf->rx_filter_id = -1; in efx_sriov_reset_rx_filter()
368 if (!vf->rx_filtering || is_zero_ether_addr(vf->addr.mac_addr)) in efx_sriov_reset_rx_filter()
371 vlan = ntohs(vf->addr.tci) & VLAN_VID_MASK; in efx_sriov_reset_rx_filter()
373 vf->rx_filter_flags, in efx_sriov_reset_rx_filter()
374 abs_index(vf, vf->rx_filter_qid)); in efx_sriov_reset_rx_filter()
377 vf->addr.mac_addr); in efx_sriov_reset_rx_filter()
384 vf->pci_name); in efx_sriov_reset_rx_filter()
387 vf->pci_name, rc); in efx_sriov_reset_rx_filter()
388 vf->rx_filter_id = rc; in efx_sriov_reset_rx_filter()
392 static void __efx_sriov_update_vf_addr(struct efx_vf *vf) in __efx_sriov_update_vf_addr() argument
394 efx_sriov_reset_tx_filter(vf); in __efx_sriov_update_vf_addr()
395 efx_sriov_reset_rx_filter(vf); in __efx_sriov_update_vf_addr()
396 queue_work(vfdi_workqueue, &vf->efx->peer_work); in __efx_sriov_update_vf_addr()
404 static void __efx_sriov_push_vf_status(struct efx_vf *vf) in __efx_sriov_push_vf_status() argument
406 struct efx_nic *efx = vf->efx; in __efx_sriov_push_vf_status()
414 WARN_ON(!mutex_is_locked(&vf->status_lock)); in __efx_sriov_push_vf_status()
415 WARN_ON(!vf->status_addr); in __efx_sriov_push_vf_status()
417 status->local = vf->addr; in __efx_sriov_push_vf_status()
423 copy[0].to_rid = vf->pci_rid; in __efx_sriov_push_vf_status()
424 copy[0].to_addr = vf->status_addr + offsetof(struct vfdi_status, in __efx_sriov_push_vf_status()
434 copy[1].to_rid = vf->pci_rid; in __efx_sriov_push_vf_status()
435 copy[1].to_addr = vf->status_addr + data_offset; in __efx_sriov_push_vf_status()
442 if (count == vf->peer_page_count) { in __efx_sriov_push_vf_status()
451 copy[pos].to_rid = vf->pci_rid; in __efx_sriov_push_vf_status()
452 copy[pos].to_addr = vf->peer_page_addrs[count]; in __efx_sriov_push_vf_status()
464 copy[pos].to_rid = vf->pci_rid; in __efx_sriov_push_vf_status()
465 copy[pos].to_addr = vf->status_addr + offsetof(struct vfdi_status, in __efx_sriov_push_vf_status()
473 VFDI_EV_SEQ, (vf->msg_seqno & 0xff), in __efx_sriov_push_vf_status()
475 ++vf->msg_seqno; in __efx_sriov_push_vf_status()
476 efx_generate_event(efx, EFX_VI_BASE + vf->index * efx_vf_size(efx), in __efx_sriov_push_vf_status()
525 *vf_out = efx->vf + vf_i; in map_vi_index()
531 static int efx_vfdi_init_evq(struct efx_vf *vf) in efx_vfdi_init_evq() argument
533 struct efx_nic *efx = vf->efx; in efx_vfdi_init_evq()
534 struct vfdi_req *req = vf->buf.addr; in efx_vfdi_init_evq()
537 unsigned abs_evq = abs_index(vf, vf_evq); in efx_vfdi_init_evq()
538 unsigned buftbl = EFX_BUFTBL_EVQ_BASE(vf, vf_evq); in efx_vfdi_init_evq()
546 vf->pci_name, vf_evq, buf_count); in efx_vfdi_init_evq()
564 memcpy(vf->evq0_addrs, req->u.init_evq.addr, in efx_vfdi_init_evq()
566 vf->evq0_count = buf_count; in efx_vfdi_init_evq()
572 static int efx_vfdi_init_rxq(struct efx_vf *vf) in efx_vfdi_init_rxq() argument
574 struct efx_nic *efx = vf->efx; in efx_vfdi_init_rxq()
575 struct vfdi_req *req = vf->buf.addr; in efx_vfdi_init_rxq()
579 unsigned buftbl = EFX_BUFTBL_RXQ_BASE(vf, vf_rxq); in efx_vfdi_init_rxq()
589 "buf_count %d\n", vf->pci_name, vf_rxq, in efx_vfdi_init_rxq()
593 if (__test_and_set_bit(req->u.init_rxq.index, vf->rxq_mask)) in efx_vfdi_init_rxq()
594 ++vf->rxq_count; in efx_vfdi_init_rxq()
600 FRF_AZ_RX_DESCQ_EVQ_ID, abs_index(vf, vf_evq), in efx_vfdi_init_rxq()
608 abs_index(vf, vf_rxq)); in efx_vfdi_init_rxq()
613 static int efx_vfdi_init_txq(struct efx_vf *vf) in efx_vfdi_init_txq() argument
615 struct efx_nic *efx = vf->efx; in efx_vfdi_init_txq()
616 struct vfdi_req *req = vf->buf.addr; in efx_vfdi_init_txq()
620 unsigned buftbl = EFX_BUFTBL_TXQ_BASE(vf, vf_txq); in efx_vfdi_init_txq()
630 "buf_count %d\n", vf->pci_name, vf_txq, in efx_vfdi_init_txq()
635 mutex_lock(&vf->txq_lock); in efx_vfdi_init_txq()
636 if (__test_and_set_bit(req->u.init_txq.index, vf->txq_mask)) in efx_vfdi_init_txq()
637 ++vf->txq_count; in efx_vfdi_init_txq()
638 mutex_unlock(&vf->txq_lock); in efx_vfdi_init_txq()
641 eth_filt_en = vf->tx_filter_mode == VF_TX_FILTER_ON; in efx_vfdi_init_txq()
649 FRF_AZ_TX_DESCQ_EVQ_ID, abs_index(vf, vf_evq), in efx_vfdi_init_txq()
654 abs_index(vf, vf_txq)); in efx_vfdi_init_txq()
660 static bool efx_vfdi_flush_wake(struct efx_vf *vf) in efx_vfdi_flush_wake() argument
665 return (!vf->txq_count && !vf->rxq_count) || in efx_vfdi_flush_wake()
666 atomic_read(&vf->rxq_retry_count); in efx_vfdi_flush_wake()
669 static void efx_vfdi_flush_clear(struct efx_vf *vf) in efx_vfdi_flush_clear() argument
671 memset(vf->txq_mask, 0, sizeof(vf->txq_mask)); in efx_vfdi_flush_clear()
672 vf->txq_count = 0; in efx_vfdi_flush_clear()
673 memset(vf->rxq_mask, 0, sizeof(vf->rxq_mask)); in efx_vfdi_flush_clear()
674 vf->rxq_count = 0; in efx_vfdi_flush_clear()
675 memset(vf->rxq_retry_mask, 0, sizeof(vf->rxq_retry_mask)); in efx_vfdi_flush_clear()
676 atomic_set(&vf->rxq_retry_count, 0); in efx_vfdi_flush_clear()
679 static int efx_vfdi_fini_all_queues(struct efx_vf *vf) in efx_vfdi_fini_all_queues() argument
681 struct efx_nic *efx = vf->efx; in efx_vfdi_fini_all_queues()
684 unsigned vf_offset = EFX_VI_BASE + vf->index * efx_vf_size(efx); in efx_vfdi_fini_all_queues()
704 if (test_bit(index, vf->txq_mask)) { in efx_vfdi_fini_all_queues()
711 if (test_bit(index, vf->rxq_mask)) in efx_vfdi_fini_all_queues()
715 atomic_set(&vf->rxq_retry_count, 0); in efx_vfdi_fini_all_queues()
716 while (timeout && (vf->rxq_count || vf->txq_count)) { in efx_vfdi_fini_all_queues()
721 timeout = wait_event_timeout(vf->flush_waitq, in efx_vfdi_fini_all_queues()
722 efx_vfdi_flush_wake(vf), in efx_vfdi_fini_all_queues()
726 if (test_and_clear_bit(index, vf->rxq_retry_mask)) { in efx_vfdi_fini_all_queues()
727 atomic_dec(&vf->rxq_retry_count); in efx_vfdi_fini_all_queues()
750 efx_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()
763 struct vfdi_req *req = vf->buf.addr; in efx_vfdi_insert_filter()
767 if (bad_vf_index(efx, vf_rxq) || vf->rx_filtering) { in efx_vfdi_insert_filter()
771 "flags 0x%x\n", vf->pci_name, vf_rxq, in efx_vfdi_insert_filter()
781 vf->rx_filter_flags = flags; in efx_vfdi_insert_filter()
782 vf->rx_filter_qid = vf_rxq; in efx_vfdi_insert_filter()
783 vf->rx_filtering = true; in efx_vfdi_insert_filter()
785 efx_sriov_reset_rx_filter(vf); in efx_vfdi_insert_filter()
791 static int efx_vfdi_remove_all_filters(struct efx_vf *vf) in efx_vfdi_remove_all_filters() argument
793 vf->rx_filtering = false; in efx_vfdi_remove_all_filters()
794 efx_sriov_reset_rx_filter(vf); in efx_vfdi_remove_all_filters()
795 queue_work(vfdi_workqueue, &vf->efx->peer_work); in efx_vfdi_remove_all_filters()
800 static int efx_vfdi_set_status_page(struct efx_vf *vf) in efx_vfdi_set_status_page() argument
802 struct efx_nic *efx = vf->efx; in efx_vfdi_set_status_page()
803 struct vfdi_req *req = vf->buf.addr; in efx_vfdi_set_status_page()
814 vf->pci_name); in efx_vfdi_set_status_page()
819 mutex_lock(&vf->status_lock); in efx_vfdi_set_status_page()
820 vf->status_addr = req->u.set_status_page.dma_addr; in efx_vfdi_set_status_page()
822 kfree(vf->peer_page_addrs); in efx_vfdi_set_status_page()
823 vf->peer_page_addrs = NULL; in efx_vfdi_set_status_page()
824 vf->peer_page_count = 0; in efx_vfdi_set_status_page()
827 vf->peer_page_addrs = kcalloc(page_count, sizeof(u64), in efx_vfdi_set_status_page()
829 if (vf->peer_page_addrs) { in efx_vfdi_set_status_page()
830 memcpy(vf->peer_page_addrs, in efx_vfdi_set_status_page()
833 vf->peer_page_count = page_count; in efx_vfdi_set_status_page()
837 __efx_sriov_push_vf_status(vf); in efx_vfdi_set_status_page()
838 mutex_unlock(&vf->status_lock); in efx_vfdi_set_status_page()
844 static int efx_vfdi_clear_status_page(struct efx_vf *vf) in efx_vfdi_clear_status_page() argument
846 mutex_lock(&vf->status_lock); in efx_vfdi_clear_status_page()
847 vf->status_addr = 0; in efx_vfdi_clear_status_page()
848 mutex_unlock(&vf->status_lock); in efx_vfdi_clear_status_page()
853 typedef int (*efx_vfdi_op_t)(struct efx_vf *vf);
868 struct efx_vf *vf = container_of(work, struct efx_vf, req); in efx_sriov_vfdi() local
869 struct efx_nic *efx = vf->efx; in efx_sriov_vfdi()
870 struct vfdi_req *req = vf->buf.addr; in efx_sriov_vfdi()
876 copy[0].from_rid = vf->pci_rid; in efx_sriov_vfdi()
877 copy[0].from_addr = vf->req_addr; in efx_sriov_vfdi()
879 copy[0].to_addr = vf->buf.dma_addr; in efx_sriov_vfdi()
887 vf->pci_name, -rc); in efx_sriov_vfdi()
888 vf->busy = false; in efx_sriov_vfdi()
893 rc = vfdi_ops[req->op](vf); in efx_sriov_vfdi()
897 req->op, vf->pci_name); in efx_sriov_vfdi()
902 "%llx\n", req->op, vf->pci_name, in efx_sriov_vfdi()
903 (unsigned long long)vf->req_addr); in efx_sriov_vfdi()
908 vf->busy = false; in efx_sriov_vfdi()
917 copy[0].to_rid = vf->pci_rid; in efx_sriov_vfdi()
918 copy[0].to_addr = vf->req_addr + offsetof(struct vfdi_req, rc); in efx_sriov_vfdi()
921 copy[1].to_rid = vf->pci_rid; in efx_sriov_vfdi()
922 copy[1].to_addr = vf->req_addr + offsetof(struct vfdi_req, op); in efx_sriov_vfdi()
934 static void efx_sriov_reset_vf(struct efx_vf *vf, struct efx_buffer *buffer) in efx_sriov_reset_vf() argument
936 struct efx_nic *efx = vf->efx; in efx_sriov_reset_vf()
946 if (!vf->evq0_count) in efx_sriov_reset_vf()
948 BUG_ON(vf->evq0_count & (vf->evq0_count - 1)); in efx_sriov_reset_vf()
950 mutex_lock(&vf->status_lock); in efx_sriov_reset_vf()
953 VFDI_EV_SEQ, vf->msg_seqno, in efx_sriov_reset_vf()
955 vf->msg_seqno++; in efx_sriov_reset_vf()
959 for (pos = 0; pos < vf->evq0_count; pos += count) { in efx_sriov_reset_vf()
960 count = min_t(unsigned, vf->evq0_count - pos, in efx_sriov_reset_vf()
966 copy_req[k].to_rid = vf->pci_rid; in efx_sriov_reset_vf()
967 copy_req[k].to_addr = vf->evq0_addrs[pos + k]; in efx_sriov_reset_vf()
975 ": %d\n", vf->pci_name, -rc); in efx_sriov_reset_vf()
981 abs_evq = abs_index(vf, 0); in efx_sriov_reset_vf()
982 buftbl = EFX_BUFTBL_EVQ_BASE(vf, 0); in efx_sriov_reset_vf()
983 efx_sriov_bufs(efx, buftbl, vf->evq0_addrs, vf->evq0_count); in efx_sriov_reset_vf()
992 FRF_AZ_EVQ_SIZE, __ffs(vf->evq0_count), in efx_sriov_reset_vf()
998 mutex_unlock(&vf->status_lock); in efx_sriov_reset_vf()
1003 struct efx_vf *vf = container_of(work, struct efx_vf, req); in efx_sriov_reset_vf_work() local
1004 struct efx_nic *efx = vf->efx; in efx_sriov_reset_vf_work()
1008 efx_sriov_reset_vf(vf, &buf); in efx_sriov_reset_vf_work()
1068 struct efx_vf *vf; in efx_sriov_peer_work() local
1090 vf = efx->vf + pos; in efx_sriov_peer_work()
1092 mutex_lock(&vf->status_lock); in efx_sriov_peer_work()
1093 if (vf->rx_filtering && !is_zero_ether_addr(vf->addr.mac_addr)) { in efx_sriov_peer_work()
1094 *peer++ = vf->addr; in efx_sriov_peer_work()
1099 mutex_unlock(&vf->status_lock); in efx_sriov_peer_work()
1146 vf = efx->vf + pos; in efx_sriov_peer_work()
1148 mutex_lock(&vf->status_lock); in efx_sriov_peer_work()
1149 if (vf->status_addr) in efx_sriov_peer_work()
1150 __efx_sriov_push_vf_status(vf); in efx_sriov_peer_work()
1151 mutex_unlock(&vf->status_lock); in efx_sriov_peer_work()
1180 struct efx_vf *vf; in efx_sriov_vf_alloc() local
1182 efx->vf = kzalloc(sizeof(struct efx_vf) * efx->vf_count, GFP_KERNEL); in efx_sriov_vf_alloc()
1183 if (!efx->vf) in efx_sriov_vf_alloc()
1187 vf = efx->vf + index; in efx_sriov_vf_alloc()
1189 vf->efx = efx; in efx_sriov_vf_alloc()
1190 vf->index = index; in efx_sriov_vf_alloc()
1191 vf->rx_filter_id = -1; in efx_sriov_vf_alloc()
1192 vf->tx_filter_mode = VF_TX_FILTER_AUTO; in efx_sriov_vf_alloc()
1193 vf->tx_filter_id = -1; in efx_sriov_vf_alloc()
1194 INIT_WORK(&vf->req, efx_sriov_vfdi); in efx_sriov_vf_alloc()
1195 INIT_WORK(&vf->reset_work, efx_sriov_reset_vf_work); in efx_sriov_vf_alloc()
1196 init_waitqueue_head(&vf->flush_waitq); in efx_sriov_vf_alloc()
1197 mutex_init(&vf->status_lock); in efx_sriov_vf_alloc()
1198 mutex_init(&vf->txq_lock); in efx_sriov_vf_alloc()
1206 struct efx_vf *vf; in efx_sriov_vfs_fini() local
1210 vf = efx->vf + pos; in efx_sriov_vfs_fini()
1212 efx_nic_free_buffer(efx, &vf->buf); in efx_sriov_vfs_fini()
1213 kfree(vf->peer_page_addrs); in efx_sriov_vfs_fini()
1214 vf->peer_page_addrs = NULL; in efx_sriov_vfs_fini()
1215 vf->peer_page_count = 0; in efx_sriov_vfs_fini()
1217 vf->evq0_count = 0; in efx_sriov_vfs_fini()
1226 struct efx_vf *vf; in efx_sriov_vfs_init() local
1239 vf = efx->vf + index; in efx_sriov_vfs_init()
1242 vf->buftbl_base = buftbl_base; in efx_sriov_vfs_init()
1245 vf->pci_rid = devfn; in efx_sriov_vfs_init()
1246 snprintf(vf->pci_name, sizeof(vf->pci_name), in efx_sriov_vfs_init()
1251 rc = efx_nic_alloc_buffer(efx, &vf->buf, EFX_PAGE_SIZE); in efx_sriov_vfs_init()
1337 kfree(efx->vf); in efx_sriov_init()
1348 struct efx_vf *vf; in efx_sriov_fini() local
1363 vf = efx->vf + pos; in efx_sriov_fini()
1364 cancel_work_sync(&vf->req); in efx_sriov_fini()
1365 cancel_work_sync(&vf->reset_work); in efx_sriov_fini()
1374 kfree(efx->vf); in efx_sriov_fini()
1382 struct efx_vf *vf; in efx_sriov_event() local
1397 if (map_vi_index(efx, qid, &vf, NULL)) in efx_sriov_event()
1399 if (vf->busy) in efx_sriov_event()
1404 vf->req_type = VFDI_EV_TYPE_REQ_WORD0; in efx_sriov_event()
1405 vf->req_seqno = seq + 1; in efx_sriov_event()
1406 vf->req_addr = 0; in efx_sriov_event()
1407 } else if (seq != (vf->req_seqno++ & 0xff) || type != vf->req_type) in efx_sriov_event()
1410 switch (vf->req_type) { in efx_sriov_event()
1414 vf->req_addr |= (u64)data << (vf->req_type << 4); in efx_sriov_event()
1415 ++vf->req_type; in efx_sriov_event()
1419 vf->req_addr |= (u64)data << 48; in efx_sriov_event()
1420 vf->req_type = VFDI_EV_TYPE_REQ_WORD0; in efx_sriov_event()
1421 vf->busy = true; in efx_sriov_event()
1422 queue_work(vfdi_workqueue, &vf->req); in efx_sriov_event()
1430 vf->pci_name); in efx_sriov_event()
1432 vf->req_type = VFDI_EV_TYPE_REQ_WORD0; in efx_sriov_event()
1433 vf->req_seqno = seq + 1; in efx_sriov_event()
1438 struct efx_vf *vf; in efx_sriov_flr() local
1442 vf = efx->vf + vf_i; in efx_sriov_flr()
1444 "FLR on VF %s\n", vf->pci_name); in efx_sriov_flr()
1446 vf->status_addr = 0; in efx_sriov_flr()
1447 efx_vfdi_remove_all_filters(vf); in efx_sriov_flr()
1448 efx_vfdi_flush_clear(vf); in efx_sriov_flr()
1450 vf->evq0_count = 0; in efx_sriov_flr()
1466 struct efx_vf *vf; in efx_sriov_tx_flush_done() local
1470 if (map_vi_index(efx, queue, &vf, &qid)) in efx_sriov_tx_flush_done()
1473 if (!test_bit(qid, vf->txq_mask)) in efx_sriov_tx_flush_done()
1476 __clear_bit(qid, vf->txq_mask); in efx_sriov_tx_flush_done()
1477 --vf->txq_count; in efx_sriov_tx_flush_done()
1479 if (efx_vfdi_flush_wake(vf)) in efx_sriov_tx_flush_done()
1480 wake_up(&vf->flush_waitq); in efx_sriov_tx_flush_done()
1485 struct efx_vf *vf; in efx_sriov_rx_flush_done() local
1491 if (map_vi_index(efx, queue, &vf, &qid)) in efx_sriov_rx_flush_done()
1493 if (!test_bit(qid, vf->rxq_mask)) in efx_sriov_rx_flush_done()
1497 set_bit(qid, vf->rxq_retry_mask); in efx_sriov_rx_flush_done()
1498 atomic_inc(&vf->rxq_retry_count); in efx_sriov_rx_flush_done()
1500 __clear_bit(qid, vf->rxq_mask); in efx_sriov_rx_flush_done()
1501 --vf->rxq_count; in efx_sriov_rx_flush_done()
1503 if (efx_vfdi_flush_wake(vf)) in efx_sriov_rx_flush_done()
1504 wake_up(&vf->flush_waitq); in efx_sriov_rx_flush_done()
1510 struct efx_vf *vf; in efx_sriov_desc_fetch_err() local
1513 if (map_vi_index(efx, dmaq, &vf, &rel)) in efx_sriov_desc_fetch_err()
1519 vf->index, rel); in efx_sriov_desc_fetch_err()
1520 queue_work(vfdi_workqueue, &vf->reset_work); in efx_sriov_desc_fetch_err()
1528 struct efx_vf *vf; in efx_sriov_reset() local
1542 vf = efx->vf + vf_i; in efx_sriov_reset()
1543 efx_sriov_reset_vf(vf, &buf); in efx_sriov_reset()
1570 struct efx_vf *vf; in efx_sriov_set_vf_mac() local
1574 vf = efx->vf + vf_i; in efx_sriov_set_vf_mac()
1576 mutex_lock(&vf->status_lock); in efx_sriov_set_vf_mac()
1577 memcpy(vf->addr.mac_addr, mac, ETH_ALEN); in efx_sriov_set_vf_mac()
1578 __efx_sriov_update_vf_addr(vf); in efx_sriov_set_vf_mac()
1579 mutex_unlock(&vf->status_lock); in efx_sriov_set_vf_mac()
1588 struct efx_vf *vf; in efx_sriov_set_vf_vlan() local
1593 vf = efx->vf + vf_i; in efx_sriov_set_vf_vlan()
1595 mutex_lock(&vf->status_lock); in efx_sriov_set_vf_vlan()
1597 vf->addr.tci = htons(tci); in efx_sriov_set_vf_vlan()
1598 __efx_sriov_update_vf_addr(vf); in efx_sriov_set_vf_vlan()
1599 mutex_unlock(&vf->status_lock); in efx_sriov_set_vf_vlan()
1608 struct efx_vf *vf; in efx_sriov_set_vf_spoofchk() local
1613 vf = efx->vf + vf_i; in efx_sriov_set_vf_spoofchk()
1615 mutex_lock(&vf->txq_lock); in efx_sriov_set_vf_spoofchk()
1616 if (vf->txq_count == 0) { in efx_sriov_set_vf_spoofchk()
1617 vf->tx_filter_mode = in efx_sriov_set_vf_spoofchk()
1624 mutex_unlock(&vf->txq_lock); in efx_sriov_set_vf_spoofchk()
1632 struct efx_vf *vf; in efx_sriov_get_vf_config() local
1637 vf = efx->vf + vf_i; in efx_sriov_get_vf_config()
1639 ivi->vf = vf_i; in efx_sriov_get_vf_config()
1640 memcpy(ivi->mac, vf->addr.mac_addr, ETH_ALEN); in efx_sriov_get_vf_config()
1642 tci = ntohs(vf->addr.tci); in efx_sriov_get_vf_config()
1645 ivi->spoofchk = vf->tx_filter_mode == VF_TX_FILTER_ON; in efx_sriov_get_vf_config()