Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ena/ena.c
Context not available. | |||||
ENA_LOCK_UNLOCK(); | ENA_LOCK_UNLOCK(); | ||||
} | } | ||||
static void | |||||
ena_free_stats(struct ena_adapter *adapter) | |||||
{ | |||||
ena_free_counters((counter_u64_t *)&adapter->hw_stats, | |||||
sizeof(struct ena_hw_stats)); | |||||
ena_free_counters((counter_u64_t *)&adapter->dev_stats, | |||||
sizeof(struct ena_stats_dev)); | |||||
} | |||||
/** | /** | ||||
* ena_attach - Device Initialization Routine | * ena_attach - Device Initialization Routine | ||||
* @pdev: device information struct | * @pdev: device information struct | ||||
Context not available. | |||||
/* initialize rings basic information */ | /* initialize rings basic information */ | ||||
ena_init_io_rings(adapter); | ena_init_io_rings(adapter); | ||||
/* Initialize statistics */ | |||||
ena_alloc_counters((counter_u64_t *)&adapter->dev_stats, | |||||
sizeof(struct ena_stats_dev)); | |||||
ena_alloc_counters((counter_u64_t *)&adapter->hw_stats, | |||||
sizeof(struct ena_hw_stats)); | |||||
ena_sysctl_add_nodes(adapter); | |||||
/* setup network interface */ | /* setup network interface */ | ||||
rc = ena_setup_ifnet(pdev, adapter, &get_feat_ctx); | rc = ena_setup_ifnet(pdev, adapter, &get_feat_ctx); | ||||
if (unlikely(rc != 0)) { | if (unlikely(rc != 0)) { | ||||
Context not available. | |||||
taskqueue_start_threads(&adapter->metrics_tq, 1, PI_NET, "%s metricsq", | taskqueue_start_threads(&adapter->metrics_tq, 1, PI_NET, "%s metricsq", | ||||
device_get_nameunit(adapter->pdev)); | device_get_nameunit(adapter->pdev)); | ||||
/* Initialize statistics */ | |||||
ena_alloc_counters((counter_u64_t *)&adapter->dev_stats, | |||||
sizeof(struct ena_stats_dev)); | |||||
ena_alloc_counters((counter_u64_t *)&adapter->hw_stats, | |||||
sizeof(struct ena_hw_stats)); | |||||
ena_sysctl_add_nodes(adapter); | |||||
#ifdef DEV_NETMAP | #ifdef DEV_NETMAP | ||||
rc = ena_netmap_attach(adapter); | rc = ena_netmap_attach(adapter); | ||||
if (rc != 0) { | if (rc != 0) { | ||||
Context not available. | |||||
ether_ifdetach(adapter->ifp); | ether_ifdetach(adapter->ifp); | ||||
#endif /* DEV_NETMAP */ | #endif /* DEV_NETMAP */ | ||||
err_msix_free: | err_msix_free: | ||||
ena_free_stats(adapter); | |||||
ena_com_dev_reset(adapter->ena_dev, ENA_REGS_RESET_INIT_ERR); | ena_com_dev_reset(adapter->ena_dev, ENA_REGS_RESET_INIT_ERR); | ||||
ena_free_mgmnt_irq(adapter); | ena_free_mgmnt_irq(adapter); | ||||
ena_disable_msix(adapter); | ena_disable_msix(adapter); | ||||
Context not available. | |||||
netmap_detach(adapter->ifp); | netmap_detach(adapter->ifp); | ||||
#endif /* DEV_NETMAP */ | #endif /* DEV_NETMAP */ | ||||
ena_free_counters((counter_u64_t *)&adapter->hw_stats, | ena_free_stats(adapter); | ||||
sizeof(struct ena_hw_stats)); | |||||
ena_free_counters((counter_u64_t *)&adapter->dev_stats, | |||||
sizeof(struct ena_stats_dev)); | |||||
rc = ena_free_rx_dma_tag(adapter); | rc = ena_free_rx_dma_tag(adapter); | ||||
if (unlikely(rc != 0)) | if (unlikely(rc != 0)) | ||||
Context not available. |