Lines Matching +full:layer +full:- +full:depth

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates.
50 #define ADMIN_SQ_SIZE(depth) ((depth) * sizeof(struct ena_admin_aq_entry))
51 #define ADMIN_CQ_SIZE(depth) ((depth) * sizeof(struct ena_admin_acq_entry))
52 #define ADMIN_AENQ_SIZE(depth) ((depth) * sizeof(struct ena_admin_aenq_entry))
304 /* PHC shared memory - virtual address */
329 /* PHC shared memory - physical address */
469 /* ena_com_mmio_reg_read_request_init - Init the mmio reg read mechanism
470 * @ena_dev: ENA communication layer struct
476 * @return - 0 on success, negative value on failure.
480 /* ena_com_phc_init - Allocate and initialize PHC feature
481 * @ena_dev: ENA communication layer struct
483 * @return - 0 on success, negative value on failure
487 /* ena_com_phc_supported - Return if PHC feature is supported by the device
488 * @ena_dev: ENA communication layer struct
490 * @return - supported or not
494 /* ena_com_phc_config - Configure PHC feature
495 * @ena_dev: ENA communication layer struct
498 * @return - 0 on success, negative value on failure
502 /* ena_com_phc_destroy - Destroy PHC feature
503 * @ena_dev: ENA communication layer struct
507 /* ena_com_phc_get_timestamp - Retrieve PHC timestamp
508 * @ena_dev: ENA communication layer struct
510 * @return - 0 on success, negative value on failure
514 /* ena_com_phc_get_error_bound - Retrieve cached PHC error bound
515 * @ena_dev: ENA communication layer struct
517 * @return - 0 on success, negative value on failure
521 /* ena_com_set_mmio_read_mode - Enable/disable the indirect mmio reg read mechanism
522 * @ena_dev: ENA communication layer struct
528 /* ena_com_mmio_reg_read_request_write_dev_addr - Write the mmio reg read return
530 * @ena_dev: ENA communication layer struct
534 /* ena_com_mmio_reg_read_request_destroy - Destroy the mmio reg read mechanism
535 * @ena_dev: ENA communication layer struct
539 /* ena_com_admin_init - Init the admin and the async queues
540 * @ena_dev: ENA communication layer struct
546 * @return - 0 on success, negative value on failure.
551 /* ena_com_admin_destroy - Destroy the admin and the async events queues.
552 * @ena_dev: ENA communication layer struct
560 /* ena_com_dev_reset - Perform device FLR to the device.
561 * @ena_dev: ENA communication layer struct
564 * @return - 0 on success, negative value on failure.
569 /* ena_com_create_io_queue - Create io queue.
570 * @ena_dev: ENA communication layer struct
571 * @ctx - create context structure
575 * @return - 0 on success, negative value on failure.
580 /* ena_com_destroy_io_queue - Destroy IO queue with the queue id - qid.
581 * @ena_dev: ENA communication layer struct
582 * @qid - the caller virtual queue id.
586 /* ena_com_get_io_handlers - Return the io queue handlers
587 * @ena_dev: ENA communication layer struct
588 * @qid - the caller virtual queue id.
589 * @io_sq - IO submission queue handler
590 * @io_cq - IO completion queue handler.
592 * @return - 0 on success, negative value on failure.
598 /* ena_com_admin_aenq_enable - ENAble asynchronous event notifications
599 * @ena_dev: ENA communication layer struct
605 /* ena_com_set_admin_running_state - Set the state of the admin queue
606 * @ena_dev: ENA communication layer struct
612 /* ena_com_get_admin_running_state - Get the admin queue state
613 * @ena_dev: ENA communication layer struct
617 * @return - current polling mode (enable/disable)
621 /* ena_com_set_admin_polling_mode - Set the admin completion queue polling mode
622 * @ena_dev: ENA communication layer struct
629 /* ena_com_get_admin_polling_mode - Get the admin completion queue polling mode
630 * @ena_dev: ENA communication layer struct
641 /* ena_com_set_admin_auto_polling_mode - Enable autoswitch to polling mode
642 * @ena_dev: ENA communication layer struct
652 /* ena_com_admin_q_comp_intr_handler - admin queue interrupt handler
653 * @ena_dev: ENA communication layer struct
658 * @note: Should be called after MSI-X interrupt.
662 /* ena_com_aenq_intr_handler - AENQ interrupt handler
663 * @ena_dev: ENA communication layer struct
670 /* ena_com_aenq_has_keep_alive - Retrieve if there is a keep alive notification in the aenq
671 * @ena_dev: ENA communication layer struct
676 * @return - true if there is a keep alive notification in the aenq or false otherwise
680 /* ena_com_abort_admin_commands - Abort all the outstanding admin commands.
681 * @ena_dev: ENA communication layer struct
689 /* ena_com_wait_for_abort_completion - Wait for admin commands abort.
690 * @ena_dev: ENA communication layer struct
696 /* ena_com_validate_version - Validate the device parameters
697 * @ena_dev: ENA communication layer struct
704 * @return - 0 on success negative value otherwise.
708 /* ena_com_get_link_params - Retrieve physical link parameters.
709 * @ena_dev: ENA communication layer struct
713 * like speed, auto-negotiation and full duplex support.
715 * @return - 0 on Success negative value otherwise.
720 /* ena_com_get_dma_width - Retrieve physical dma address width the device
722 * @ena_dev: ENA communication layer struct
730 /* ena_com_set_aenq_config - Set aenq groups configurations
731 * @ena_dev: ENA communication layer struct
740 /* ena_com_get_dev_attr_feat - Get device features
741 * @ena_dev: ENA communication layer struct
749 /* ena_com_get_dev_basic_stats - Get device basic statistics
750 * @ena_dev: ENA communication layer struct
758 /* ena_com_get_eni_stats - Get extended network interface statistics
759 * @ena_dev: ENA communication layer struct
767 /* ena_com_get_ena_srd_info - Get ENA SRD network interface statistics
768 * @ena_dev: ENA communication layer struct
776 /* ena_com_get_customer_metrics - Get customer metrics for network interface
777 * @ena_dev: ENA communication layer struct
785 /* ena_com_set_dev_mtu - Configure the device mtu.
786 * @ena_dev: ENA communication layer struct
793 /* ena_com_get_offload_settings - Retrieve the device offloads capabilities
794 * @ena_dev: ENA communication layer struct
802 /* ena_com_rss_init - Init RSS
803 * @ena_dev: ENA communication layer struct
814 /* ena_com_rss_destroy - Destroy rss
815 * @ena_dev: ENA communication layer struct
821 /* ena_com_get_current_hash_function - Get RSS hash function
822 * @ena_dev: ENA communication layer struct
829 /* ena_com_fill_hash_function - Fill RSS hash function
830 * @ena_dev: ENA communication layer struct
847 /* ena_com_set_hash_function - Flush the hash function and it dependencies to
849 * @ena_dev: ENA communication layer struct
860 /* ena_com_get_hash_function - Retrieve the hash function from the device.
861 * @ena_dev: ENA communication layer struct
874 /* ena_com_get_hash_key - Retrieve the hash key
875 * @ena_dev: ENA communication layer struct
886 /* ena_com_fill_hash_ctrl - Fill RSS hash control
887 * @ena_dev: ENA communication layer struct.
902 /* ena_com_set_hash_ctrl - Flush the hash control resources to the device.
903 * @ena_dev: ENA communication layer struct
913 /* ena_com_get_hash_ctrl - Retrieve the hash control from the device.
914 * @ena_dev: ENA communication layer struct
929 /* ena_com_set_default_hash_ctrl - Set the hash control to a default
931 * @ena_dev: ENA communication layer struct
941 /* ena_com_indirect_table_fill_entry - Fill a single entry in the RSS
943 * @ena_dev: ENA communication layer struct.
944 * @entry_idx - indirection table entry.
945 * @entry_value - redirection value
956 /* ena_com_indirect_table_set - Flush the indirection table to the device.
957 * @ena_dev: ENA communication layer struct
966 /* ena_com_indirect_table_get - Retrieve the indirection table from the device.
967 * @ena_dev: ENA communication layer struct
979 /* ena_com_allocate_host_info - Allocate host info resources.
980 * @ena_dev: ENA communication layer struct
986 /* ena_com_allocate_debug_area - Allocate debug area.
987 * @ena_dev: ENA communication layer struct
988 * @debug_area_size - debug area size.
995 /* ena_com_allocate_customer_metrics_buffer - Allocate customer metrics resources.
996 * @ena_dev: ENA communication layer struct
1002 /* ena_com_delete_debug_area - Free the debug area resources.
1003 * @ena_dev: ENA communication layer struct
1009 /* ena_com_delete_host_info - Free the host info resources.
1010 * @ena_dev: ENA communication layer struct
1016 /* ena_com_delete_customer_metrics_buffer - Free the customer metrics resources.
1017 * @ena_dev: ENA communication layer struct
1023 /* ena_com_set_host_attributes - Update the device with the host
1025 * @ena_dev: ENA communication layer struct
1031 /* ena_com_create_io_cq - Create io completion queue.
1032 * @ena_dev: ENA communication layer struct
1033 * @io_cq - io completion queue handler
1037 * @return - 0 on success, negative value on failure.
1042 /* ena_com_destroy_io_cq - Destroy io completion queue.
1043 * @ena_dev: ENA communication layer struct
1044 * @io_cq - io completion queue handler
1048 * @return - 0 on success, negative value on failure.
1053 /* ena_com_execute_admin_command - Execute admin command
1064 * @return - 0 on success, negative value on failure.
1072 /* ena_com_init_interrupt_moderation - Init interrupt moderation
1073 * @ena_dev: ENA communication layer struct
1075 * @return - 0 on success, negative value on failure.
1079 /* ena_com_interrupt_moderation_supported - Return if interrupt moderation
1082 * @return - supported or not.
1086 /* ena_com_update_nonadaptive_moderation_interval_tx - Update the
1087 * non-adaptive interval in Tx direction.
1088 * @ena_dev: ENA communication layer struct
1091 * @return - 0 on success, negative value on failure.
1096 /* ena_com_update_nonadaptive_moderation_interval_rx - Update the
1097 * non-adaptive interval in Rx direction.
1098 * @ena_dev: ENA communication layer struct
1101 * @return - 0 on success, negative value on failure.
1106 /* ena_com_get_nonadaptive_moderation_interval_tx - Retrieve the
1107 * non-adaptive interval in Tx direction.
1108 * @ena_dev: ENA communication layer struct
1110 * @return - interval in usec
1114 /* ena_com_get_nonadaptive_moderation_interval_rx - Retrieve the
1115 * non-adaptive interval in Rx direction.
1116 * @ena_dev: ENA communication layer struct
1118 * @return - interval in usec
1122 /* ena_com_config_dev_mode - Configure the placement policy of the device.
1123 * @ena_dev: ENA communication layer struct
1132 /* ena_com_get_missing_admin_interrupt - Return if there is a missing admin interrupt
1133 * @ena_dev: ENA communication layer struct
1135 * @return - true if there is a missing admin interrupt or false otherwise
1139 return ena_dev->admin_queue.is_missing_admin_interrupt;
1142 /* ena_com_io_sq_to_ena_dev - Extract ena_com_dev using contained field io_sq.
1145 * @return - ena_com_dev struct extracted from io_sq
1149 return container_of(io_sq, struct ena_com_dev, io_sq_queues[io_sq->qid]);
1152 /* ena_com_io_cq_to_ena_dev - Extract ena_com_dev using contained field io_cq.
1155 * @return - ena_com_dev struct extracted from io_sq
1159 return container_of(io_cq, struct ena_com_dev, io_cq_queues[io_cq->qid]);
1164 return ena_dev->adaptive_coalescing;
1169 ena_dev->adaptive_coalescing = true;
1174 ena_dev->adaptive_coalescing = false;
1177 /* ena_com_get_cap - query whether device supports a capability.
1178 * @ena_dev: ENA communication layer struct
1181 * @return - true if capability is supported or false otherwise
1186 return !!(ena_dev->capabilities & BIT(cap_id));
1189 /* ena_com_get_customer_metric_support - query whether device supports a given customer metric.
1190 * @ena_dev: ENA communication layer struct
1193 * @return - true if customer metric is supported or false otherwise
1198 return !!(ena_dev->customer_metrics.supported_metrics & BIT64(metric_id));
1201 /* ena_com_get_customer_metric_count - return the number of supported customer metrics.
1202 * @ena_dev: ENA communication layer struct
1204 * @return - the number of supported customer metrics
1208 return ENA_BITS_PER_U64(ena_dev->customer_metrics.supported_metrics);
1211 /* ena_com_update_intr_reg - Prepare interrupt register
1216 * @no_moderation_update: 0 - Indicates that any of the TX/RX intervals was
1217 * updated, 1 - otherwise
1227 intr_reg->intr_control = 0;
1228 intr_reg->intr_control |= rx_delay_interval &
1231 intr_reg->intr_control |=
1236 intr_reg->intr_control |= ENA_ETH_IO_INTR_REG_INTR_UNMASK_MASK;
1238 intr_reg->intr_control |=
1248 size = bounce_buf_ctrl->buffer_size;
1249 buffers_num = bounce_buf_ctrl->buffers_num;
1251 buf = bounce_buf_ctrl->base_buffer +
1252 (bounce_buf_ctrl->next_to_use++ & (buffers_num - 1)) * size;
1254 prefetchw(bounce_buf_ctrl->base_buffer +
1255 (bounce_buf_ctrl->next_to_use & (buffers_num - 1)) * size);