Lines Matching refs:efx
30 static void ef100_update_name(struct efx_nic *efx)
32 strcpy(efx->name, efx->net_dev->name);
35 static int ef100_alloc_vis(struct efx_nic *efx, unsigned int *allocated_vis)
41 unsigned int tx_vis = efx->n_tx_channels + efx->n_extra_tx_channels;
42 unsigned int rx_vis = efx->n_rx_channels;
46 EFX_WARN_ON_PARANOID(efx->tx_queues_per_channel != 1);
48 tx_vis += efx->n_xdp_channels * efx->xdp_tx_per_channel;
52 min_vis = efx->tx_queues_per_channel;
54 rc = efx_mcdi_alloc_vis(efx, min_vis, max_vis,
66 static int ef100_remap_bar(struct efx_nic *efx, int max_vis)
71 efx->max_vis = max_vis;
72 uc_mem_map_size = PAGE_ALIGN(max_vis * efx->vi_stride);
75 membase = ioremap(efx->membase_phys, uc_mem_map_size);
77 netif_err(efx, probe, efx->net_dev,
82 iounmap(efx->membase);
83 efx->membase = membase;
93 struct efx_nic *efx = efx_netdev_priv(net_dev);
95 netif_dbg(efx, ifdown, efx->net_dev, "closing on CPU %d\n",
98 efx_detach_reps(efx);
100 efx_stop_all(efx);
101 efx_mcdi_mac_fini_stats(efx);
102 efx_disable_interrupts(efx);
103 efx_clear_interrupt_affinity(efx);
104 efx_nic_fini_interrupt(efx);
105 efx_remove_filters(efx);
106 efx_fini_napi(efx);
107 efx_remove_channels(efx);
108 efx_mcdi_free_vis(efx);
109 efx_remove_interrupts(efx);
111 efx->state = STATE_NET_DOWN;
119 struct efx_nic *efx = efx_netdev_priv(net_dev);
123 ef100_update_name(efx);
124 netif_dbg(efx, ifup, net_dev, "opening device on CPU %d\n",
127 rc = efx_check_disabled(efx);
131 rc = efx_probe_interrupts(efx);
135 rc = efx_set_channels(efx);
139 rc = efx_mcdi_free_vis(efx);
143 rc = ef100_alloc_vis(efx, &allocated_vis);
151 rc = efx_mcdi_free_vis(efx);
155 efx_remove_interrupts(efx);
156 efx->max_channels = allocated_vis;
158 rc = efx_probe_interrupts(efx);
162 rc = efx_set_channels(efx);
166 rc = ef100_alloc_vis(efx, &allocated_vis);
179 rc = efx_probe_channels(efx);
183 rc = ef100_remap_bar(efx, allocated_vis);
187 efx_init_napi(efx);
189 rc = efx_probe_filters(efx);
193 rc = efx_nic_init_interrupt(efx);
196 efx_set_interrupt_affinity(efx);
198 rc = efx_enable_interrupts(efx);
205 (void) efx_mcdi_poll_reboot(efx);
207 rc = efx_mcdi_mac_init_stats(efx);
211 efx_start_all(efx);
216 mutex_lock(&efx->mac_lock);
217 if (efx_mcdi_phy_poll(efx))
218 efx_link_status_changed(efx);
219 mutex_unlock(&efx->mac_lock);
221 efx->state = STATE_NET_UP;
222 if (netif_running(efx->net_dev))
223 efx_attach_reps(efx);
242 struct efx_nic *efx = efx_netdev_priv(net_dev);
244 return __ef100_hard_start_xmit(skb, efx, net_dev, NULL);
248 struct efx_nic *efx,
256 channel = efx_get_tx_channel(efx, skb_get_queue_mapping(skb));
257 netif_vdbg(efx, tx_queued, efx->net_dev,
260 if (!efx->n_channels || !efx->n_tx_channels || !channel) {
302 struct efx_nic *efx = container_of(this, struct efx_nic, netdev_notifier);
304 struct ef100_nic_data *nic_data = efx->nic_data;
307 if (efx->net_dev == net_dev &&
309 ef100_update_name(efx);
313 err = efx_tc_netdev_event(efx, event, net_dev);
323 struct efx_nic *efx = container_of(this, struct efx_nic, netevent_notifier);
324 struct ef100_nic_data *nic_data = efx->nic_data;
329 err = efx_tc_netevent_event(efx, event, ptr);
336 static int ef100_register_netdev(struct efx_nic *efx)
338 struct net_device *net_dev = efx->net_dev;
342 net_dev->irq = efx->pci_dev->irq;
353 ef100_update_name(efx);
362 efx->state = STATE_NET_DOWN;
364 efx_init_mcdi_logging(efx);
370 netif_err(efx, drv, efx->net_dev, "could not register net dev\n");
374 static void ef100_unregister_netdev(struct efx_nic *efx)
376 if (efx_dev_registered(efx)) {
377 efx_fini_mcdi_logging(efx);
378 efx->state = STATE_PROBED;
379 unregister_netdev(efx->net_dev);
385 struct efx_nic *efx = &probe_data->efx;
387 if (!efx->net_dev)
391 dev_close(efx->net_dev);
394 unregister_netdevice_notifier(&efx->netdev_notifier);
395 unregister_netevent_notifier(&efx->netevent_notifier);
397 if (!efx->type->is_vf)
398 efx_ef100_pci_sriov_disable(efx, true);
401 efx_fini_devlink_lock(efx);
402 ef100_unregister_netdev(efx);
405 ef100_pf_unset_devlink_port(efx);
406 efx_fini_tc(efx);
409 down_write(&efx->filter_sem);
410 efx_mcdi_filter_table_remove(efx);
411 up_write(&efx->filter_sem);
412 efx_fini_channels(efx);
413 kfree(efx->phy_data);
414 efx->phy_data = NULL;
416 efx_fini_devlink_and_unlock(efx);
418 free_netdev(efx->net_dev);
419 efx->net_dev = NULL;
420 efx->state = STATE_PROBED;
425 struct efx_nic *efx = &probe_data->efx;
431 if (efx->mcdi->fn_flags &
433 pci_info(efx->pci_dev, "No network port on this PCI function");
443 efx->net_dev = net_dev;
444 SET_NETDEV_DEV(net_dev, &efx->pci_dev->dev);
447 net_dev->features |= efx->type->offload_features &
449 net_dev->hw_features |= efx->type->offload_features;
450 net_dev->hw_enc_features |= efx->type->offload_features;
455 efx->mdio.dev = net_dev;
457 rc = efx_ef100_init_datapath_caps(efx);
461 rc = ef100_phy_probe(efx);
465 rc = efx_init_channels(efx);
469 down_write(&efx->filter_sem);
470 rc = ef100_filter_table_probe(efx);
471 up_write(&efx->filter_sem);
475 netdev_rss_key_fill(efx->rss_context.rx_hash_key,
476 sizeof(efx->rss_context.rx_hash_key));
479 efx_mcdi_push_default_indir_table(efx, efx->n_rx_channels);
481 nic_data = efx->nic_data;
482 rc = ef100_get_mac_address(efx, net_dev->perm_addr, CLIENT_HANDLE_SELF,
483 efx->type->is_vf);
491 rc = efx_probe_devlink_and_lock(efx);
493 pci_info(efx->pci_dev, "devlink registration failed");
495 rc = ef100_register_netdev(efx);
499 if (!efx->type->is_vf) {
500 rc = ef100_probe_netdev_pf(efx);
504 ef100_pf_set_devlink_port(efx);
508 efx->netdev_notifier.notifier_call = ef100_netdev_event;
509 rc = register_netdevice_notifier(&efx->netdev_notifier);
511 netif_err(efx, probe, efx->net_dev,
516 efx->netevent_notifier.notifier_call = ef100_netevent_event;
517 rc = register_netevent_notifier(&efx->netevent_notifier);
519 netif_err(efx, probe, efx->net_dev,
524 efx_probe_devlink_unlock(efx);
529 ef100_pf_unset_devlink_port(efx);
531 efx_probe_devlink_unlock(efx);