• Home
  • Raw
  • Download

Lines Matching refs:vf

118 	if (!nic_data->vf)  in efx_ef10_sriov_free_vf_vports()
122 struct ef10_vf *vf = nic_data->vf + i; in efx_ef10_sriov_free_vf_vports() local
125 if (vf->pci_dev && pci_is_dev_assigned(vf->pci_dev)) in efx_ef10_sriov_free_vf_vports()
128 if (vf->vport_assigned) { in efx_ef10_sriov_free_vf_vports()
130 vf->vport_assigned = 0; in efx_ef10_sriov_free_vf_vports()
133 if (!is_zero_ether_addr(vf->mac)) { in efx_ef10_sriov_free_vf_vports()
134 efx_ef10_vport_del_mac(efx, vf->vport_id, vf->mac); in efx_ef10_sriov_free_vf_vports()
135 eth_zero_addr(vf->mac); in efx_ef10_sriov_free_vf_vports()
138 if (vf->vport_id) { in efx_ef10_sriov_free_vf_vports()
139 efx_ef10_vport_free(efx, vf->vport_id); in efx_ef10_sriov_free_vf_vports()
140 vf->vport_id = 0; in efx_ef10_sriov_free_vf_vports()
143 vf->efx = NULL; in efx_ef10_sriov_free_vf_vports()
152 kfree(nic_data->vf); in efx_ef10_sriov_free_vf_vswitching()
153 nic_data->vf = NULL; in efx_ef10_sriov_free_vf_vswitching()
160 struct ef10_vf *vf = nic_data->vf + vf_i; in efx_ef10_sriov_assign_vf_vport() local
163 if (WARN_ON_ONCE(!nic_data->vf)) in efx_ef10_sriov_assign_vf_vport()
168 vf->vlan, &vf->vport_id); in efx_ef10_sriov_assign_vf_vport()
172 rc = efx_ef10_vport_add_mac(efx, vf->vport_id, vf->mac); in efx_ef10_sriov_assign_vf_vport()
174 eth_zero_addr(vf->mac); in efx_ef10_sriov_assign_vf_vport()
178 rc = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i); in efx_ef10_sriov_assign_vf_vport()
182 vf->vport_assigned = 1; in efx_ef10_sriov_assign_vf_vport()
192 nic_data->vf = kcalloc(efx->vf_count, sizeof(struct ef10_vf), in efx_ef10_sriov_alloc_vf_vswitching()
194 if (!nic_data->vf) in efx_ef10_sriov_alloc_vf_vswitching()
198 eth_random_addr(nic_data->vf[i].mac); in efx_ef10_sriov_alloc_vf_vswitching()
199 nic_data->vf[i].efx = NULL; in efx_ef10_sriov_alloc_vf_vswitching()
200 nic_data->vf[i].vlan = EFX_EF10_NO_VLAN; in efx_ef10_sriov_alloc_vf_vswitching()
423 nic_data->vf[i].pci_dev = NULL; in efx_ef10_pci_sriov_disable()
452 if (!nic_data->vf) { in efx_ef10_sriov_fini()
490 struct ef10_vf *vf; in efx_ef10_sriov_set_vf_mac() local
493 if (!nic_data->vf) in efx_ef10_sriov_set_vf_mac()
498 vf = nic_data->vf + vf_i; in efx_ef10_sriov_set_vf_mac()
500 if (vf->efx) { in efx_ef10_sriov_set_vf_mac()
501 efx_device_detach_sync(vf->efx); in efx_ef10_sriov_set_vf_mac()
502 efx_net_stop(vf->efx->net_dev); in efx_ef10_sriov_set_vf_mac()
504 down_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_mac()
505 vf->efx->type->filter_table_remove(vf->efx); in efx_ef10_sriov_set_vf_mac()
507 rc = efx_ef10_vadaptor_free(vf->efx, EVB_PORT_ID_ASSIGNED); in efx_ef10_sriov_set_vf_mac()
509 up_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_mac()
518 if (!is_zero_ether_addr(vf->mac)) { in efx_ef10_sriov_set_vf_mac()
519 rc = efx_ef10_vport_del_vf_mac(efx, vf->vport_id, vf->mac); in efx_ef10_sriov_set_vf_mac()
525 rc = efx_ef10_vport_add_mac(efx, vf->vport_id, mac); in efx_ef10_sriov_set_vf_mac()
529 if (vf->efx) in efx_ef10_sriov_set_vf_mac()
530 eth_hw_addr_set(vf->efx->net_dev, mac); in efx_ef10_sriov_set_vf_mac()
533 ether_addr_copy(vf->mac, mac); in efx_ef10_sriov_set_vf_mac()
535 rc = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i); in efx_ef10_sriov_set_vf_mac()
539 if (vf->efx) { in efx_ef10_sriov_set_vf_mac()
541 rc = efx_ef10_vadaptor_alloc(vf->efx, EVB_PORT_ID_ASSIGNED); in efx_ef10_sriov_set_vf_mac()
543 up_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_mac()
546 vf->efx->type->filter_table_probe(vf->efx); in efx_ef10_sriov_set_vf_mac()
547 up_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_mac()
548 efx_net_open(vf->efx->net_dev); in efx_ef10_sriov_set_vf_mac()
549 efx_device_attach_if_not_resetting(vf->efx); in efx_ef10_sriov_set_vf_mac()
555 eth_zero_addr(vf->mac); in efx_ef10_sriov_set_vf_mac()
563 struct ef10_vf *vf; in efx_ef10_sriov_set_vf_vlan() local
572 vf = nic_data->vf + vf_i; in efx_ef10_sriov_set_vf_vlan()
575 if (new_vlan == vf->vlan) in efx_ef10_sriov_set_vf_vlan()
578 if (vf->efx) { in efx_ef10_sriov_set_vf_vlan()
579 efx_device_detach_sync(vf->efx); in efx_ef10_sriov_set_vf_vlan()
580 efx_net_stop(vf->efx->net_dev); in efx_ef10_sriov_set_vf_vlan()
582 mutex_lock(&vf->efx->mac_lock); in efx_ef10_sriov_set_vf_vlan()
583 down_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_vlan()
584 vf->efx->type->filter_table_remove(vf->efx); in efx_ef10_sriov_set_vf_vlan()
586 rc = efx_ef10_vadaptor_free(vf->efx, EVB_PORT_ID_ASSIGNED); in efx_ef10_sriov_set_vf_vlan()
591 if (vf->vport_assigned) { in efx_ef10_sriov_set_vf_vlan()
602 vf->vport_assigned = 0; in efx_ef10_sriov_set_vf_vlan()
605 if (!is_zero_ether_addr(vf->mac)) { in efx_ef10_sriov_set_vf_vlan()
606 rc = efx_ef10_vport_del_mac(efx, vf->vport_id, vf->mac); in efx_ef10_sriov_set_vf_vlan()
611 if (vf->vport_id) { in efx_ef10_sriov_set_vf_vlan()
612 rc = efx_ef10_vport_free(efx, vf->vport_id); in efx_ef10_sriov_set_vf_vlan()
615 vf->vport_id = 0; in efx_ef10_sriov_set_vf_vlan()
619 vf->vlan = new_vlan; in efx_ef10_sriov_set_vf_vlan()
624 vf->vlan, &vf->vport_id); in efx_ef10_sriov_set_vf_vlan()
629 if (!is_zero_ether_addr(vf->mac)) { in efx_ef10_sriov_set_vf_vlan()
630 rc2 = efx_ef10_vport_add_mac(efx, vf->vport_id, vf->mac); in efx_ef10_sriov_set_vf_vlan()
632 eth_zero_addr(vf->mac); in efx_ef10_sriov_set_vf_vlan()
638 rc2 = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i); in efx_ef10_sriov_set_vf_vlan()
642 vf->vport_assigned = 1; in efx_ef10_sriov_set_vf_vlan()
645 if (vf->efx) { in efx_ef10_sriov_set_vf_vlan()
646 rc2 = efx_ef10_vadaptor_alloc(vf->efx, EVB_PORT_ID_ASSIGNED); in efx_ef10_sriov_set_vf_vlan()
652 if (vf->efx) { in efx_ef10_sriov_set_vf_vlan()
653 rc2 = vf->efx->type->filter_table_probe(vf->efx); in efx_ef10_sriov_set_vf_vlan()
657 up_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_vlan()
658 mutex_unlock(&vf->efx->mac_lock); in efx_ef10_sriov_set_vf_vlan()
660 rc2 = efx_net_open(vf->efx->net_dev); in efx_ef10_sriov_set_vf_vlan()
664 efx_device_attach_if_not_resetting(vf->efx); in efx_ef10_sriov_set_vf_vlan()
669 if (vf->efx) { in efx_ef10_sriov_set_vf_vlan()
670 up_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_vlan()
671 mutex_unlock(&vf->efx->mac_lock); in efx_ef10_sriov_set_vf_vlan()
674 if (vf->efx) { in efx_ef10_sriov_set_vf_vlan()
677 efx_schedule_reset(vf->efx, RESET_TYPE_DATAPATH); in efx_ef10_sriov_set_vf_vlan()
783 struct ef10_vf *vf; in efx_ef10_sriov_get_vf_config() local
790 if (!nic_data->vf) in efx_ef10_sriov_get_vf_config()
793 vf = nic_data->vf + vf_i; in efx_ef10_sriov_get_vf_config()
795 ivf->vf = vf_i; in efx_ef10_sriov_get_vf_config()
798 ether_addr_copy(ivf->mac, vf->mac); in efx_ef10_sriov_get_vf_config()
799 ivf->vlan = (vf->vlan == EFX_EF10_NO_VLAN) ? 0 : vf->vlan; in efx_ef10_sriov_get_vf_config()