• 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 && in efx_ef10_sriov_free_vf_vports()
126 vf->pci_dev->dev_flags & PCI_DEV_FLAGS_ASSIGNED) in efx_ef10_sriov_free_vf_vports()
129 if (vf->vport_assigned) { in efx_ef10_sriov_free_vf_vports()
131 vf->vport_assigned = 0; in efx_ef10_sriov_free_vf_vports()
134 if (!is_zero_ether_addr(vf->mac)) { in efx_ef10_sriov_free_vf_vports()
135 efx_ef10_vport_del_mac(efx, vf->vport_id, vf->mac); in efx_ef10_sriov_free_vf_vports()
136 eth_zero_addr(vf->mac); in efx_ef10_sriov_free_vf_vports()
139 if (vf->vport_id) { in efx_ef10_sriov_free_vf_vports()
140 efx_ef10_vport_free(efx, vf->vport_id); in efx_ef10_sriov_free_vf_vports()
141 vf->vport_id = 0; in efx_ef10_sriov_free_vf_vports()
144 vf->efx = NULL; in efx_ef10_sriov_free_vf_vports()
153 kfree(nic_data->vf); in efx_ef10_sriov_free_vf_vswitching()
154 nic_data->vf = NULL; in efx_ef10_sriov_free_vf_vswitching()
161 struct ef10_vf *vf = nic_data->vf + vf_i; in efx_ef10_sriov_assign_vf_vport() local
164 if (WARN_ON_ONCE(!nic_data->vf)) in efx_ef10_sriov_assign_vf_vport()
169 vf->vlan, &vf->vport_id); in efx_ef10_sriov_assign_vf_vport()
173 rc = efx_ef10_vport_add_mac(efx, vf->vport_id, vf->mac); in efx_ef10_sriov_assign_vf_vport()
175 eth_zero_addr(vf->mac); in efx_ef10_sriov_assign_vf_vport()
179 rc = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i); in efx_ef10_sriov_assign_vf_vport()
183 vf->vport_assigned = 1; in efx_ef10_sriov_assign_vf_vport()
193 nic_data->vf = kcalloc(efx->vf_count, sizeof(struct ef10_vf), in efx_ef10_sriov_alloc_vf_vswitching()
195 if (!nic_data->vf) in efx_ef10_sriov_alloc_vf_vswitching()
199 eth_random_addr(nic_data->vf[i].mac); in efx_ef10_sriov_alloc_vf_vswitching()
200 nic_data->vf[i].efx = NULL; in efx_ef10_sriov_alloc_vf_vswitching()
201 nic_data->vf[i].vlan = EFX_EF10_NO_VLAN; in efx_ef10_sriov_alloc_vf_vswitching()
211 kfree(nic_data->vf); in efx_ef10_sriov_alloc_vf_vswitching()
212 nic_data->vf = NULL; in efx_ef10_sriov_alloc_vf_vswitching()
451 if (!nic_data->vf) { in efx_ef10_sriov_fini()
487 struct ef10_vf *vf; in efx_ef10_sriov_set_vf_mac() local
490 if (!nic_data->vf) in efx_ef10_sriov_set_vf_mac()
495 vf = nic_data->vf + vf_i; in efx_ef10_sriov_set_vf_mac()
497 if (vf->efx) { in efx_ef10_sriov_set_vf_mac()
498 efx_device_detach_sync(vf->efx); in efx_ef10_sriov_set_vf_mac()
499 efx_net_stop(vf->efx->net_dev); in efx_ef10_sriov_set_vf_mac()
501 down_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_mac()
502 vf->efx->type->filter_table_remove(vf->efx); in efx_ef10_sriov_set_vf_mac()
504 rc = efx_ef10_vadaptor_free(vf->efx, EVB_PORT_ID_ASSIGNED); in efx_ef10_sriov_set_vf_mac()
506 up_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_mac()
515 if (!is_zero_ether_addr(vf->mac)) { in efx_ef10_sriov_set_vf_mac()
516 rc = efx_ef10_vport_del_vf_mac(efx, vf->vport_id, vf->mac); in efx_ef10_sriov_set_vf_mac()
522 rc = efx_ef10_vport_add_mac(efx, vf->vport_id, mac); in efx_ef10_sriov_set_vf_mac()
526 if (vf->efx) in efx_ef10_sriov_set_vf_mac()
527 ether_addr_copy(vf->efx->net_dev->dev_addr, mac); in efx_ef10_sriov_set_vf_mac()
530 ether_addr_copy(vf->mac, mac); in efx_ef10_sriov_set_vf_mac()
532 rc = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i); in efx_ef10_sriov_set_vf_mac()
536 if (vf->efx) { in efx_ef10_sriov_set_vf_mac()
538 rc = efx_ef10_vadaptor_alloc(vf->efx, EVB_PORT_ID_ASSIGNED); in efx_ef10_sriov_set_vf_mac()
540 up_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_mac()
543 vf->efx->type->filter_table_probe(vf->efx); in efx_ef10_sriov_set_vf_mac()
544 up_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_mac()
545 efx_net_open(vf->efx->net_dev); in efx_ef10_sriov_set_vf_mac()
546 efx_device_attach_if_not_resetting(vf->efx); in efx_ef10_sriov_set_vf_mac()
552 eth_zero_addr(vf->mac); in efx_ef10_sriov_set_vf_mac()
560 struct ef10_vf *vf; in efx_ef10_sriov_set_vf_vlan() local
569 vf = nic_data->vf + vf_i; in efx_ef10_sriov_set_vf_vlan()
572 if (new_vlan == vf->vlan) in efx_ef10_sriov_set_vf_vlan()
575 if (vf->efx) { in efx_ef10_sriov_set_vf_vlan()
576 efx_device_detach_sync(vf->efx); in efx_ef10_sriov_set_vf_vlan()
577 efx_net_stop(vf->efx->net_dev); in efx_ef10_sriov_set_vf_vlan()
579 mutex_lock(&vf->efx->mac_lock); in efx_ef10_sriov_set_vf_vlan()
580 down_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_vlan()
581 vf->efx->type->filter_table_remove(vf->efx); in efx_ef10_sriov_set_vf_vlan()
583 rc = efx_ef10_vadaptor_free(vf->efx, EVB_PORT_ID_ASSIGNED); in efx_ef10_sriov_set_vf_vlan()
588 if (vf->vport_assigned) { in efx_ef10_sriov_set_vf_vlan()
599 vf->vport_assigned = 0; in efx_ef10_sriov_set_vf_vlan()
602 if (!is_zero_ether_addr(vf->mac)) { in efx_ef10_sriov_set_vf_vlan()
603 rc = efx_ef10_vport_del_mac(efx, vf->vport_id, vf->mac); in efx_ef10_sriov_set_vf_vlan()
608 if (vf->vport_id) { in efx_ef10_sriov_set_vf_vlan()
609 rc = efx_ef10_vport_free(efx, vf->vport_id); in efx_ef10_sriov_set_vf_vlan()
612 vf->vport_id = 0; in efx_ef10_sriov_set_vf_vlan()
616 vf->vlan = new_vlan; in efx_ef10_sriov_set_vf_vlan()
621 vf->vlan, &vf->vport_id); in efx_ef10_sriov_set_vf_vlan()
626 if (!is_zero_ether_addr(vf->mac)) { in efx_ef10_sriov_set_vf_vlan()
627 rc2 = efx_ef10_vport_add_mac(efx, vf->vport_id, vf->mac); in efx_ef10_sriov_set_vf_vlan()
629 eth_zero_addr(vf->mac); in efx_ef10_sriov_set_vf_vlan()
635 rc2 = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i); in efx_ef10_sriov_set_vf_vlan()
639 vf->vport_assigned = 1; in efx_ef10_sriov_set_vf_vlan()
642 if (vf->efx) { in efx_ef10_sriov_set_vf_vlan()
643 rc2 = efx_ef10_vadaptor_alloc(vf->efx, EVB_PORT_ID_ASSIGNED); in efx_ef10_sriov_set_vf_vlan()
649 if (vf->efx) { in efx_ef10_sriov_set_vf_vlan()
650 rc2 = vf->efx->type->filter_table_probe(vf->efx); in efx_ef10_sriov_set_vf_vlan()
654 up_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_vlan()
655 mutex_unlock(&vf->efx->mac_lock); in efx_ef10_sriov_set_vf_vlan()
657 rc2 = efx_net_open(vf->efx->net_dev); in efx_ef10_sriov_set_vf_vlan()
661 efx_device_attach_if_not_resetting(vf->efx); in efx_ef10_sriov_set_vf_vlan()
666 if (vf->efx) { in efx_ef10_sriov_set_vf_vlan()
667 up_write(&vf->efx->filter_sem); in efx_ef10_sriov_set_vf_vlan()
668 mutex_unlock(&vf->efx->mac_lock); in efx_ef10_sriov_set_vf_vlan()
671 if (vf->efx) { in efx_ef10_sriov_set_vf_vlan()
674 efx_schedule_reset(vf->efx, RESET_TYPE_DATAPATH); in efx_ef10_sriov_set_vf_vlan()
780 struct ef10_vf *vf; in efx_ef10_sriov_get_vf_config() local
787 if (!nic_data->vf) in efx_ef10_sriov_get_vf_config()
790 vf = nic_data->vf + vf_i; in efx_ef10_sriov_get_vf_config()
792 ivf->vf = vf_i; in efx_ef10_sriov_get_vf_config()
795 ether_addr_copy(ivf->mac, vf->mac); in efx_ef10_sriov_get_vf_config()
796 ivf->vlan = (vf->vlan == EFX_EF10_NO_VLAN) ? 0 : vf->vlan; in efx_ef10_sriov_get_vf_config()