Lines Matching refs:ena_dev

123 	ret = ena_com_set_dev_mtu(adapter->ena_dev, new_mtu);  in ena_change_mtu()
672 ring->ena_dev = adapter->ena_dev; in ena_init_io_rings_common()
682 struct ena_com_dev *ena_dev; in ena_init_io_rings() local
686 ena_dev = adapter->ena_dev; in ena_init_io_rings()
697 txr->tx_max_header_size = ena_dev->tx_max_header_size; in ena_init_io_rings()
698 txr->tx_mem_queue_type = ena_dev->tx_mem_queue_type; in ena_init_io_rings()
701 ena_com_get_nonadaptive_moderation_interval_tx(ena_dev); in ena_init_io_rings()
715 ena_com_get_nonadaptive_moderation_interval_rx(ena_dev); in ena_init_io_rings()
1239 ena_com_destroy_io_queue(adapter->ena_dev, ena_qid); in ena_destroy_all_tx_queues()
1251 ena_com_destroy_io_queue(adapter->ena_dev, ena_qid); in ena_destroy_all_rx_queues()
1823 rx_interval = ena_com_get_adaptive_moderation_enabled(rx_ring->ena_dev) ? in ena_unmask_interrupt()
1825 ena_com_get_nonadaptive_moderation_interval_rx(rx_ring->ena_dev); in ena_unmask_interrupt()
1987 if (ena_com_get_adaptive_moderation_enabled(rx_ring->ena_dev)) in ena_io_poll()
2014 ena_com_admin_q_comp_intr_handler(adapter->ena_dev); in ena_intr_msix_mgmnt()
2018 ena_com_aenq_intr_handler(adapter->ena_dev, data); in ena_intr_msix_mgmnt()
2304 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_rss_configure() local
2308 if (!ena_dev->rss.tbl_log_size) { in ena_rss_configure()
2318 rc = ena_com_indirect_table_set(ena_dev); in ena_rss_configure()
2323 rc = ena_com_set_hash_function(ena_dev); in ena_rss_configure()
2328 rc = ena_com_set_hash_ctrl(ena_dev); in ena_rss_configure()
2360 struct ena_com_dev *ena_dev; in ena_create_io_tx_queue() local
2366 ena_dev = adapter->ena_dev; in ena_create_io_tx_queue()
2376 ctx.mem_queue_type = ena_dev->tx_mem_queue_type; in ena_create_io_tx_queue()
2381 rc = ena_com_create_io_queue(ena_dev, &ctx); in ena_create_io_tx_queue()
2389 rc = ena_com_get_io_handlers(ena_dev, ena_qid, in ena_create_io_tx_queue()
2396 ena_com_destroy_io_queue(ena_dev, ena_qid); in ena_create_io_tx_queue()
2407 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_create_io_tx_queues_in_range() local
2420 ena_com_destroy_io_queue(ena_dev, ENA_IO_TXQ_IDX(i)); in ena_create_io_tx_queues_in_range()
2427 struct ena_com_dev *ena_dev; in ena_create_io_rx_queue() local
2434 ena_dev = adapter->ena_dev; in ena_create_io_rx_queue()
2449 rc = ena_com_create_io_queue(ena_dev, &ctx); in ena_create_io_rx_queue()
2457 rc = ena_com_get_io_handlers(ena_dev, ena_qid, in ena_create_io_rx_queue()
2471 ena_com_destroy_io_queue(ena_dev, ena_qid); in ena_create_io_rx_queue()
2477 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_create_all_io_rx_queues() local
2492 ena_com_destroy_io_queue(ena_dev, ENA_IO_RXQ_IDX(i)); in ena_create_all_io_rx_queues()
2699 rc = ena_com_dev_reset(adapter->ena_dev, adapter->reset_reason); in ena_down()
2704 ena_com_set_admin_running_state(adapter->ena_dev, false); in ena_down()
2810 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_update_queue_count() local
2837 ena_com_rss_destroy(ena_dev); in ena_update_queue_count()
3149 static void ena_config_host_info(struct ena_com_dev *ena_dev, struct pci_dev *pdev) in ena_config_host_info() argument
3156 rc = ena_com_allocate_host_info(ena_dev); in ena_config_host_info()
3162 host_info = ena_dev->host_attr.host_info; in ena_config_host_info()
3185 rc = ena_com_set_host_attributes(ena_dev); in ena_config_host_info()
3198 ena_com_delete_host_info(ena_dev); in ena_config_host_info()
3216 rc = ena_com_allocate_debug_area(adapter->ena_dev, debug_area_size); in ena_config_debug_area()
3223 rc = ena_com_set_host_attributes(adapter->ena_dev); in ena_config_debug_area()
3236 ena_com_delete_debug_area(adapter->ena_dev); in ena_config_debug_area()
3243 rc = ena_com_get_eni_stats(adapter->ena_dev, &adapter->eni_stats); in ena_update_hw_stats()
3361 struct ena_com_dev *ena_dev, in ena_set_queues_placement_policy() argument
3369 if (!(ena_dev->supported_features & llq_feature_mask)) { in ena_set_queues_placement_policy()
3372 ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; in ena_set_queues_placement_policy()
3376 rc = ena_com_config_dev_mode(ena_dev, llq, llq_default_configurations); in ena_set_queues_placement_policy()
3380 ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; in ena_set_queues_placement_policy()
3386 static int ena_map_llq_mem_bar(struct pci_dev *pdev, struct ena_com_dev *ena_dev, in ena_map_llq_mem_bar() argument
3392 if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { in ena_map_llq_mem_bar()
3395 ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; in ena_map_llq_mem_bar()
3401 ena_dev->mem_bar = devm_ioremap_wc(&pdev->dev, in ena_map_llq_mem_bar()
3405 if (!ena_dev->mem_bar) in ena_map_llq_mem_bar()
3411 static int ena_device_init(struct ena_com_dev *ena_dev, struct pci_dev *pdev, in ena_device_init() argument
3422 rc = ena_com_mmio_reg_read_request_init(ena_dev); in ena_device_init()
3432 ena_com_set_mmio_read_mode(ena_dev, readless_supported); in ena_device_init()
3434 rc = ena_com_dev_reset(ena_dev, ENA_REGS_RESET_NORMAL); in ena_device_init()
3440 rc = ena_com_validate_version(ena_dev); in ena_device_init()
3446 dma_width = ena_com_get_dma_width(ena_dev); in ena_device_init()
3460 rc = ena_com_admin_init(ena_dev, &aenq_handlers); in ena_device_init()
3471 ena_com_set_admin_polling_mode(ena_dev, true); in ena_device_init()
3473 ena_config_host_info(ena_dev, pdev); in ena_device_init()
3476 rc = ena_com_get_dev_attr_feat(ena_dev, get_feat_ctx); in ena_device_init()
3491 rc = ena_com_set_aenq_config(ena_dev, aenq_groups); in ena_device_init()
3501 rc = ena_set_queues_placement_policy(pdev, ena_dev, &get_feat_ctx->llq, in ena_device_init()
3511 ena_com_delete_host_info(ena_dev); in ena_device_init()
3512 ena_com_admin_destroy(ena_dev); in ena_device_init()
3514 ena_com_mmio_reg_read_request_destroy(ena_dev); in ena_device_init()
3521 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_enable_msix_and_set_admin_interrupts() local
3539 ena_com_set_admin_polling_mode(ena_dev, false); in ena_enable_msix_and_set_admin_interrupts()
3541 ena_com_admin_aenq_enable(ena_dev); in ena_enable_msix_and_set_admin_interrupts()
3554 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_destroy_device() local
3567 ena_com_set_admin_running_state(ena_dev, false); in ena_destroy_device()
3576 ena_com_dev_reset(adapter->ena_dev, adapter->reset_reason); in ena_destroy_device()
3582 ena_com_abort_admin_commands(ena_dev); in ena_destroy_device()
3584 ena_com_wait_for_abort_completion(ena_dev); in ena_destroy_device()
3586 ena_com_admin_destroy(ena_dev); in ena_destroy_device()
3588 ena_com_mmio_reg_read_request_destroy(ena_dev); in ena_destroy_device()
3600 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_restore_device() local
3606 rc = ena_device_init(ena_dev, adapter->pdev, &get_feat_ctx, &wd_state); in ena_restore_device()
3647 ena_com_abort_admin_commands(ena_dev); in ena_restore_device()
3648 ena_com_wait_for_abort_completion(ena_dev); in ena_restore_device()
3649 ena_com_admin_destroy(ena_dev); in ena_restore_device()
3650 ena_com_dev_reset(ena_dev, ENA_REGS_RESET_DRIVER_INVALID_STATE); in ena_restore_device()
3651 ena_com_mmio_reg_read_request_destroy(ena_dev); in ena_restore_device()
3886 if (unlikely(!ena_com_get_admin_running_state(adapter->ena_dev))) { in check_for_admin_com_state()
3901 adapter->ena_dev->admin_queue.completion_timeout = in ena_update_hints()
3906 adapter->ena_dev->mmio_read.reg_read_to = in ena_update_hints()
3945 u8 *debug_area = adapter->ena_dev->host_attr.debug_area_virt_addr; in ena_timer_service()
3947 adapter->ena_dev->host_attr.host_info; in ena_timer_service()
3976 struct ena_com_dev *ena_dev, in ena_calc_max_io_queue_num() argument
3981 if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { in ena_calc_max_io_queue_num()
3998 if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) in ena_calc_max_io_queue_num()
4076 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_rss_init_default() local
4081 rc = ena_com_rss_init(ena_dev, ENA_RX_RSS_TABLE_LOG_SIZE); in ena_rss_init_default()
4089 rc = ena_com_indirect_table_fill_entry(ena_dev, i, in ena_rss_init_default()
4097 rc = ena_com_fill_hash_function(ena_dev, ENA_ADMIN_TOEPLITZ, NULL, in ena_rss_init_default()
4104 rc = ena_com_set_default_hash_ctrl(ena_dev); in ena_rss_init_default()
4113 ena_com_rss_destroy(ena_dev); in ena_rss_init_default()
4119 static void ena_release_bars(struct ena_com_dev *ena_dev, struct pci_dev *pdev) in ena_release_bars() argument
4131 struct ena_com_dev *ena_dev = adapter->ena_dev; in ena_calc_io_queue_size() local
4137 if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { in ena_calc_io_queue_size()
4144 if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) in ena_calc_io_queue_size()
4162 if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) in ena_calc_io_queue_size()
4205 struct ena_com_dev *ena_dev = NULL; in ena_probe() local
4229 ena_dev = vzalloc(sizeof(*ena_dev)); in ena_probe()
4230 if (!ena_dev) { in ena_probe()
4243 ena_dev->reg_bar = devm_ioremap(&pdev->dev, in ena_probe()
4246 if (!ena_dev->reg_bar) { in ena_probe()
4252 ena_dev->ena_min_poll_delay_us = ENA_ADMIN_POLL_DELAY_US; in ena_probe()
4254 ena_dev->dmadev = &pdev->dev; in ena_probe()
4265 adapter->ena_dev = ena_dev; in ena_probe()
4270 ena_dev->net_device = netdev; in ena_probe()
4274 rc = ena_device_init(ena_dev, pdev, &get_feat_ctx, &wd_state); in ena_probe()
4282 rc = ena_map_llq_mem_bar(pdev, ena_dev, bars); in ena_probe()
4291 ena_dev->intr_moder_tx_interval = ENA_INTR_INITIAL_TX_INTERVAL_USECS; in ena_probe()
4292 ena_dev->intr_moder_rx_interval = ENA_INTR_INITIAL_RX_INTERVAL_USECS; in ena_probe()
4293 ena_dev->intr_delay_resolution = ENA_DEFAULT_INTR_DELAY_RESOLUTION; in ena_probe()
4294 max_num_io_queues = ena_calc_max_io_queue_num(pdev, ena_dev, &get_feat_ctx); in ena_probe()
4313 if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) in ena_probe()
4322 rc = ena_com_init_interrupt_moderation(adapter->ena_dev); in ena_probe()
4389 ena_com_delete_debug_area(ena_dev); in ena_probe()
4390 ena_com_rss_destroy(ena_dev); in ena_probe()
4392 ena_com_dev_reset(ena_dev, ENA_REGS_RESET_INIT_ERR); in ena_probe()
4394 ena_com_set_admin_running_state(ena_dev, false); in ena_probe()
4400 ena_com_delete_host_info(ena_dev); in ena_probe()
4401 ena_com_admin_destroy(ena_dev); in ena_probe()
4405 ena_release_bars(ena_dev, pdev); in ena_probe()
4407 vfree(ena_dev); in ena_probe()
4426 struct ena_com_dev *ena_dev; in __ena_shutoff() local
4429 ena_dev = adapter->ena_dev; in __ena_shutoff()
4458 ena_com_rss_destroy(ena_dev); in __ena_shutoff()
4460 ena_com_delete_debug_area(ena_dev); in __ena_shutoff()
4462 ena_com_delete_host_info(ena_dev); in __ena_shutoff()
4464 ena_release_bars(ena_dev, pdev); in __ena_shutoff()
4468 vfree(ena_dev); in __ena_shutoff()