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.

Dependency Surface

Detected Declarations

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

Implementation Notes