Lines Matching refs:vf

118 	if (!nic_data->vf)
122 struct ef10_vf *vf = nic_data->vf + i;
125 if (vf->pci_dev &&
126 vf->pci_dev->dev_flags & PCI_DEV_FLAGS_ASSIGNED)
129 if (vf->vport_assigned) {
131 vf->vport_assigned = 0;
134 if (!is_zero_ether_addr(vf->mac)) {
135 efx_ef10_vport_del_mac(efx, vf->vport_id, vf->mac);
136 eth_zero_addr(vf->mac);
139 if (vf->vport_id) {
140 efx_ef10_vport_free(efx, vf->vport_id);
141 vf->vport_id = 0;
144 vf->efx = NULL;
153 kfree(nic_data->vf);
154 nic_data->vf = NULL;
161 struct ef10_vf *vf = nic_data->vf + vf_i;
164 if (WARN_ON_ONCE(!nic_data->vf))
169 vf->vlan, &vf->vport_id);
173 rc = efx_ef10_vport_add_mac(efx, vf->vport_id, vf->mac);
175 eth_zero_addr(vf->mac);
179 rc = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i);
183 vf->vport_assigned = 1;
193 nic_data->vf = kcalloc(efx->vf_count, sizeof(struct ef10_vf),
195 if (!nic_data->vf)
199 eth_random_addr(nic_data->vf[i].mac);
200 nic_data->vf[i].efx = NULL;
201 nic_data->vf[i].vlan = EFX_EF10_NO_VLAN;
211 kfree(nic_data->vf);
212 nic_data->vf = NULL;
426 nic_data->vf[i].pci_dev = NULL;
455 if (!nic_data->vf) {
491 struct ef10_vf *vf;
494 if (!nic_data->vf)
499 vf = nic_data->vf + vf_i;
501 if (vf->efx) {
502 efx_device_detach_sync(vf->efx);
503 efx_net_stop(vf->efx->net_dev);
505 down_write(&vf->efx->filter_sem);
506 vf->efx->type->filter_table_remove(vf->efx);
508 rc = efx_ef10_vadaptor_free(vf->efx, EVB_PORT_ID_ASSIGNED);
510 up_write(&vf->efx->filter_sem);
519 if (!is_zero_ether_addr(vf->mac)) {
520 rc = efx_ef10_vport_del_vf_mac(efx, vf->vport_id, vf->mac);
526 rc = efx_ef10_vport_add_mac(efx, vf->vport_id, mac);
530 if (vf->efx)
531 ether_addr_copy(vf->efx->net_dev->dev_addr, mac);
534 ether_addr_copy(vf->mac, mac);
536 rc = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i);
540 if (vf->efx) {
542 rc = efx_ef10_vadaptor_alloc(vf->efx, EVB_PORT_ID_ASSIGNED);
544 up_write(&vf->efx->filter_sem);
547 vf->efx->type->filter_table_probe(vf->efx);
548 up_write(&vf->efx->filter_sem);
549 efx_net_open(vf->efx->net_dev);
550 efx_device_attach_if_not_resetting(vf->efx);
556 eth_zero_addr(vf->mac);
564 struct ef10_vf *vf;
573 vf = nic_data->vf + vf_i;
576 if (new_vlan == vf->vlan)
579 if (vf->efx) {
580 efx_device_detach_sync(vf->efx);
581 efx_net_stop(vf->efx->net_dev);
583 mutex_lock(&vf->efx->mac_lock);
584 down_write(&vf->efx->filter_sem);
585 vf->efx->type->filter_table_remove(vf->efx);
587 rc = efx_ef10_vadaptor_free(vf->efx, EVB_PORT_ID_ASSIGNED);
592 if (vf->vport_assigned) {
603 vf->vport_assigned = 0;
606 if (!is_zero_ether_addr(vf->mac)) {
607 rc = efx_ef10_vport_del_mac(efx, vf->vport_id, vf->mac);
612 if (vf->vport_id) {
613 rc = efx_ef10_vport_free(efx, vf->vport_id);
616 vf->vport_id = 0;
620 vf->vlan = new_vlan;
625 vf->vlan, &vf->vport_id);
630 if (!is_zero_ether_addr(vf->mac)) {
631 rc2 = efx_ef10_vport_add_mac(efx, vf->vport_id, vf->mac);
633 eth_zero_addr(vf->mac);
639 rc2 = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i);
643 vf->vport_assigned = 1;
646 if (vf->efx) {
647 rc2 = efx_ef10_vadaptor_alloc(vf->efx, EVB_PORT_ID_ASSIGNED);
653 if (vf->efx) {
654 rc2 = vf->efx->type->filter_table_probe(vf->efx);
658 up_write(&vf->efx->filter_sem);
659 mutex_unlock(&vf->efx->mac_lock);
661 rc2 = efx_net_open(vf->efx->net_dev);
665 efx_device_attach_if_not_resetting(vf->efx);
670 if (vf->efx) {
671 up_write(&vf->efx->filter_sem);
672 mutex_unlock(&vf->efx->mac_lock);
675 if (vf->efx) {
678 efx_schedule_reset(vf->efx, RESET_TYPE_DATAPATH);
784 struct ef10_vf *vf;
791 if (!nic_data->vf)
794 vf = nic_data->vf + vf_i;
796 ivf->vf = vf_i;
799 ether_addr_copy(ivf->mac, vf->mac);
800 ivf->vlan = (vf->vlan == EFX_EF10_NO_VLAN) ? 0 : vf->vlan;