drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
Extension
.c
Size
23575 bytes
Lines
873
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 nicvf_stat {
	char name[ETH_GSTRING_LEN];
	unsigned int index;
};

#define NICVF_HW_STAT(stat) { \
	.name = #stat, \
	.index = offsetof(struct nicvf_hw_stats, stat) / sizeof(u64), \
}

#define NICVF_DRV_STAT(stat) { \
	.name = #stat, \
	.index = offsetof(struct nicvf_drv_stats, stat) / sizeof(u64), \
}

static const struct nicvf_stat nicvf_hw_stats[] = {
	NICVF_HW_STAT(rx_bytes),
	NICVF_HW_STAT(rx_frames),
	NICVF_HW_STAT(rx_ucast_frames),
	NICVF_HW_STAT(rx_bcast_frames),
	NICVF_HW_STAT(rx_mcast_frames),
	NICVF_HW_STAT(rx_drops),
	NICVF_HW_STAT(rx_drop_red),
	NICVF_HW_STAT(rx_drop_red_bytes),
	NICVF_HW_STAT(rx_drop_overrun),
	NICVF_HW_STAT(rx_drop_overrun_bytes),
	NICVF_HW_STAT(rx_drop_bcast),
	NICVF_HW_STAT(rx_drop_mcast),
	NICVF_HW_STAT(rx_drop_l3_bcast),
	NICVF_HW_STAT(rx_drop_l3_mcast),
	NICVF_HW_STAT(rx_fcs_errors),
	NICVF_HW_STAT(rx_l2_errors),
	NICVF_HW_STAT(tx_bytes),
	NICVF_HW_STAT(tx_frames),
	NICVF_HW_STAT(tx_ucast_frames),
	NICVF_HW_STAT(tx_bcast_frames),
	NICVF_HW_STAT(tx_mcast_frames),
	NICVF_HW_STAT(tx_drops),
};

static const struct nicvf_stat nicvf_drv_stats[] = {
	NICVF_DRV_STAT(rx_bgx_truncated_pkts),
	NICVF_DRV_STAT(rx_jabber_errs),
	NICVF_DRV_STAT(rx_fcs_errs),
	NICVF_DRV_STAT(rx_bgx_errs),
	NICVF_DRV_STAT(rx_prel2_errs),
	NICVF_DRV_STAT(rx_l2_hdr_malformed),
	NICVF_DRV_STAT(rx_oversize),
	NICVF_DRV_STAT(rx_undersize),
	NICVF_DRV_STAT(rx_l2_len_mismatch),
	NICVF_DRV_STAT(rx_l2_pclp),
	NICVF_DRV_STAT(rx_ip_ver_errs),
	NICVF_DRV_STAT(rx_ip_csum_errs),
	NICVF_DRV_STAT(rx_ip_hdr_malformed),
	NICVF_DRV_STAT(rx_ip_payload_malformed),
	NICVF_DRV_STAT(rx_ip_ttl_errs),
	NICVF_DRV_STAT(rx_l3_pclp),
	NICVF_DRV_STAT(rx_l4_malformed),
	NICVF_DRV_STAT(rx_l4_csum_errs),
	NICVF_DRV_STAT(rx_udp_len_errs),
	NICVF_DRV_STAT(rx_l4_port_errs),
	NICVF_DRV_STAT(rx_tcp_flag_errs),
	NICVF_DRV_STAT(rx_tcp_offset_errs),
	NICVF_DRV_STAT(rx_l4_pclp),
	NICVF_DRV_STAT(rx_truncated_pkts),

	NICVF_DRV_STAT(tx_desc_fault),
	NICVF_DRV_STAT(tx_hdr_cons_err),
	NICVF_DRV_STAT(tx_subdesc_err),
	NICVF_DRV_STAT(tx_max_size_exceeded),
	NICVF_DRV_STAT(tx_imm_size_oflow),
	NICVF_DRV_STAT(tx_data_seq_err),
	NICVF_DRV_STAT(tx_mem_seq_err),
	NICVF_DRV_STAT(tx_lock_viol),
	NICVF_DRV_STAT(tx_data_fault),
	NICVF_DRV_STAT(tx_tstmp_conflict),
	NICVF_DRV_STAT(tx_tstmp_timeout),
	NICVF_DRV_STAT(tx_mem_fault),
	NICVF_DRV_STAT(tx_csum_overlap),
	NICVF_DRV_STAT(tx_csum_overflow),

	NICVF_DRV_STAT(tx_tso),
	NICVF_DRV_STAT(tx_timeout),
	NICVF_DRV_STAT(txq_stop),
	NICVF_DRV_STAT(txq_wake),
	NICVF_DRV_STAT(rcv_buffer_alloc_failures),
	NICVF_DRV_STAT(page_alloc),
};

static const struct nicvf_stat nicvf_queue_stats[] = {

Annotation

Implementation Notes