Lines Matching +full:layer +full:- +full:depth
1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
3 * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All rights reserved.
11 #include <linux/dma-mapping.h>
41 #define ADMIN_SQ_SIZE(depth) ((depth) * sizeof(struct ena_admin_aq_entry)) argument
42 #define ADMIN_CQ_SIZE(depth) ((depth) * sizeof(struct ena_admin_acq_entry)) argument
43 #define ADMIN_AENQ_SIZE(depth) ((depth) * sizeof(struct ena_admin_aenq_entry)) argument
274 /* PHC shared memory - virtual address */
300 /* PHC shared memory - physical address */
424 /* ena_com_mmio_reg_read_request_init - Init the mmio reg read mechanism
425 * @ena_dev: ENA communication layer struct
431 * @return - 0 on success, negative value on failure.
435 /* ena_com_phc_init - Allocate and initialize PHC feature
436 * @ena_dev: ENA communication layer struct
438 * @return - 0 on success, negative value on failure
442 /* ena_com_phc_supported - Return if PHC feature is supported by the device
443 * @ena_dev: ENA communication layer struct
445 * @return - supported or not
449 /* ena_com_phc_config - Configure PHC feature
450 * @ena_dev: ENA communication layer struct
453 * @return - 0 on success, negative value on failure
457 /* ena_com_phc_destroy - Destroy PHC feature
458 * @ena_dev: ENA communication layer struct
462 /* ena_com_phc_get_timestamp - Retrieve PHC timestamp
463 * @ena_dev: ENA communication layer struct
465 * @return - 0 on success, negative value on failure
469 /* ena_com_set_mmio_read_mode - Enable/disable the indirect mmio reg read mechanism
470 * @ena_dev: ENA communication layer struct
476 /* ena_com_mmio_reg_read_request_write_dev_addr - Write the mmio reg read return
478 * @ena_dev: ENA communication layer struct
482 /* ena_com_mmio_reg_read_request_destroy - Destroy the mmio reg read mechanism
483 * @ena_dev: ENA communication layer struct
487 /* ena_com_admin_init - Init the admin and the async queues
488 * @ena_dev: ENA communication layer struct
494 * @return - 0 on success, negative value on failure.
499 /* ena_com_admin_destroy - Destroy the admin and the async events queues.
500 * @ena_dev: ENA communication layer struct
508 /* ena_com_dev_reset - Perform device FLR to the device.
509 * @ena_dev: ENA communication layer struct
512 * @return - 0 on success, negative value on failure.
517 /* ena_com_create_io_queue - Create io queue.
518 * @ena_dev: ENA communication layer struct
519 * @ctx - create context structure
523 * @return - 0 on success, negative value on failure.
528 /* ena_com_destroy_io_queue - Destroy IO queue with the queue id - qid.
529 * @ena_dev: ENA communication layer struct
530 * @qid - the caller virtual queue id.
534 /* ena_com_get_io_handlers - Return the io queue handlers
535 * @ena_dev: ENA communication layer struct
536 * @qid - the caller virtual queue id.
537 * @io_sq - IO submission queue handler
538 * @io_cq - IO completion queue handler.
540 * @return - 0 on success, negative value on failure.
546 /* ena_com_admin_aenq_enable - ENAble asynchronous event notifications
547 * @ena_dev: ENA communication layer struct
553 /* ena_com_set_admin_running_state - Set the state of the admin queue
554 * @ena_dev: ENA communication layer struct
560 /* ena_com_get_admin_running_state - Get the admin queue state
561 * @ena_dev: ENA communication layer struct
565 * @return - current polling mode (enable/disable)
569 /* ena_com_set_admin_polling_mode - Set the admin completion queue polling mode
570 * @ena_dev: ENA communication layer struct
577 /* ena_com_admin_q_comp_intr_handler - admin queue interrupt handler
578 * @ena_dev: ENA communication layer struct
583 * @note: Should be called after MSI-X interrupt.
587 /* ena_com_aenq_intr_handler - AENQ interrupt handler
588 * @ena_dev: ENA communication layer struct
595 /* ena_com_abort_admin_commands - Abort all the outstanding admin commands.
596 * @ena_dev: ENA communication layer struct
604 /* ena_com_wait_for_abort_completion - Wait for admin commands abort.
605 * @ena_dev: ENA communication layer struct
611 /* ena_com_validate_version - Validate the device parameters
612 * @ena_dev: ENA communication layer struct
619 * @return - 0 on success negative value otherwise.
623 /* ena_com_get_link_params - Retrieve physical link parameters.
624 * @ena_dev: ENA communication layer struct
628 * like speed, auto-negotiation and full duplex support.
630 * @return - 0 on Success negative value otherwise.
635 /* ena_com_get_dma_width - Retrieve physical dma address width the device
637 * @ena_dev: ENA communication layer struct
645 /* ena_com_set_aenq_config - Set aenq groups configurations
646 * @ena_dev: ENA communication layer struct
655 /* ena_com_get_dev_attr_feat - Get device features
656 * @ena_dev: ENA communication layer struct
664 /* ena_com_get_eni_stats - Get extended network interface statistics
665 * @ena_dev: ENA communication layer struct
673 /* ena_com_get_ena_srd_info - Get ENA SRD network interface statistics
674 * @ena_dev: ENA communication layer struct
682 /* ena_com_get_customer_metrics - Get customer metrics for network interface
683 * @ena_dev: ENA communication layer struct
691 /* ena_com_set_dev_mtu - Configure the device mtu.
692 * @ena_dev: ENA communication layer struct
699 /* ena_com_rss_init - Init RSS
700 * @ena_dev: ENA communication layer struct
711 /* ena_com_rss_destroy - Destroy rss
712 * @ena_dev: ENA communication layer struct
718 /* ena_com_get_current_hash_function - Get RSS hash function
719 * @ena_dev: ENA communication layer struct
726 /* ena_com_fill_hash_function - Fill RSS hash function
727 * @ena_dev: ENA communication layer struct
744 /* ena_com_set_hash_function - Flush the hash function and it dependencies to
746 * @ena_dev: ENA communication layer struct
757 /* ena_com_get_hash_function - Retrieve the hash function from the device.
758 * @ena_dev: ENA communication layer struct
771 /* ena_com_get_hash_key - Retrieve the hash key
772 * @ena_dev: ENA communication layer struct
783 /* ena_com_fill_hash_ctrl - Fill RSS hash control
784 * @ena_dev: ENA communication layer struct.
799 /* ena_com_set_hash_ctrl - Flush the hash control resources to the device.
800 * @ena_dev: ENA communication layer struct
810 /* ena_com_get_hash_ctrl - Retrieve the hash control from the device.
811 * @ena_dev: ENA communication layer struct
826 /* ena_com_set_default_hash_ctrl - Set the hash control to a default
828 * @ena_dev: ENA communication layer struct
838 /* ena_com_indirect_table_fill_entry - Fill a single entry in the RSS
840 * @ena_dev: ENA communication layer struct.
841 * @entry_idx - indirection table entry.
842 * @entry_value - redirection value
853 /* ena_com_indirect_table_set - Flush the indirection table to the device.
854 * @ena_dev: ENA communication layer struct
863 /* ena_com_indirect_table_get - Retrieve the indirection table from the device.
864 * @ena_dev: ENA communication layer struct
876 /* ena_com_allocate_host_info - Allocate host info resources.
877 * @ena_dev: ENA communication layer struct
883 /* ena_com_allocate_debug_area - Allocate debug area.
884 * @ena_dev: ENA communication layer struct
885 * @debug_area_size - debug area size.
892 /* ena_com_allocate_customer_metrics_buffer - Allocate customer metrics resources.
893 * @ena_dev: ENA communication layer struct
899 /* ena_com_delete_debug_area - Free the debug area resources.
900 * @ena_dev: ENA communication layer struct
906 /* ena_com_delete_host_info - Free the host info resources.
907 * @ena_dev: ENA communication layer struct
913 /* ena_com_delete_customer_metrics_buffer - Free the customer metrics resources.
914 * @ena_dev: ENA communication layer struct
920 /* ena_com_set_host_attributes - Update the device with the host
922 * @ena_dev: ENA communication layer struct
928 /* ena_com_create_io_cq - Create io completion queue.
929 * @ena_dev: ENA communication layer struct
930 * @io_cq - io completion queue handler
934 * @return - 0 on success, negative value on failure.
939 /* ena_com_destroy_io_cq - Destroy io completion queue.
940 * @ena_dev: ENA communication layer struct
941 * @io_cq - io completion queue handler
945 * @return - 0 on success, negative value on failure.
950 /* ena_com_execute_admin_command - Execute admin command
961 * @return - 0 on success, negative value on failure.
969 /* ena_com_init_interrupt_moderation - Init interrupt moderation
970 * @ena_dev: ENA communication layer struct
972 * @return - 0 on success, negative value on failure.
976 /* ena_com_interrupt_moderation_supported - Return if interrupt moderation
979 * @return - supported or not.
983 /* ena_com_update_nonadaptive_moderation_interval_tx - Update the
984 * non-adaptive interval in Tx direction.
985 * @ena_dev: ENA communication layer struct
988 * @return - 0 on success, negative value on failure.
993 /* ena_com_update_nonadaptive_moderation_interval_rx - Update the
994 * non-adaptive interval in Rx direction.
995 * @ena_dev: ENA communication layer struct
998 * @return - 0 on success, negative value on failure.
1003 /* ena_com_get_nonadaptive_moderation_interval_tx - Retrieve the
1004 * non-adaptive interval in Tx direction.
1005 * @ena_dev: ENA communication layer struct
1007 * @return - interval in usec
1011 /* ena_com_get_nonadaptive_moderation_interval_rx - Retrieve the
1012 * non-adaptive interval in Rx direction.
1013 * @ena_dev: ENA communication layer struct
1015 * @return - interval in usec
1019 /* ena_com_config_dev_mode - Configure the placement policy of the device.
1020 * @ena_dev: ENA communication layer struct
1029 /* ena_com_io_sq_to_ena_dev - Extract ena_com_dev using contained field io_sq.
1032 * @return - ena_com_dev struct extracted from io_sq
1036 return container_of(io_sq, struct ena_com_dev, io_sq_queues[io_sq->qid]); in ena_com_io_sq_to_ena_dev()
1039 /* ena_com_io_cq_to_ena_dev - Extract ena_com_dev using contained field io_cq.
1042 * @return - ena_com_dev struct extracted from io_sq
1046 return container_of(io_cq, struct ena_com_dev, io_cq_queues[io_cq->qid]); in ena_com_io_cq_to_ena_dev()
1051 return ena_dev->adaptive_coalescing; in ena_com_get_adaptive_moderation_enabled()
1056 ena_dev->adaptive_coalescing = true; in ena_com_enable_adaptive_moderation()
1061 ena_dev->adaptive_coalescing = false; in ena_com_disable_adaptive_moderation()
1064 /* ena_com_get_cap - query whether device supports a capability.
1065 * @ena_dev: ENA communication layer struct
1068 * @return - true if capability is supported or false otherwise
1073 return !!(ena_dev->capabilities & BIT(cap_id)); in ena_com_get_cap()
1076 /* ena_com_get_customer_metric_support - query whether device supports a given customer metric.
1077 * @ena_dev: ENA communication layer struct
1080 * @return - true if customer metric is supported or false otherwise
1085 return !!(ena_dev->customer_metrics.supported_metrics & BIT(metric_id)); in ena_com_get_customer_metric_support()
1088 /* ena_com_get_customer_metric_count - return the number of supported customer metrics.
1089 * @ena_dev: ENA communication layer struct
1091 * @return - the number of supported customer metrics
1095 return hweight64(ena_dev->customer_metrics.supported_metrics); in ena_com_get_customer_metric_count()
1098 /* ena_com_update_intr_reg - Prepare interrupt register
1111 intr_reg->intr_control = 0; in ena_com_update_intr_reg()
1112 intr_reg->intr_control |= rx_delay_interval & in ena_com_update_intr_reg()
1115 intr_reg->intr_control |= in ena_com_update_intr_reg()
1120 intr_reg->intr_control |= ENA_ETH_IO_INTR_REG_INTR_UNMASK_MASK; in ena_com_update_intr_reg()
1128 size = bounce_buf_ctrl->buffer_size; in ena_com_get_next_bounce_buffer()
1129 buffers_num = bounce_buf_ctrl->buffers_num; in ena_com_get_next_bounce_buffer()
1131 buf = bounce_buf_ctrl->base_buffer + in ena_com_get_next_bounce_buffer()
1132 (bounce_buf_ctrl->next_to_use++ & (buffers_num - 1)) * size; in ena_com_get_next_bounce_buffer()
1134 prefetchw(bounce_buf_ctrl->base_buffer + in ena_com_get_next_bounce_buffer()
1135 (bounce_buf_ctrl->next_to_use & (buffers_num - 1)) * size); in ena_com_get_next_bounce_buffer()