/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All rights reserved.
*/ #ifndef _ENA_ADMIN_H_ #define _ENA_ADMIN_H_
enum ena_admin_completion_policy_type { /* completion queue entry for each sq descriptor */
ENA_ADMIN_COMPLETION_POLICY_DESC = 0, /* completion queue entry upon request in sq descriptor */
ENA_ADMIN_COMPLETION_POLICY_DESC_ON_DEMAND = 1, /* current queue head pointer is updated in OS memory upon sq * descriptor request
*/
ENA_ADMIN_COMPLETION_POLICY_HEAD_ON_DEMAND = 2, /* current queue head pointer is updated in OS memory for each sq * descriptor
*/
ENA_ADMIN_COMPLETION_POLICY_HEAD = 3,
};
/* basic stats return ena_admin_basic_stats while extanded stats return a * buffer (string format) with additional statistics per queue and per * device id
*/ enum ena_admin_get_stats_type {
ENA_ADMIN_GET_STATS_TYPE_BASIC = 0,
ENA_ADMIN_GET_STATS_TYPE_EXTENDED = 1, /* extra HW stats for specific network interface */
ENA_ADMIN_GET_STATS_TYPE_ENI = 2, /* extra HW stats for ENA SRD */
ENA_ADMIN_GET_STATS_TYPE_ENA_SRD = 3,
ENA_ADMIN_GET_STATS_TYPE_CUSTOMER_METRICS = 4,
};
/* as appears in ena_admin_aq_opcode */
u8 opcode;
/* 0 : phase * 1 : ctrl_data - control buffer address valid * 2 : ctrl_data_indirect - control buffer address * points to list of pages with addresses of control * buffers * 7:3 : reserved3
*/
u8 flags;
};
/* used in ena_admin_aq_entry. Can point directly to control data, or to a * page list chunk. Used also at the end of indirect mode page list chunks, * for chaining.
*/ struct ena_admin_ctrl_buff_info {
u32 length;
struct ena_admin_acq_common_desc { /* command identifier to associate it with the aq descriptor * 11:0 : command_id * 15:12 : reserved12
*/
u16 command;
u8 status;
/* 0 : phase * 7:1 : reserved1
*/
u8 flags;
u16 extended_status;
/* indicates to the driver which AQ entry has been consumed by the * device and could be reused
*/
u16 sq_head_indx;
};
/* 3:0 : placement_policy - Describing where the SQ * descriptor ring and the SQ packet headers reside: * 0x1 - descriptors and headers are in OS memory, * 0x3 - descriptors and headers in device memory * (a.k.a Low Latency Queue) * 6:4 : completion_policy - Describing what policy * to use for generation completion entry (cqe) in * the CQ associated with this SQ: 0x0 - cqe for each * sq descriptor, 0x1 - cqe upon request in sq * descriptor, 0x2 - current queue head pointer is * updated in OS memory upon sq descriptor request * 0x3 - current queue head pointer is updated in OS * memory for each sq descriptor * 7 : reserved15_w1
*/
u8 sq_caps_2;
/* 0 : is_physically_contiguous - Described if the * queue ring memory is allocated in physical * contiguous pages or split. * 7:1 : reserved17_w1
*/
u8 sq_caps_3;
/* associated completion queue id. This CQ must be created prior to SQ * creation
*/
u16 cq_idx;
/* submission queue depth in entries */
u16 sq_depth;
/* SQ physical base address in OS memory. This field should not be * used for Low Latency queues. Has to be page aligned.
*/ struct ena_common_mem_addr sq_ba;
/* specifies queue head writeback location in OS memory. Valid if * completion_policy is set to completion_policy_head_on_demand or * completion_policy_head. Has to be cache aligned
*/ struct ena_common_mem_addr sq_head_writeback;
/* ENA AQ Get Statistics command. Extended statistics are placed in control * buffer pointed by AQ entry
*/ struct ena_admin_aq_get_stats_cmd { struct ena_admin_aq_common_desc aq_common_descriptor;
union { /* command specific inline data */
u32 inline_data_w1[3];
/* ENI Statistics Command. */ struct ena_admin_eni_stats { /* The number of packets shaped due to inbound aggregate BW * allowance being exceeded
*/
u64 bw_in_allowance_exceeded;
/* The number of packets shaped due to outbound aggregate BW * allowance being exceeded
*/
u64 bw_out_allowance_exceeded;
/* The number of packets shaped due to PPS allowance being exceeded */
u64 pps_allowance_exceeded;
/* The number of packets shaped due to connection tracking * allowance being exceeded and leading to failure in establishment * of new connections
*/
u64 conntrack_allowance_exceeded;
/* The number of packets shaped due to linklocal packet rate * allowance being exceeded
*/
u64 linklocal_allowance_exceeded;
};
struct ena_admin_ena_srd_stats { /* Number of packets transmitted over ENA SRD */
u64 ena_srd_tx_pkts;
/* Number of packets transmitted or could have been * transmitted over ENA SRD
*/
u64 ena_srd_eligible_tx_pkts;
/* Number of packets received over ENA SRD */
u64 ena_srd_rx_pkts;
/* Percentage of the ENA SRD resources that is in use */
u64 ena_srd_resource_utilization;
};
/* ENA SRD Statistics Command */ struct ena_admin_ena_srd_info { /* ENA SRD configuration bitmap. See ena_admin_ena_srd_flags for * details
*/
u64 flags;
struct ena_admin_ena_srd_stats ena_srd_stats;
};
/* Customer Metrics Command. */ struct ena_admin_customer_metrics { /* A bitmap representing the reported customer metrics according to * the order they are reported
*/
u64 reported_metrics;
};
/* as appears in ena_admin_aq_feature_id */
u8 feature_id;
/* The driver specifies the max feature version it supports and the * device responds with the currently supported feature version. The * field is zero based
*/
u8 feature_version;
/* bitmap of ena_admin_aq_feature_id, which represents supported * subcommands for the set/get feature admin commands.
*/
u32 supported_features;
/* bitmap of ena_admin_aq_caps_id, which represents device * capabilities.
*/
u32 capabilities;
/* Indicates how many bits are used physical address access. */
u32 phys_addr_width;
/* Indicates how many bits are used virtual address access. */
u32 virt_addr_width;
/* unicast MAC address (in Network byte order) */
u8 mac_addr[6];
u8 reserved7[2];
u32 max_mtu;
};
enum ena_admin_llq_header_location { /* header is in descriptor list */
ENA_ADMIN_INLINE_HEADER = 1, /* header in a separate ring, implies 16B descriptor list entry */
ENA_ADMIN_HEADER_RING = 2,
};
/* packet descriptor list entry always starts with one or more descriptors, * followed by a header. The rest of the descriptors are located in the * beginning of the subsequent entry. Stride refers to how the rest of the * descriptors are placed. This field is relevant only for inline header * mode
*/ enum ena_admin_llq_stride_ctrl {
ENA_ADMIN_SINGLE_DESC_PER_ENTRY = 1,
ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY = 2,
};
/* specify the header locations the device supports. bitfield of enum * ena_admin_llq_header_location.
*/
u16 header_location_ctrl_supported;
/* the header location the driver selected to use. */
u16 header_location_ctrl_enabled;
/* if inline header is specified - this is the size of descriptor list * entry. If header in a separate ring is specified - this is the size * of header ring entry. bitfield of enum ena_admin_llq_ring_entry_size. * specify the entry sizes the device supports
*/
u16 entry_size_ctrl_supported;
/* the entry size the driver selected to use. */
u16 entry_size_ctrl_enabled;
/* valid only if inline header is specified. First entry associated with * the packet includes descriptors and header. Rest of the entries * occupied by descriptors. This parameter defines the max number of * descriptors precedding the header in the first entry. The field is * bitfield of enum ena_admin_llq_num_descs_before_header and specify * the values the device supports
*/
u16 desc_num_before_header_supported;
/* the desire field the driver selected to use */
u16 desc_num_before_header_enabled;
/* valid only if inline was chosen. bitfield of enum * ena_admin_llq_stride_ctrl
*/
u16 descriptors_stride_ctrl_supported;
/* the stride control the driver selected to use */
u16 descriptors_stride_ctrl_enabled;
/* reserved */
u32 reserved1;
/* accelerated low latency queues requirement. driver needs to * support those requirements in order to use accelerated llq
*/ struct ena_admin_accel_mode_req accel_mode;
};
struct ena_admin_set_feature_host_attr_desc { /* host OS info base address in OS memory. host info is 4KB of * physically contiguous
*/ struct ena_common_mem_addr os_info_ba;
/* host debug area base address in OS memory. debug area must be * physically contiguous
*/ struct ena_common_mem_addr debug_ba;
/* max supported table size (2^max_size) */
u16 max_size;
/* table size (2^size) */
u16 size;
u16 reserved;
/* index of the inline entry. 0xFFFFFFFF means invalid */
u32 inline_index;
/* used for updating single entry, ignored when setting the entire * table through the control buffer.
*/ struct ena_admin_rss_ind_table_entry inline_entry;
};
/* When hint value is 0, driver should use its own predefined value */ struct ena_admin_ena_hw_hints { /* value in ms */
u16 mmio_read_timeout;
/* value in ms */
u16 driver_watchdog_timeout;
/* Per packet tx completion timeout. value in ms */
u16 missing_tx_completion_timeout;
struct ena_admin_queue_ext_feature_desc { /* version */
u8 version;
u8 reserved1[3];
union { struct ena_admin_queue_ext_feature_fields max_queue_ext;
u32 raw[10];
};
};
struct ena_admin_feature_phc_desc { /* PHC type as defined in enum ena_admin_get_phc_type, * used only for GET command.
*/
u8 type;
/* Reserved - MBZ */
u8 reserved1[3];
/* PHC doorbell address as an offset to PCIe MMIO REG BAR, * used only for GET command.
*/
u32 doorbell_offset;
/* Max time for valid PHC retrieval, passing this threshold will * fail the get-time request and block PHC requests for * block_timeout_usec, used only for GET command.
*/
u32 expire_timeout_usec;
/* PHC requests block period, blocking starts if PHC request expired * in order to prevent floods on busy device, * used only for GET command.
*/
u32 block_timeout_usec;
/* Shared PHC physical address (ena_admin_phc_resp), * used only for SET command.
*/ struct ena_common_mem_addr output_address;
/* Shared PHC Size (ena_admin_phc_resp), * used only for SET command.
*/
u32 output_length;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.