drivers/net/ethernet/amazon/ena/ena_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/amazon/ena/ena_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/amazon/ena/ena_ethtool.c- Extension
.c- Size
- 30119 bytes
- Lines
- 1165
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ethtool.hlinux/pci.hlinux/net_tstamp.hena_netdev.hena_xdp.hena_phc.h
Detected Declarations
struct ena_statsstruct ena_hw_metricsfunction ena_safe_update_statfunction ena_metrics_statsfunction ena_queue_statsfunction ena_dev_admin_queue_statsfunction ena_get_statsfunction ena_get_ethtool_statsfunction ena_get_ts_infofunction ena_get_sw_stats_countfunction ena_get_hw_stats_countfunction ena_get_sset_countfunction ena_metrics_stats_stringsfunction ena_queue_stringsfunction ena_com_dev_stringsfunction ena_get_stringsfunction ena_get_ethtool_stringsfunction ena_get_link_ksettingsfunction ena_get_coalescefunction ena_update_tx_rings_nonadaptive_intr_moderationfunction ena_update_rx_rings_nonadaptive_intr_moderationfunction ena_set_coalescefunction ena_get_msglevelfunction ena_set_msglevelfunction ena_get_drvinfofunction ena_get_ringparamfunction ena_set_ringparamfunction ena_flow_hash_to_flow_typefunction ena_flow_data_to_flow_hashfunction ena_get_rxfh_fieldsfunction ena_set_rxfh_fieldsfunction ena_get_rx_ring_countfunction ena_get_rxfh_indir_sizefunction ena_get_rxfh_key_sizefunction ena_indirection_table_setfunction ena_indirection_table_getfunction ena_get_rxfhfunction ena_set_rxfhfunction ena_get_channelsfunction ena_set_channelsfunction ena_get_tunablefunction ena_set_tunablefunction ena_set_ethtool_opsfunction ena_dump_stats_exfunction ena_dump_stats_to_buffunction ena_dump_stats_to_dmesg
Annotated Snippet
struct ena_stats {
char name[ETH_GSTRING_LEN];
int stat_offset;
};
struct ena_hw_metrics {
char name[ETH_GSTRING_LEN];
};
#define ENA_STAT_ENA_COM_ENTRY(stat) { \
.name = #stat, \
.stat_offset = offsetof(struct ena_com_stats_admin, stat) / sizeof(u64) \
}
#define ENA_STAT_ENTRY(stat, stat_type) { \
.name = #stat, \
.stat_offset = offsetof(struct ena_stats_##stat_type, stat) / sizeof(u64) \
}
#define ENA_STAT_HW_ENTRY(stat, stat_type) { \
.name = #stat, \
.stat_offset = offsetof(struct ena_admin_##stat_type, stat) / sizeof(u64) \
}
#define ENA_STAT_RX_ENTRY(stat) \
ENA_STAT_ENTRY(stat, rx)
#define ENA_STAT_TX_ENTRY(stat) \
ENA_STAT_ENTRY(stat, tx)
#define ENA_STAT_GLOBAL_ENTRY(stat) \
ENA_STAT_ENTRY(stat, dev)
#define ENA_STAT_ENI_ENTRY(stat) \
ENA_STAT_HW_ENTRY(stat, eni_stats)
#define ENA_STAT_ENA_SRD_ENTRY(stat) \
ENA_STAT_HW_ENTRY(stat, ena_srd_stats)
#define ENA_STAT_ENA_SRD_MODE_ENTRY(stat) { \
.name = #stat, \
.stat_offset = offsetof(struct ena_admin_ena_srd_info, flags) / sizeof(u64) \
}
#define ENA_METRIC_ENI_ENTRY(stat) { \
.name = #stat \
}
static const struct ena_stats ena_stats_global_strings[] = {
ENA_STAT_GLOBAL_ENTRY(tx_timeout),
ENA_STAT_GLOBAL_ENTRY(suspend),
ENA_STAT_GLOBAL_ENTRY(resume),
ENA_STAT_GLOBAL_ENTRY(wd_expired),
ENA_STAT_GLOBAL_ENTRY(interface_up),
ENA_STAT_GLOBAL_ENTRY(interface_down),
ENA_STAT_GLOBAL_ENTRY(admin_q_pause),
ENA_STAT_GLOBAL_ENTRY(reset_fail),
};
/* A partial list of hw stats. Used when admin command
* with type ENA_ADMIN_GET_STATS_TYPE_CUSTOMER_METRICS is not supported
*/
static const struct ena_stats ena_stats_eni_strings[] = {
ENA_STAT_ENI_ENTRY(bw_in_allowance_exceeded),
ENA_STAT_ENI_ENTRY(bw_out_allowance_exceeded),
ENA_STAT_ENI_ENTRY(pps_allowance_exceeded),
ENA_STAT_ENI_ENTRY(conntrack_allowance_exceeded),
ENA_STAT_ENI_ENTRY(linklocal_allowance_exceeded),
};
static const struct ena_hw_metrics ena_hw_stats_strings[] = {
ENA_METRIC_ENI_ENTRY(bw_in_allowance_exceeded),
ENA_METRIC_ENI_ENTRY(bw_out_allowance_exceeded),
ENA_METRIC_ENI_ENTRY(pps_allowance_exceeded),
ENA_METRIC_ENI_ENTRY(conntrack_allowance_exceeded),
ENA_METRIC_ENI_ENTRY(linklocal_allowance_exceeded),
ENA_METRIC_ENI_ENTRY(conntrack_allowance_available),
};
static const struct ena_stats ena_srd_info_strings[] = {
ENA_STAT_ENA_SRD_MODE_ENTRY(ena_srd_mode),
ENA_STAT_ENA_SRD_ENTRY(ena_srd_tx_pkts),
ENA_STAT_ENA_SRD_ENTRY(ena_srd_eligible_tx_pkts),
ENA_STAT_ENA_SRD_ENTRY(ena_srd_rx_pkts),
ENA_STAT_ENA_SRD_ENTRY(ena_srd_resource_utilization)
};
static const struct ena_stats ena_stats_tx_strings[] = {
ENA_STAT_TX_ENTRY(cnt),
ENA_STAT_TX_ENTRY(bytes),
Annotation
- Immediate include surface: `linux/ethtool.h`, `linux/pci.h`, `linux/net_tstamp.h`, `ena_netdev.h`, `ena_xdp.h`, `ena_phc.h`.
- Detected declarations: `struct ena_stats`, `struct ena_hw_metrics`, `function ena_safe_update_stat`, `function ena_metrics_stats`, `function ena_queue_stats`, `function ena_dev_admin_queue_stats`, `function ena_get_stats`, `function ena_get_ethtool_stats`, `function ena_get_ts_info`, `function ena_get_sw_stats_count`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.