Lines Matching refs:ena_dev

78 	ret = ena_com_set_dev_mtu(adapter->ena_dev, new_mtu);  in ena_change_mtu()
172 ring->ena_dev = adapter->ena_dev; in ena_init_io_rings_common()
183 struct ena_com_dev *ena_dev; in ena_init_io_rings() local
187 ena_dev = adapter->ena_dev; in ena_init_io_rings()
198 txr->tx_max_header_size = ena_dev->tx_max_header_size; in ena_init_io_rings()
199 txr->tx_mem_queue_type = ena_dev->tx_mem_queue_type; in ena_init_io_rings()
202 ena_com_get_nonadaptive_moderation_interval_tx(ena_dev); in ena_init_io_rings()
216 ena_com_get_nonadaptive_moderation_interval_rx(ena_dev); in ena_init_io_rings()
748 ena_com_destroy_io_queue(adapter->ena_dev, ena_qid); in ena_destroy_all_tx_queues()
760 ena_com_destroy_io_queue(adapter->ena_dev, ena_qid); in ena_destroy_all_rx_queues()
1375 rx_interval = ena_com_get_adaptive_moderation_enabled(rx_ring->ena_dev) ? in ena_unmask_interrupt()
1377 ena_com_get_nonadaptive_moderation_interval_rx(rx_ring->ena_dev); in ena_unmask_interrupt()
1483 if (ena_com_get_adaptive_moderation_enabled(rx_ring->ena_dev)) in ena_io_poll()
1509 ena_com_admin_q_comp_intr_handler(adapter->ena_dev); in ena_intr_msix_mgmnt()
1513 ena_com_aenq_intr_handler(adapter->ena_dev, data); in ena_intr_msix_mgmnt()
1797 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_rss_configure() local
1801 if (!ena_dev->rss.tbl_log_size) { in ena_rss_configure()
1810 rc = ena_com_indirect_table_set(ena_dev); in ena_rss_configure()
1815 rc = ena_com_set_hash_function(ena_dev); in ena_rss_configure()
1820 rc = ena_com_set_hash_ctrl(ena_dev); in ena_rss_configure()
1852 struct ena_com_dev *ena_dev; in ena_create_io_tx_queue() local
1858 ena_dev = adapter->ena_dev; in ena_create_io_tx_queue()
1868 ctx.mem_queue_type = ena_dev->tx_mem_queue_type; in ena_create_io_tx_queue()
1873 rc = ena_com_create_io_queue(ena_dev, &ctx); in ena_create_io_tx_queue()
1881 rc = ena_com_get_io_handlers(ena_dev, ena_qid, in ena_create_io_tx_queue()
1888 ena_com_destroy_io_queue(ena_dev, ena_qid); in ena_create_io_tx_queue()
1899 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_create_io_tx_queues_in_range() local
1912 ena_com_destroy_io_queue(ena_dev, ENA_IO_TXQ_IDX(i)); in ena_create_io_tx_queues_in_range()
1919 struct ena_com_dev *ena_dev; in ena_create_io_rx_queue() local
1926 ena_dev = adapter->ena_dev; in ena_create_io_rx_queue()
1941 rc = ena_com_create_io_queue(ena_dev, &ctx); in ena_create_io_rx_queue()
1949 rc = ena_com_get_io_handlers(ena_dev, ena_qid, in ena_create_io_rx_queue()
1963 ena_com_destroy_io_queue(ena_dev, ena_qid); in ena_create_io_rx_queue()
1969 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_create_all_io_rx_queues() local
1984 ena_com_destroy_io_queue(ena_dev, ENA_IO_RXQ_IDX(i)); in ena_create_all_io_rx_queues()
2191 rc = ena_com_dev_reset(adapter->ena_dev, adapter->reset_reason); in ena_down()
2196 ena_com_set_admin_running_state(adapter->ena_dev, false); in ena_down()
2300 large_llq_changed = adapter->ena_dev->tx_mem_queue_type == in ena_update_queue_params()
2303 new_llq_header_len != adapter->ena_dev->tx_max_header_size; in ena_update_queue_params()
2336 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_update_queue_count() local
2363 ena_com_rss_destroy(ena_dev); in ena_update_queue_count()
2659 static void ena_config_host_info(struct ena_com_dev *ena_dev, struct pci_dev *pdev) in ena_config_host_info() argument
2666 rc = ena_com_allocate_host_info(ena_dev); in ena_config_host_info()
2672 host_info = ena_dev->host_attr.host_info; in ena_config_host_info()
2696 rc = ena_com_set_host_attributes(ena_dev); in ena_config_host_info()
2709 ena_com_delete_host_info(ena_dev); in ena_config_host_info()
2727 rc = ena_com_allocate_debug_area(adapter->ena_dev, debug_area_size); in ena_config_debug_area()
2734 rc = ena_com_set_host_attributes(adapter->ena_dev); in ena_config_debug_area()
2746 ena_com_delete_debug_area(adapter->ena_dev); in ena_config_debug_area()
2753 rc = ena_com_get_eni_stats(adapter->ena_dev, &adapter->eni_stats); in ena_update_hw_stats()
2841 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_calc_io_queue_size() local
2856 if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { in ena_calc_io_queue_size()
2863 if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) in ena_calc_io_queue_size()
2881 if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) in ena_calc_io_queue_size()
2902 ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { in ena_calc_io_queue_size()
2956 struct ena_com_dev *ena_dev = adapter->ena_dev; in set_default_llq_configurations() local
2963 !!(ena_dev->supported_features & BIT(ENA_ADMIN_LLQ)); in set_default_llq_configurations()
2979 struct ena_com_dev *ena_dev, in ena_set_queues_placement_policy() argument
2987 if (!(ena_dev->supported_features & llq_feature_mask)) { in ena_set_queues_placement_policy()
2990 ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; in ena_set_queues_placement_policy()
2994 if (!ena_dev->mem_bar) { in ena_set_queues_placement_policy()
2995 netdev_err(ena_dev->net_device, in ena_set_queues_placement_policy()
2997 ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; in ena_set_queues_placement_policy()
3001 rc = ena_com_config_dev_mode(ena_dev, llq, llq_default_configurations); in ena_set_queues_placement_policy()
3005 ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; in ena_set_queues_placement_policy()
3011 static int ena_map_llq_mem_bar(struct pci_dev *pdev, struct ena_com_dev *ena_dev, in ena_map_llq_mem_bar() argument
3019 ena_dev->mem_bar = devm_ioremap_wc(&pdev->dev, in ena_map_llq_mem_bar()
3023 if (!ena_dev->mem_bar) in ena_map_llq_mem_bar()
3033 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_device_init() local
3041 rc = ena_com_mmio_reg_read_request_init(ena_dev); in ena_device_init()
3051 ena_com_set_mmio_read_mode(ena_dev, readless_supported); in ena_device_init()
3053 rc = ena_com_dev_reset(ena_dev, ENA_REGS_RESET_NORMAL); in ena_device_init()
3059 rc = ena_com_validate_version(ena_dev); in ena_device_init()
3065 dma_width = ena_com_get_dma_width(ena_dev); in ena_device_init()
3079 rc = ena_com_admin_init(ena_dev, &aenq_handlers); in ena_device_init()
3090 ena_com_set_admin_polling_mode(ena_dev, true); in ena_device_init()
3092 ena_config_host_info(ena_dev, pdev); in ena_device_init()
3095 rc = ena_com_get_dev_attr_feat(ena_dev, get_feat_ctx); in ena_device_init()
3110 rc = ena_com_set_aenq_config(ena_dev, aenq_groups); in ena_device_init()
3120 rc = ena_set_queues_placement_policy(pdev, ena_dev, &get_feat_ctx->llq, in ena_device_init()
3132 ena_com_delete_host_info(ena_dev); in ena_device_init()
3133 ena_com_admin_destroy(ena_dev); in ena_device_init()
3135 ena_com_mmio_reg_read_request_destroy(ena_dev); in ena_device_init()
3142 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_enable_msix_and_set_admin_interrupts() local
3160 ena_com_set_admin_polling_mode(ena_dev, false); in ena_enable_msix_and_set_admin_interrupts()
3162 ena_com_admin_aenq_enable(ena_dev); in ena_enable_msix_and_set_admin_interrupts()
3175 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_destroy_device() local
3188 ena_com_set_admin_running_state(ena_dev, false); in ena_destroy_device()
3197 ena_com_dev_reset(adapter->ena_dev, adapter->reset_reason); in ena_destroy_device()
3203 ena_com_abort_admin_commands(ena_dev); in ena_destroy_device()
3205 ena_com_wait_for_abort_completion(ena_dev); in ena_destroy_device()
3207 ena_com_admin_destroy(ena_dev); in ena_destroy_device()
3209 ena_com_mmio_reg_read_request_destroy(ena_dev); in ena_destroy_device()
3221 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_restore_device() local
3238 txr->tx_mem_queue_type = ena_dev->tx_mem_queue_type; in ena_restore_device()
3239 txr->tx_max_header_size = ena_dev->tx_max_header_size; in ena_restore_device()
3276 ena_com_abort_admin_commands(ena_dev); in ena_restore_device()
3277 ena_com_wait_for_abort_completion(ena_dev); in ena_restore_device()
3278 ena_com_admin_destroy(ena_dev); in ena_restore_device()
3279 ena_com_dev_reset(ena_dev, ENA_REGS_RESET_DRIVER_INVALID_STATE); in ena_restore_device()
3280 ena_com_mmio_reg_read_request_destroy(ena_dev); in ena_restore_device()
3518 if (unlikely(!ena_com_get_admin_running_state(adapter->ena_dev))) { in check_for_admin_com_state()
3533 adapter->ena_dev->admin_queue.completion_timeout = in ena_update_hints()
3538 adapter->ena_dev->mmio_read.reg_read_to = in ena_update_hints()
3577 u8 *debug_area = adapter->ena_dev->host_attr.debug_area_virt_addr; in ena_timer_service()
3579 adapter->ena_dev->host_attr.host_info; in ena_timer_service()
3608 struct ena_com_dev *ena_dev, in ena_calc_max_io_queue_num() argument
3613 if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { in ena_calc_max_io_queue_num()
3630 if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) in ena_calc_max_io_queue_num()
3708 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_rss_init_default() local
3713 rc = ena_com_rss_init(ena_dev, ENA_RX_RSS_TABLE_LOG_SIZE); in ena_rss_init_default()
3721 rc = ena_com_indirect_table_fill_entry(ena_dev, i, in ena_rss_init_default()
3729 rc = ena_com_fill_hash_function(ena_dev, ENA_ADMIN_TOEPLITZ, NULL, ENA_HASH_KEY_SIZE, in ena_rss_init_default()
3736 rc = ena_com_set_default_hash_ctrl(ena_dev); in ena_rss_init_default()
3745 ena_com_rss_destroy(ena_dev); in ena_rss_init_default()
3751 static void ena_release_bars(struct ena_com_dev *ena_dev, struct pci_dev *pdev) in ena_release_bars() argument
3771 struct ena_com_dev *ena_dev = NULL; in ena_probe() local
3795 ena_dev = vzalloc(sizeof(*ena_dev)); in ena_probe()
3796 if (!ena_dev) { in ena_probe()
3809 ena_dev->reg_bar = devm_ioremap(&pdev->dev, in ena_probe()
3812 if (!ena_dev->reg_bar) { in ena_probe()
3818 ena_dev->ena_min_poll_delay_us = ENA_ADMIN_POLL_DELAY_US; in ena_probe()
3820 ena_dev->dmadev = &pdev->dev; in ena_probe()
3831 adapter->ena_dev = ena_dev; in ena_probe()
3836 ena_dev->net_device = netdev; in ena_probe()
3840 rc = ena_map_llq_mem_bar(pdev, ena_dev, bars); in ena_probe()
3857 ena_dev->intr_moder_tx_interval = ENA_INTR_INITIAL_TX_INTERVAL_USECS; in ena_probe()
3858 ena_dev->intr_moder_rx_interval = ENA_INTR_INITIAL_RX_INTERVAL_USECS; in ena_probe()
3859 ena_dev->intr_delay_resolution = ENA_DEFAULT_INTR_DELAY_RESOLUTION; in ena_probe()
3860 max_num_io_queues = ena_calc_max_io_queue_num(pdev, ena_dev, &get_feat_ctx); in ena_probe()
3878 if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) in ena_probe()
3887 rc = ena_com_init_interrupt_moderation(adapter->ena_dev); in ena_probe()
3959 ena_com_delete_debug_area(ena_dev); in ena_probe()
3960 ena_com_rss_destroy(ena_dev); in ena_probe()
3962 ena_com_dev_reset(ena_dev, ENA_REGS_RESET_INIT_ERR); in ena_probe()
3964 ena_com_set_admin_running_state(ena_dev, false); in ena_probe()
3970 ena_com_delete_host_info(ena_dev); in ena_probe()
3971 ena_com_admin_destroy(ena_dev); in ena_probe()
3975 ena_release_bars(ena_dev, pdev); in ena_probe()
3977 vfree(ena_dev); in ena_probe()
3996 struct ena_com_dev *ena_dev; in __ena_shutoff() local
3999 ena_dev = adapter->ena_dev; in __ena_shutoff()
4029 ena_com_rss_destroy(ena_dev); in __ena_shutoff()
4031 ena_com_delete_debug_area(ena_dev); in __ena_shutoff()
4033 ena_com_delete_host_info(ena_dev); in __ena_shutoff()
4035 ena_release_bars(ena_dev, pdev); in __ena_shutoff()
4039 vfree(ena_dev); in __ena_shutoff()