1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
3 * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All rights reserved.
8 #define ENA_ADMIN_RSS_KEY_PARTS 10
10 enum ena_admin_aq_opcode
{
11 ENA_ADMIN_CREATE_SQ
= 1,
12 ENA_ADMIN_DESTROY_SQ
= 2,
13 ENA_ADMIN_CREATE_CQ
= 3,
14 ENA_ADMIN_DESTROY_CQ
= 4,
15 ENA_ADMIN_GET_FEATURE
= 8,
16 ENA_ADMIN_SET_FEATURE
= 9,
17 ENA_ADMIN_GET_STATS
= 11,
20 enum ena_admin_aq_completion_status
{
21 ENA_ADMIN_SUCCESS
= 0,
22 ENA_ADMIN_RESOURCE_ALLOCATION_FAILURE
= 1,
23 ENA_ADMIN_BAD_OPCODE
= 2,
24 ENA_ADMIN_UNSUPPORTED_OPCODE
= 3,
25 ENA_ADMIN_MALFORMED_REQUEST
= 4,
26 /* Additional status is provided in ACQ entry extended_status */
27 ENA_ADMIN_ILLEGAL_PARAMETER
= 5,
28 ENA_ADMIN_UNKNOWN_ERROR
= 6,
29 ENA_ADMIN_RESOURCE_BUSY
= 7,
32 /* subcommands for the set/get feature admin commands */
33 enum ena_admin_aq_feature_id
{
34 ENA_ADMIN_DEVICE_ATTRIBUTES
= 1,
35 ENA_ADMIN_MAX_QUEUES_NUM
= 2,
36 ENA_ADMIN_HW_HINTS
= 3,
38 ENA_ADMIN_MAX_QUEUES_EXT
= 7,
39 ENA_ADMIN_RSS_HASH_FUNCTION
= 10,
40 ENA_ADMIN_STATELESS_OFFLOAD_CONFIG
= 11,
41 ENA_ADMIN_RSS_INDIRECTION_TABLE_CONFIG
= 12,
43 ENA_ADMIN_RSS_HASH_INPUT
= 18,
44 ENA_ADMIN_INTERRUPT_MODERATION
= 20,
45 ENA_ADMIN_AENQ_CONFIG
= 26,
46 ENA_ADMIN_LINK_CONFIG
= 27,
47 ENA_ADMIN_HOST_ATTR_CONFIG
= 28,
48 ENA_ADMIN_FEATURES_OPCODE_NUM
= 32,
51 enum ena_admin_placement_policy_type
{
52 /* descriptors and headers are in host memory */
53 ENA_ADMIN_PLACEMENT_POLICY_HOST
= 1,
54 /* descriptors and headers are in device memory (a.k.a Low Latency
57 ENA_ADMIN_PLACEMENT_POLICY_DEV
= 3,
60 enum ena_admin_link_types
{
61 ENA_ADMIN_LINK_SPEED_1G
= 0x1,
62 ENA_ADMIN_LINK_SPEED_2_HALF_G
= 0x2,
63 ENA_ADMIN_LINK_SPEED_5G
= 0x4,
64 ENA_ADMIN_LINK_SPEED_10G
= 0x8,
65 ENA_ADMIN_LINK_SPEED_25G
= 0x10,
66 ENA_ADMIN_LINK_SPEED_40G
= 0x20,
67 ENA_ADMIN_LINK_SPEED_50G
= 0x40,
68 ENA_ADMIN_LINK_SPEED_100G
= 0x80,
69 ENA_ADMIN_LINK_SPEED_200G
= 0x100,
70 ENA_ADMIN_LINK_SPEED_400G
= 0x200,
73 enum ena_admin_completion_policy_type
{
74 /* completion queue entry for each sq descriptor */
75 ENA_ADMIN_COMPLETION_POLICY_DESC
= 0,
76 /* completion queue entry upon request in sq descriptor */
77 ENA_ADMIN_COMPLETION_POLICY_DESC_ON_DEMAND
= 1,
78 /* current queue head pointer is updated in OS memory upon sq
81 ENA_ADMIN_COMPLETION_POLICY_HEAD_ON_DEMAND
= 2,
82 /* current queue head pointer is updated in OS memory for each sq
85 ENA_ADMIN_COMPLETION_POLICY_HEAD
= 3,
88 /* basic stats return ena_admin_basic_stats while extanded stats return a
89 * buffer (string format) with additional statistics per queue and per
92 enum ena_admin_get_stats_type
{
93 ENA_ADMIN_GET_STATS_TYPE_BASIC
= 0,
94 ENA_ADMIN_GET_STATS_TYPE_EXTENDED
= 1,
95 /* extra HW stats for specific network interface */
96 ENA_ADMIN_GET_STATS_TYPE_ENI
= 2,
99 enum ena_admin_get_stats_scope
{
100 ENA_ADMIN_SPECIFIC_QUEUE
= 0,
101 ENA_ADMIN_ETH_TRAFFIC
= 1,
104 struct ena_admin_aq_common_desc
{
110 /* as appears in ena_admin_aq_opcode */
114 * 1 : ctrl_data - control buffer address valid
115 * 2 : ctrl_data_indirect - control buffer address
116 * points to list of pages with addresses of control
123 /* used in ena_admin_aq_entry. Can point directly to control data, or to a
124 * page list chunk. Used also at the end of indirect mode page list chunks,
127 struct ena_admin_ctrl_buff_info
{
130 struct ena_common_mem_addr address
;
133 struct ena_admin_sq
{
137 * 7:5 : sq_direction - 0x1 - Tx; 0x2 - Rx
144 struct ena_admin_aq_entry
{
145 struct ena_admin_aq_common_desc aq_common_descriptor
;
148 u32 inline_data_w1
[3];
150 struct ena_admin_ctrl_buff_info control_buffer
;
153 u32 inline_data_w4
[12];
156 struct ena_admin_acq_common_desc
{
157 /* command identifier to associate it with the aq descriptor
172 /* indicates to the driver which AQ entry has been consumed by the
173 * device and could be reused
178 struct ena_admin_acq_entry
{
179 struct ena_admin_acq_common_desc acq_common_descriptor
;
181 u32 response_specific_data
[14];
184 struct ena_admin_aq_create_sq_cmd
{
185 struct ena_admin_aq_common_desc aq_common_descriptor
;
187 /* 4:0 : reserved0_w1
188 * 7:5 : sq_direction - 0x1 - Tx, 0x2 - Rx
194 /* 3:0 : placement_policy - Describing where the SQ
195 * descriptor ring and the SQ packet headers reside:
196 * 0x1 - descriptors and headers are in OS memory,
197 * 0x3 - descriptors and headers in device memory
198 * (a.k.a Low Latency Queue)
199 * 6:4 : completion_policy - Describing what policy
200 * to use for generation completion entry (cqe) in
201 * the CQ associated with this SQ: 0x0 - cqe for each
202 * sq descriptor, 0x1 - cqe upon request in sq
203 * descriptor, 0x2 - current queue head pointer is
204 * updated in OS memory upon sq descriptor request
205 * 0x3 - current queue head pointer is updated in OS
206 * memory for each sq descriptor
211 /* 0 : is_physically_contiguous - Described if the
212 * queue ring memory is allocated in physical
213 * contiguous pages or split.
214 * 7:1 : reserved17_w1
218 /* associated completion queue id. This CQ must be created prior to SQ
223 /* submission queue depth in entries */
226 /* SQ physical base address in OS memory. This field should not be
227 * used for Low Latency queues. Has to be page aligned.
229 struct ena_common_mem_addr sq_ba
;
231 /* specifies queue head writeback location in OS memory. Valid if
232 * completion_policy is set to completion_policy_head_on_demand or
233 * completion_policy_head. Has to be cache aligned
235 struct ena_common_mem_addr sq_head_writeback
;
242 enum ena_admin_sq_direction
{
243 ENA_ADMIN_SQ_DIRECTION_TX
= 1,
244 ENA_ADMIN_SQ_DIRECTION_RX
= 2,
247 struct ena_admin_acq_create_sq_resp_desc
{
248 struct ena_admin_acq_common_desc acq_common_desc
;
254 /* queue doorbell address as an offset to PCIe MMIO REG BAR */
255 u32 sq_doorbell_offset
;
257 /* low latency queue ring base address as an offset to PCIe MMIO
260 u32 llq_descriptors_offset
;
262 /* low latency queue headers' memory as an offset to PCIe MMIO
265 u32 llq_headers_offset
;
268 struct ena_admin_aq_destroy_sq_cmd
{
269 struct ena_admin_aq_common_desc aq_common_descriptor
;
271 struct ena_admin_sq sq
;
274 struct ena_admin_acq_destroy_sq_resp_desc
{
275 struct ena_admin_acq_common_desc acq_common_desc
;
278 struct ena_admin_aq_create_cq_cmd
{
279 struct ena_admin_aq_common_desc aq_common_descriptor
;
282 * 5 : interrupt_mode_enabled - if set, cq operates
283 * in interrupt mode, otherwise - polling
288 /* 4:0 : cq_entry_size_words - size of CQ entry in
289 * 32-bit words, valid values: 4, 8.
294 /* completion queue depth in # of entries. must be power of 2 */
297 /* msix vector assigned to this cq */
300 /* cq physical base address in OS memory. CQ must be physically
303 struct ena_common_mem_addr cq_ba
;
306 struct ena_admin_acq_create_cq_resp_desc
{
307 struct ena_admin_acq_common_desc acq_common_desc
;
311 /* actual cq depth in number of entries */
314 u32 numa_node_register_offset
;
316 u32 cq_head_db_register_offset
;
318 u32 cq_interrupt_unmask_register_offset
;
321 struct ena_admin_aq_destroy_cq_cmd
{
322 struct ena_admin_aq_common_desc aq_common_descriptor
;
329 struct ena_admin_acq_destroy_cq_resp_desc
{
330 struct ena_admin_acq_common_desc acq_common_desc
;
333 /* ENA AQ Get Statistics command. Extended statistics are placed in control
334 * buffer pointed by AQ entry
336 struct ena_admin_aq_get_stats_cmd
{
337 struct ena_admin_aq_common_desc aq_common_descriptor
;
340 /* command specific inline data */
341 u32 inline_data_w1
[3];
343 struct ena_admin_ctrl_buff_info control_buffer
;
346 /* stats type as defined in enum ena_admin_get_stats_type */
349 /* stats scope defined in enum ena_admin_get_stats_scope */
354 /* queue id. used when scope is specific_queue */
357 /* device id, value 0xFFFF means mine. only privileged device can get
358 * stats of other device
363 /* Basic Statistics Command. */
364 struct ena_admin_basic_stats
{
390 /* ENI Statistics Command. */
391 struct ena_admin_eni_stats
{
392 /* The number of packets shaped due to inbound aggregate BW
393 * allowance being exceeded
395 u64 bw_in_allowance_exceeded
;
397 /* The number of packets shaped due to outbound aggregate BW
398 * allowance being exceeded
400 u64 bw_out_allowance_exceeded
;
402 /* The number of packets shaped due to PPS allowance being exceeded */
403 u64 pps_allowance_exceeded
;
405 /* The number of packets shaped due to connection tracking
406 * allowance being exceeded and leading to failure in establishment
409 u64 conntrack_allowance_exceeded
;
411 /* The number of packets shaped due to linklocal packet rate
412 * allowance being exceeded
414 u64 linklocal_allowance_exceeded
;
417 struct ena_admin_acq_get_stats_resp
{
418 struct ena_admin_acq_common_desc acq_common_desc
;
423 struct ena_admin_basic_stats basic_stats
;
425 struct ena_admin_eni_stats eni_stats
;
429 struct ena_admin_get_set_feature_common_desc
{
430 /* 1:0 : select - 0x1 - current value; 0x3 - default
436 /* as appears in ena_admin_aq_feature_id */
439 /* The driver specifies the max feature version it supports and the
440 * device responds with the currently supported feature version. The
441 * field is zero based
448 struct ena_admin_device_attr_feature_desc
{
453 /* bitmap of ena_admin_aq_feature_id, which represents supported
454 * subcommands for the set/get feature admin commands.
456 u32 supported_features
;
460 /* Indicates how many bits are used physical address access. */
463 /* Indicates how many bits are used virtual address access. */
466 /* unicast MAC address (in Network byte order) */
474 enum ena_admin_llq_header_location
{
475 /* header is in descriptor list */
476 ENA_ADMIN_INLINE_HEADER
= 1,
477 /* header in a separate ring, implies 16B descriptor list entry */
478 ENA_ADMIN_HEADER_RING
= 2,
481 enum ena_admin_llq_ring_entry_size
{
482 ENA_ADMIN_LIST_ENTRY_SIZE_128B
= 1,
483 ENA_ADMIN_LIST_ENTRY_SIZE_192B
= 2,
484 ENA_ADMIN_LIST_ENTRY_SIZE_256B
= 4,
487 enum ena_admin_llq_num_descs_before_header
{
488 ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_0
= 0,
489 ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_1
= 1,
490 ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_2
= 2,
491 ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_4
= 4,
492 ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_8
= 8,
495 /* packet descriptor list entry always starts with one or more descriptors,
496 * followed by a header. The rest of the descriptors are located in the
497 * beginning of the subsequent entry. Stride refers to how the rest of the
498 * descriptors are placed. This field is relevant only for inline header
501 enum ena_admin_llq_stride_ctrl
{
502 ENA_ADMIN_SINGLE_DESC_PER_ENTRY
= 1,
503 ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY
= 2,
506 enum ena_admin_accel_mode_feat
{
507 ENA_ADMIN_DISABLE_META_CACHING
= 0,
508 ENA_ADMIN_LIMIT_TX_BURST
= 1,
511 struct ena_admin_accel_mode_get
{
512 /* bit field of enum ena_admin_accel_mode_feat */
515 /* maximum burst size between two doorbells. The size is in bytes */
516 u16 max_tx_burst_size
;
519 struct ena_admin_accel_mode_set
{
520 /* bit field of enum ena_admin_accel_mode_feat */
526 struct ena_admin_accel_mode_req
{
530 struct ena_admin_accel_mode_get get
;
532 struct ena_admin_accel_mode_set set
;
536 struct ena_admin_feature_llq_desc
{
541 /* specify the header locations the device supports. bitfield of enum
542 * ena_admin_llq_header_location.
544 u16 header_location_ctrl_supported
;
546 /* the header location the driver selected to use. */
547 u16 header_location_ctrl_enabled
;
549 /* if inline header is specified - this is the size of descriptor list
550 * entry. If header in a separate ring is specified - this is the size
551 * of header ring entry. bitfield of enum ena_admin_llq_ring_entry_size.
552 * specify the entry sizes the device supports
554 u16 entry_size_ctrl_supported
;
556 /* the entry size the driver selected to use. */
557 u16 entry_size_ctrl_enabled
;
559 /* valid only if inline header is specified. First entry associated with
560 * the packet includes descriptors and header. Rest of the entries
561 * occupied by descriptors. This parameter defines the max number of
562 * descriptors precedding the header in the first entry. The field is
563 * bitfield of enum ena_admin_llq_num_descs_before_header and specify
564 * the values the device supports
566 u16 desc_num_before_header_supported
;
568 /* the desire field the driver selected to use */
569 u16 desc_num_before_header_enabled
;
571 /* valid only if inline was chosen. bitfield of enum
572 * ena_admin_llq_stride_ctrl
574 u16 descriptors_stride_ctrl_supported
;
576 /* the stride control the driver selected to use */
577 u16 descriptors_stride_ctrl_enabled
;
582 /* accelerated low latency queues requirement. driver needs to
583 * support those requirements in order to use accelerated llq
585 struct ena_admin_accel_mode_req accel_mode
;
588 struct ena_admin_queue_ext_feature_fields
{
605 u32 max_tx_header_size
;
607 /* Maximum Descriptors number, including meta descriptor, allowed for a
610 u16 max_per_packet_tx_descs
;
612 /* Maximum Descriptors number allowed for a single Rx packet */
613 u16 max_per_packet_rx_descs
;
616 struct ena_admin_queue_feature_desc
{
625 u32 max_legacy_llq_num
;
627 u32 max_legacy_llq_depth
;
631 /* Maximum Descriptors number, including meta descriptor, allowed for a
634 u16 max_packet_tx_descs
;
636 /* Maximum Descriptors number allowed for a single Rx packet */
637 u16 max_packet_rx_descs
;
640 struct ena_admin_set_feature_mtu_desc
{
645 struct ena_admin_set_feature_host_attr_desc
{
646 /* host OS info base address in OS memory. host info is 4KB of
647 * physically contiguous
649 struct ena_common_mem_addr os_info_ba
;
651 /* host debug area base address in OS memory. debug area must be
652 * physically contiguous
654 struct ena_common_mem_addr debug_ba
;
656 /* debug area size */
660 struct ena_admin_feature_intr_moder_desc
{
661 /* interrupt delay granularity in usec */
662 u16 intr_delay_resolution
;
667 struct ena_admin_get_feature_link_desc
{
668 /* Link speed in Mb */
671 /* bit field of enum ena_admin_link types */
675 * 1 : duplex - Full Duplex
681 struct ena_admin_feature_aenq_desc
{
682 /* bitmask for AENQ groups the device can report */
683 u32 supported_groups
;
685 /* bitmask for AENQ groups to report */
689 struct ena_admin_feature_offload_desc
{
690 /* 0 : TX_L3_csum_ipv4
691 * 1 : TX_L4_ipv4_csum_part - The checksum field
692 * should be initialized with pseudo header checksum
693 * 2 : TX_L4_ipv4_csum_full
694 * 3 : TX_L4_ipv6_csum_part - The checksum field
695 * should be initialized with pseudo header checksum
696 * 4 : TX_L4_ipv6_csum_full
703 /* Receive side supported stateless offload
704 * 0 : RX_L3_csum_ipv4 - IPv4 checksum
705 * 1 : RX_L4_ipv4_csum - TCP/UDP/IPv4 checksum
706 * 2 : RX_L4_ipv6_csum - TCP/UDP/IPv6 checksum
707 * 3 : RX_hash - Hash calculation
714 enum ena_admin_hash_functions
{
715 ENA_ADMIN_TOEPLITZ
= 1,
719 struct ena_admin_feature_rss_flow_hash_control
{
724 u32 key
[ENA_ADMIN_RSS_KEY_PARTS
];
727 struct ena_admin_feature_rss_flow_hash_function
{
728 /* 7:0 : funcs - bitmask of ena_admin_hash_functions */
731 /* 7:0 : selected_func - bitmask of
732 * ena_admin_hash_functions
740 /* RSS flow hash protocols */
741 enum ena_admin_flow_hash_proto
{
742 ENA_ADMIN_RSS_TCP4
= 0,
743 ENA_ADMIN_RSS_UDP4
= 1,
744 ENA_ADMIN_RSS_TCP6
= 2,
745 ENA_ADMIN_RSS_UDP6
= 3,
746 ENA_ADMIN_RSS_IP4
= 4,
747 ENA_ADMIN_RSS_IP6
= 5,
748 ENA_ADMIN_RSS_IP4_FRAG
= 6,
749 ENA_ADMIN_RSS_NOT_IP
= 7,
750 /* TCPv6 with extension header */
751 ENA_ADMIN_RSS_TCP6_EX
= 8,
752 /* IPv6 with extension header */
753 ENA_ADMIN_RSS_IP6_EX
= 9,
754 ENA_ADMIN_RSS_PROTO_NUM
= 16,
757 /* RSS flow hash fields */
758 enum ena_admin_flow_hash_fields
{
759 /* Ethernet Dest Addr */
760 ENA_ADMIN_RSS_L2_DA
= BIT(0),
761 /* Ethernet Src Addr */
762 ENA_ADMIN_RSS_L2_SA
= BIT(1),
763 /* ipv4/6 Dest Addr */
764 ENA_ADMIN_RSS_L3_DA
= BIT(2),
765 /* ipv4/6 Src Addr */
766 ENA_ADMIN_RSS_L3_SA
= BIT(3),
767 /* tcp/udp Dest Port */
768 ENA_ADMIN_RSS_L4_DP
= BIT(4),
769 /* tcp/udp Src Port */
770 ENA_ADMIN_RSS_L4_SP
= BIT(5),
773 struct ena_admin_proto_input
{
774 /* flow hash fields (bitwise according to ena_admin_flow_hash_fields) */
780 struct ena_admin_feature_rss_hash_control
{
781 struct ena_admin_proto_input supported_fields
[ENA_ADMIN_RSS_PROTO_NUM
];
783 struct ena_admin_proto_input selected_fields
[ENA_ADMIN_RSS_PROTO_NUM
];
785 struct ena_admin_proto_input reserved2
[ENA_ADMIN_RSS_PROTO_NUM
];
787 struct ena_admin_proto_input reserved3
[ENA_ADMIN_RSS_PROTO_NUM
];
790 struct ena_admin_feature_rss_flow_hash_input
{
791 /* supported hash input sorting
792 * 1 : L3_sort - support swap L3 addresses if DA is
794 * 2 : L4_sort - support swap L4 ports if DP smaller
797 u16 supported_input_sort
;
799 /* enabled hash input sorting
800 * 1 : enable_L3_sort - enable swap L3 addresses if
802 * 2 : enable_L4_sort - enable swap L4 ports if DP
805 u16 enabled_input_sort
;
808 enum ena_admin_os_type
{
809 ENA_ADMIN_OS_LINUX
= 1,
810 ENA_ADMIN_OS_WIN
= 2,
811 ENA_ADMIN_OS_DPDK
= 3,
812 ENA_ADMIN_OS_FREEBSD
= 4,
813 ENA_ADMIN_OS_IPXE
= 5,
814 ENA_ADMIN_OS_ESXI
= 6,
815 ENA_ADMIN_OS_GROUPS_NUM
= 6,
818 struct ena_admin_host_info
{
819 /* defined in enum ena_admin_os_type */
822 /* os distribution string format */
825 /* OS distribution numeric format */
828 /* kernel version string format */
829 u8 kernel_ver_str
[32];
831 /* Kernel version numeric format */
837 * 31:24 : module_type
841 /* features bitmap */
842 u32 supported_network_features
[2];
844 /* ENA spec version of driver */
845 u16 ena_spec_version
;
847 /* ENA device's Bus, Device and Function
861 * 2 : interrupt_moderation
862 * 3 : rx_buf_mirroring
863 * 4 : rss_configurable_function_key
866 u32 driver_supported_features
;
869 struct ena_admin_rss_ind_table_entry
{
875 struct ena_admin_feature_rss_ind_table
{
876 /* min supported table size (2^min_size) */
879 /* max supported table size (2^max_size) */
882 /* table size (2^size) */
887 /* index of the inline entry. 0xFFFFFFFF means invalid */
890 /* used for updating single entry, ignored when setting the entire
891 * table through the control buffer.
893 struct ena_admin_rss_ind_table_entry inline_entry
;
896 /* When hint value is 0, driver should use it's own predefined value */
897 struct ena_admin_ena_hw_hints
{
899 u16 mmio_read_timeout
;
902 u16 driver_watchdog_timeout
;
904 /* Per packet tx completion timeout. value in ms */
905 u16 missing_tx_completion_timeout
;
907 u16 missed_tx_completion_count_threshold_to_reset
;
910 u16 admin_completion_tx_timeout
;
912 u16 netdev_wd_timeout
;
921 struct ena_admin_get_feat_cmd
{
922 struct ena_admin_aq_common_desc aq_common_descriptor
;
924 struct ena_admin_ctrl_buff_info control_buffer
;
926 struct ena_admin_get_set_feature_common_desc feat_common
;
931 struct ena_admin_queue_ext_feature_desc
{
938 struct ena_admin_queue_ext_feature_fields max_queue_ext
;
944 struct ena_admin_get_feat_resp
{
945 struct ena_admin_acq_common_desc acq_common_desc
;
950 struct ena_admin_device_attr_feature_desc dev_attr
;
952 struct ena_admin_feature_llq_desc llq
;
954 struct ena_admin_queue_feature_desc max_queue
;
956 struct ena_admin_queue_ext_feature_desc max_queue_ext
;
958 struct ena_admin_feature_aenq_desc aenq
;
960 struct ena_admin_get_feature_link_desc link
;
962 struct ena_admin_feature_offload_desc offload
;
964 struct ena_admin_feature_rss_flow_hash_function flow_hash_func
;
966 struct ena_admin_feature_rss_flow_hash_input flow_hash_input
;
968 struct ena_admin_feature_rss_ind_table ind_table
;
970 struct ena_admin_feature_intr_moder_desc intr_moderation
;
972 struct ena_admin_ena_hw_hints hw_hints
;
976 struct ena_admin_set_feat_cmd
{
977 struct ena_admin_aq_common_desc aq_common_descriptor
;
979 struct ena_admin_ctrl_buff_info control_buffer
;
981 struct ena_admin_get_set_feature_common_desc feat_common
;
987 struct ena_admin_set_feature_mtu_desc mtu
;
989 /* host attributes */
990 struct ena_admin_set_feature_host_attr_desc host_attr
;
992 /* AENQ configuration */
993 struct ena_admin_feature_aenq_desc aenq
;
995 /* rss flow hash function */
996 struct ena_admin_feature_rss_flow_hash_function flow_hash_func
;
998 /* rss flow hash input */
999 struct ena_admin_feature_rss_flow_hash_input flow_hash_input
;
1001 /* rss indirection table */
1002 struct ena_admin_feature_rss_ind_table ind_table
;
1004 /* LLQ configuration */
1005 struct ena_admin_feature_llq_desc llq
;
1009 struct ena_admin_set_feat_resp
{
1010 struct ena_admin_acq_common_desc acq_common_desc
;
1017 struct ena_admin_aenq_common_desc
{
1023 * 7:1 : reserved - MBZ
1034 /* asynchronous event notification groups */
1035 enum ena_admin_aenq_group
{
1036 ENA_ADMIN_LINK_CHANGE
= 0,
1037 ENA_ADMIN_FATAL_ERROR
= 1,
1038 ENA_ADMIN_WARNING
= 2,
1039 ENA_ADMIN_NOTIFICATION
= 3,
1040 ENA_ADMIN_KEEP_ALIVE
= 4,
1041 ENA_ADMIN_AENQ_GROUPS_NUM
= 5,
1044 enum ena_admin_aenq_notification_syndrome
{
1045 ENA_ADMIN_SUSPEND
= 0,
1046 ENA_ADMIN_RESUME
= 1,
1047 ENA_ADMIN_UPDATE_HINTS
= 2,
1050 struct ena_admin_aenq_entry
{
1051 struct ena_admin_aenq_common_desc aenq_common_desc
;
1053 /* command specific inline data */
1054 u32 inline_data_w4
[12];
1057 struct ena_admin_aenq_link_change_desc
{
1058 struct ena_admin_aenq_common_desc aenq_common_desc
;
1060 /* 0 : link_status */
1064 struct ena_admin_aenq_keep_alive_desc
{
1065 struct ena_admin_aenq_common_desc aenq_common_desc
;
1076 struct ena_admin_ena_mmio_req_read_less_resp
{
1081 /* value is valid when poll is cleared */
1085 /* aq_common_desc */
1086 #define ENA_ADMIN_AQ_COMMON_DESC_COMMAND_ID_MASK GENMASK(11, 0)
1087 #define ENA_ADMIN_AQ_COMMON_DESC_PHASE_MASK BIT(0)
1088 #define ENA_ADMIN_AQ_COMMON_DESC_CTRL_DATA_SHIFT 1
1089 #define ENA_ADMIN_AQ_COMMON_DESC_CTRL_DATA_MASK BIT(1)
1090 #define ENA_ADMIN_AQ_COMMON_DESC_CTRL_DATA_INDIRECT_SHIFT 2
1091 #define ENA_ADMIN_AQ_COMMON_DESC_CTRL_DATA_INDIRECT_MASK BIT(2)
1094 #define ENA_ADMIN_SQ_SQ_DIRECTION_SHIFT 5
1095 #define ENA_ADMIN_SQ_SQ_DIRECTION_MASK GENMASK(7, 5)
1097 /* acq_common_desc */
1098 #define ENA_ADMIN_ACQ_COMMON_DESC_COMMAND_ID_MASK GENMASK(11, 0)
1099 #define ENA_ADMIN_ACQ_COMMON_DESC_PHASE_MASK BIT(0)
1101 /* aq_create_sq_cmd */
1102 #define ENA_ADMIN_AQ_CREATE_SQ_CMD_SQ_DIRECTION_SHIFT 5
1103 #define ENA_ADMIN_AQ_CREATE_SQ_CMD_SQ_DIRECTION_MASK GENMASK(7, 5)
1104 #define ENA_ADMIN_AQ_CREATE_SQ_CMD_PLACEMENT_POLICY_MASK GENMASK(3, 0)
1105 #define ENA_ADMIN_AQ_CREATE_SQ_CMD_COMPLETION_POLICY_SHIFT 4
1106 #define ENA_ADMIN_AQ_CREATE_SQ_CMD_COMPLETION_POLICY_MASK GENMASK(6, 4)
1107 #define ENA_ADMIN_AQ_CREATE_SQ_CMD_IS_PHYSICALLY_CONTIGUOUS_MASK BIT(0)
1109 /* aq_create_cq_cmd */
1110 #define ENA_ADMIN_AQ_CREATE_CQ_CMD_INTERRUPT_MODE_ENABLED_SHIFT 5
1111 #define ENA_ADMIN_AQ_CREATE_CQ_CMD_INTERRUPT_MODE_ENABLED_MASK BIT(5)
1112 #define ENA_ADMIN_AQ_CREATE_CQ_CMD_CQ_ENTRY_SIZE_WORDS_MASK GENMASK(4, 0)
1114 /* get_set_feature_common_desc */
1115 #define ENA_ADMIN_GET_SET_FEATURE_COMMON_DESC_SELECT_MASK GENMASK(1, 0)
1117 /* get_feature_link_desc */
1118 #define ENA_ADMIN_GET_FEATURE_LINK_DESC_AUTONEG_MASK BIT(0)
1119 #define ENA_ADMIN_GET_FEATURE_LINK_DESC_DUPLEX_SHIFT 1
1120 #define ENA_ADMIN_GET_FEATURE_LINK_DESC_DUPLEX_MASK BIT(1)
1122 /* feature_offload_desc */
1123 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L3_CSUM_IPV4_MASK BIT(0)
1124 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV4_CSUM_PART_SHIFT 1
1125 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV4_CSUM_PART_MASK BIT(1)
1126 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV4_CSUM_FULL_SHIFT 2
1127 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV4_CSUM_FULL_MASK BIT(2)
1128 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV6_CSUM_PART_SHIFT 3
1129 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV6_CSUM_PART_MASK BIT(3)
1130 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV6_CSUM_FULL_SHIFT 4
1131 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV6_CSUM_FULL_MASK BIT(4)
1132 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_IPV4_SHIFT 5
1133 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_IPV4_MASK BIT(5)
1134 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_IPV6_SHIFT 6
1135 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_IPV6_MASK BIT(6)
1136 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_ECN_SHIFT 7
1137 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_ECN_MASK BIT(7)
1138 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L3_CSUM_IPV4_MASK BIT(0)
1139 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L4_IPV4_CSUM_SHIFT 1
1140 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L4_IPV4_CSUM_MASK BIT(1)
1141 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L4_IPV6_CSUM_SHIFT 2
1142 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L4_IPV6_CSUM_MASK BIT(2)
1143 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_HASH_SHIFT 3
1144 #define ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_HASH_MASK BIT(3)
1146 /* feature_rss_flow_hash_function */
1147 #define ENA_ADMIN_FEATURE_RSS_FLOW_HASH_FUNCTION_FUNCS_MASK GENMASK(7, 0)
1148 #define ENA_ADMIN_FEATURE_RSS_FLOW_HASH_FUNCTION_SELECTED_FUNC_MASK GENMASK(7, 0)
1150 /* feature_rss_flow_hash_input */
1151 #define ENA_ADMIN_FEATURE_RSS_FLOW_HASH_INPUT_L3_SORT_SHIFT 1
1152 #define ENA_ADMIN_FEATURE_RSS_FLOW_HASH_INPUT_L3_SORT_MASK BIT(1)
1153 #define ENA_ADMIN_FEATURE_RSS_FLOW_HASH_INPUT_L4_SORT_SHIFT 2
1154 #define ENA_ADMIN_FEATURE_RSS_FLOW_HASH_INPUT_L4_SORT_MASK BIT(2)
1155 #define ENA_ADMIN_FEATURE_RSS_FLOW_HASH_INPUT_ENABLE_L3_SORT_SHIFT 1
1156 #define ENA_ADMIN_FEATURE_RSS_FLOW_HASH_INPUT_ENABLE_L3_SORT_MASK BIT(1)
1157 #define ENA_ADMIN_FEATURE_RSS_FLOW_HASH_INPUT_ENABLE_L4_SORT_SHIFT 2
1158 #define ENA_ADMIN_FEATURE_RSS_FLOW_HASH_INPUT_ENABLE_L4_SORT_MASK BIT(2)
1161 #define ENA_ADMIN_HOST_INFO_MAJOR_MASK GENMASK(7, 0)
1162 #define ENA_ADMIN_HOST_INFO_MINOR_SHIFT 8
1163 #define ENA_ADMIN_HOST_INFO_MINOR_MASK GENMASK(15, 8)
1164 #define ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT 16
1165 #define ENA_ADMIN_HOST_INFO_SUB_MINOR_MASK GENMASK(23, 16)
1166 #define ENA_ADMIN_HOST_INFO_MODULE_TYPE_SHIFT 24
1167 #define ENA_ADMIN_HOST_INFO_MODULE_TYPE_MASK GENMASK(31, 24)
1168 #define ENA_ADMIN_HOST_INFO_FUNCTION_MASK GENMASK(2, 0)
1169 #define ENA_ADMIN_HOST_INFO_DEVICE_SHIFT 3
1170 #define ENA_ADMIN_HOST_INFO_DEVICE_MASK GENMASK(7, 3)
1171 #define ENA_ADMIN_HOST_INFO_BUS_SHIFT 8
1172 #define ENA_ADMIN_HOST_INFO_BUS_MASK GENMASK(15, 8)
1173 #define ENA_ADMIN_HOST_INFO_RX_OFFSET_SHIFT 1
1174 #define ENA_ADMIN_HOST_INFO_RX_OFFSET_MASK BIT(1)
1175 #define ENA_ADMIN_HOST_INFO_INTERRUPT_MODERATION_SHIFT 2
1176 #define ENA_ADMIN_HOST_INFO_INTERRUPT_MODERATION_MASK BIT(2)
1177 #define ENA_ADMIN_HOST_INFO_RX_BUF_MIRRORING_SHIFT 3
1178 #define ENA_ADMIN_HOST_INFO_RX_BUF_MIRRORING_MASK BIT(3)
1179 #define ENA_ADMIN_HOST_INFO_RSS_CONFIGURABLE_FUNCTION_KEY_SHIFT 4
1180 #define ENA_ADMIN_HOST_INFO_RSS_CONFIGURABLE_FUNCTION_KEY_MASK BIT(4)
1182 /* aenq_common_desc */
1183 #define ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK BIT(0)
1185 /* aenq_link_change_desc */
1186 #define ENA_ADMIN_AENQ_LINK_CHANGE_DESC_LINK_STATUS_MASK BIT(0)
1188 #endif /* _ENA_ADMIN_H_ */