drivers/net/ethernet/cisco/enic/enic_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/cisco/enic/enic_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/cisco/enic/enic_ethtool.c- Extension
.c- Size
- 24713 bytes
- Lines
- 851
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/netdevice.hlinux/ethtool.hlinux/net_tstamp.henic_res.henic.henic_dev.henic_clsf.hvnic_rss.hvnic_stats.h
Detected Declarations
struct enic_statfunction enic_intr_coal_set_rxfunction enic_get_supp_adv_media_typefunction enic_get_ksettingsfunction enic_get_drvinfofunction enic_get_stringsfunction enic_get_ringparamfunction enic_set_ringparamfunction enic_get_sset_countfunction enic_get_ethtool_statsfunction enic_get_msglevelfunction enic_set_msglevelfunction enic_get_coalescefunction enic_coalesce_validfunction enic_set_coalescefunction enic_grxclsrlallfunction hlist_for_each_entry_safefunction enic_grxclsrulefunction enic_get_rx_flow_hashfunction enic_get_rx_ring_countfunction enic_get_rxnfcfunction enic_get_rxfh_key_sizefunction enic_get_rxfhfunction enic_set_rxfhfunction enic_get_ts_infofunction enic_get_channelsfunction enic_set_ethtool_ops
Annotated Snippet
struct enic_stat {
char name[ETH_GSTRING_LEN];
unsigned int index;
};
#define ENIC_TX_STAT(stat) { \
.name = #stat, \
.index = offsetof(struct vnic_tx_stats, stat) / sizeof(u64) \
}
#define ENIC_RX_STAT(stat) { \
.name = #stat, \
.index = offsetof(struct vnic_rx_stats, stat) / sizeof(u64) \
}
#define ENIC_GEN_STAT(stat) { \
.name = #stat, \
.index = offsetof(struct vnic_gen_stats, stat) / sizeof(u64)\
}
#define ENIC_PER_RQ_STAT(stat) { \
.name = "rq[%d]_"#stat, \
.index = offsetof(struct enic_rq_stats, stat) / sizeof(u64) \
}
#define ENIC_PER_WQ_STAT(stat) { \
.name = "wq[%d]_"#stat, \
.index = offsetof(struct enic_wq_stats, stat) / sizeof(u64) \
}
static const struct enic_stat enic_per_rq_stats[] = {
ENIC_PER_RQ_STAT(l4_rss_hash),
ENIC_PER_RQ_STAT(l3_rss_hash),
ENIC_PER_RQ_STAT(csum_unnecessary_encap),
ENIC_PER_RQ_STAT(vlan_stripped),
ENIC_PER_RQ_STAT(napi_complete),
ENIC_PER_RQ_STAT(napi_repoll),
ENIC_PER_RQ_STAT(no_skb),
ENIC_PER_RQ_STAT(desc_skip),
};
#define NUM_ENIC_PER_RQ_STATS ARRAY_SIZE(enic_per_rq_stats)
static const struct enic_stat enic_per_wq_stats[] = {
ENIC_PER_WQ_STAT(encap_tso),
ENIC_PER_WQ_STAT(encap_csum),
ENIC_PER_WQ_STAT(add_vlan),
ENIC_PER_WQ_STAT(cq_work),
ENIC_PER_WQ_STAT(cq_bytes),
ENIC_PER_WQ_STAT(null_pkt),
ENIC_PER_WQ_STAT(skb_linear_fail),
ENIC_PER_WQ_STAT(desc_full_awake),
};
#define NUM_ENIC_PER_WQ_STATS ARRAY_SIZE(enic_per_wq_stats)
static const struct enic_stat enic_tx_stats[] = {
ENIC_TX_STAT(tx_frames_ok),
ENIC_TX_STAT(tx_unicast_frames_ok),
ENIC_TX_STAT(tx_multicast_frames_ok),
ENIC_TX_STAT(tx_broadcast_frames_ok),
ENIC_TX_STAT(tx_bytes_ok),
ENIC_TX_STAT(tx_unicast_bytes_ok),
ENIC_TX_STAT(tx_multicast_bytes_ok),
ENIC_TX_STAT(tx_broadcast_bytes_ok),
ENIC_TX_STAT(tx_drops),
ENIC_TX_STAT(tx_errors),
ENIC_TX_STAT(tx_tso),
};
#define NUM_ENIC_TX_STATS ARRAY_SIZE(enic_tx_stats)
static const struct enic_stat enic_rx_stats[] = {
ENIC_RX_STAT(rx_frames_ok),
ENIC_RX_STAT(rx_frames_total),
ENIC_RX_STAT(rx_unicast_frames_ok),
ENIC_RX_STAT(rx_multicast_frames_ok),
ENIC_RX_STAT(rx_broadcast_frames_ok),
ENIC_RX_STAT(rx_bytes_ok),
ENIC_RX_STAT(rx_unicast_bytes_ok),
ENIC_RX_STAT(rx_multicast_bytes_ok),
ENIC_RX_STAT(rx_broadcast_bytes_ok),
ENIC_RX_STAT(rx_drop),
ENIC_RX_STAT(rx_no_bufs),
ENIC_RX_STAT(rx_errors),
ENIC_RX_STAT(rx_rss),
ENIC_RX_STAT(rx_crc_errors),
ENIC_RX_STAT(rx_frames_64),
ENIC_RX_STAT(rx_frames_127),
ENIC_RX_STAT(rx_frames_255),
ENIC_RX_STAT(rx_frames_511),
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/ethtool.h`, `linux/net_tstamp.h`, `enic_res.h`, `enic.h`, `enic_dev.h`, `enic_clsf.h`, `vnic_rss.h`.
- Detected declarations: `struct enic_stat`, `function enic_intr_coal_set_rx`, `function enic_get_supp_adv_media_type`, `function enic_get_ksettings`, `function enic_get_drvinfo`, `function enic_get_strings`, `function enic_get_ringparam`, `function enic_set_ringparam`, `function enic_get_sset_count`, `function enic_get_ethtool_stats`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.