Lines Matching refs:vf

118 	if (!nic_data->vf)
122 struct ef10_vf *vf = nic_data->vf + i;
125 if (vf->pci_dev && pci_is_dev_assigned(vf->pci_dev))
128 if (vf->vport_assigned) {
130 vf->vport_assigned = 0;
133 if (!is_zero_ether_addr(vf->mac)) {
134 efx_ef10_vport_del_mac(efx, vf->vport_id, vf->mac);
135 eth_zero_addr(vf->mac);
138 if (vf->vport_id) {
139 efx_ef10_vport_free(efx, vf->vport_id);
140 vf->vport_id = 0;
143 vf->efx = NULL;
152 kfree(nic_data->vf);
153 nic_data->vf = NULL;
160 struct ef10_vf *vf = nic_data->vf + vf_i;
163 if (WARN_ON_ONCE(!nic_data->vf))
168 vf->vlan, &vf->vport_id);
172 rc = efx_ef10_vport_add_mac(efx, vf->vport_id, vf->mac);
174 eth_zero_addr(vf->mac);
178 rc = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i);
182 vf->vport_assigned = 1;
192 nic_data->vf = kcalloc(efx->vf_count, sizeof(struct ef10_vf),
194 if (!nic_data->vf)
198 eth_random_addr(nic_data->vf[i].mac);
199 nic_data->vf[i].efx = NULL;
200 nic_data->vf[i].vlan = EFX_EF10_NO_VLAN;
423 nic_data->vf[i].pci_dev = NULL;
452 if (!nic_data->vf) {
490 struct ef10_vf *vf;
493 if (!nic_data->vf)
498 vf = nic_data->vf + vf_i;
500 if (vf->efx) {
501 efx_device_detach_sync(vf->efx);
502 efx_net_stop(vf->efx->net_dev);
504 vf->efx->type->filter_table_remove(vf->efx);
506 rc = efx_ef10_vadaptor_free(vf->efx, EVB_PORT_ID_ASSIGNED);
515 if (!is_zero_ether_addr(vf->mac)) {
516 rc = efx_ef10_vport_del_vf_mac(efx, vf->vport_id, vf->mac);
522 rc = efx_ef10_vport_add_mac(efx, vf->vport_id, mac);
526 if (vf->efx)
527 eth_hw_addr_set(vf->efx->net_dev, mac);
530 ether_addr_copy(vf->mac, mac);
532 rc = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i);
536 if (vf->efx) {
538 rc = efx_ef10_vadaptor_alloc(vf->efx, EVB_PORT_ID_ASSIGNED);
541 vf->efx->type->filter_table_probe(vf->efx);
542 efx_net_open(vf->efx->net_dev);
543 efx_device_attach_if_not_resetting(vf->efx);
549 eth_zero_addr(vf->mac);
557 struct ef10_vf *vf;
566 vf = nic_data->vf + vf_i;
569 if (new_vlan == vf->vlan)
572 if (vf->efx) {
573 efx_device_detach_sync(vf->efx);
574 efx_net_stop(vf->efx->net_dev);
576 mutex_lock(&vf->efx->mac_lock);
577 vf->efx->type->filter_table_remove(vf->efx);
579 rc = efx_ef10_vadaptor_free(vf->efx, EVB_PORT_ID_ASSIGNED);
584 if (vf->vport_assigned) {
595 vf->vport_assigned = 0;
598 if (!is_zero_ether_addr(vf->mac)) {
599 rc = efx_ef10_vport_del_mac(efx, vf->vport_id, vf->mac);
604 if (vf->vport_id) {
605 rc = efx_ef10_vport_free(efx, vf->vport_id);
608 vf->vport_id = 0;
612 vf->vlan = new_vlan;
617 vf->vlan, &vf->vport_id);
622 if (!is_zero_ether_addr(vf->mac)) {
623 rc2 = efx_ef10_vport_add_mac(efx, vf->vport_id, vf->mac);
625 eth_zero_addr(vf->mac);
631 rc2 = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i);
635 vf->vport_assigned = 1;
638 if (vf->efx) {
639 rc2 = efx_ef10_vadaptor_alloc(vf->efx, EVB_PORT_ID_ASSIGNED);
645 if (vf->efx) {
646 rc2 = vf->efx->type->filter_table_probe(vf->efx);
650 mutex_unlock(&vf->efx->mac_lock);
652 rc2 = efx_net_open(vf->efx->net_dev);
656 efx_device_attach_if_not_resetting(vf->efx);
661 if (vf->efx)
662 mutex_unlock(&vf->efx->mac_lock);
664 if (vf->efx) {
667 efx_schedule_reset(vf->efx, RESET_TYPE_DATAPATH);
773 struct ef10_vf *vf;
780 if (!nic_data->vf)
783 vf = nic_data->vf + vf_i;
785 ivf->vf = vf_i;
788 ether_addr_copy(ivf->mac, vf->mac);
789 ivf->vlan = (vf->vlan == EFX_EF10_NO_VLAN) ? 0 : vf->vlan;