drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c- Extension
.c- Size
- 70246 bytes
- Lines
- 2568
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/kernel.hlinux/netdevice.hlinux/etherdevice.hlinux/interrupt.hlinux/pci.hlinux/ethtool.hlinux/firmware.hlinux/sfp.hnfpcore/nfp.hnfpcore/nfp_dev.hnfpcore/nfp_nsp.hnfp_app.hnfp_main.hnfp_net_ctrl.hnfp_net_dp.hnfp_net.hnfp_port.hnfpcore/nfp_cpp.h
Detected Declarations
struct nfp_et_statfunction nfp_net_get_nspinfofunction nfp_get_drvinfofunction nfp_net_get_drvinfofunction nfp_net_nway_resetfunction nfp_app_get_drvinfofunction nfp_net_set_fec_link_modefunction nfp_add_media_link_modefunction nfp_net_get_link_ksettingsfunction nfp_net_set_link_ksettingsfunction nfp_net_get_ringparamfunction nfp_net_set_ring_sizefunction nfp_net_set_ringparamfunction nfp_test_linkfunction nfp_test_nspfunction nfp_test_fwfunction nfp_test_regfunction link_test_supportedfunction nsp_test_supportedfunction fw_test_supportedfunction reg_test_supportedfunction nfp_get_self_test_stringsfunction nfp_get_self_test_countfunction nfp_net_self_testfunction nfp_vnic_get_sw_stats_countfunction nfp_vnic_get_hw_stats_countfunction nfp_vnic_get_hw_stats_stringsfunction nfp_vnic_get_hw_statsfunction nfp_vnic_get_tlv_stats_countfunction nfp_mac_get_stats_countfunction nfp_net_get_stringsfunction nfp_net_get_statsfunction nfp_net_get_sset_countfunction nfp_port_get_stringsfunction nfp_port_get_statsfunction nfp_port_get_sset_countfunction nfp_port_fec_ethtool_to_nspfunction nfp_port_fec_nsp_to_ethtoolfunction nfp_port_get_fecparamfunction nfp_port_set_fecparamfunction ethtool_flow_to_nfp_flagfunction nfp_net_get_rxfh_fieldsfunction nfp_net_fs_to_ethtoolfunction nfp_net_get_fs_rulefunction list_for_each_entryfunction nfp_net_get_fs_locfunction nfp_net_get_rx_ring_countfunction nfp_net_get_rxnfc
Annotated Snippet
struct nfp_et_stat {
char name[ETH_GSTRING_LEN];
int off;
};
static const struct nfp_et_stat nfp_net_et_stats[] = {
/* Stats from the device */
{ "dev_rx_discards", NFP_NET_CFG_STATS_RX_DISCARDS },
{ "dev_rx_errors", NFP_NET_CFG_STATS_RX_ERRORS },
{ "dev_rx_bytes", NFP_NET_CFG_STATS_RX_OCTETS },
{ "dev_rx_uc_bytes", NFP_NET_CFG_STATS_RX_UC_OCTETS },
{ "dev_rx_mc_bytes", NFP_NET_CFG_STATS_RX_MC_OCTETS },
{ "dev_rx_bc_bytes", NFP_NET_CFG_STATS_RX_BC_OCTETS },
{ "dev_rx_pkts", NFP_NET_CFG_STATS_RX_FRAMES },
{ "dev_rx_mc_pkts", NFP_NET_CFG_STATS_RX_MC_FRAMES },
{ "dev_rx_bc_pkts", NFP_NET_CFG_STATS_RX_BC_FRAMES },
{ "dev_tx_discards", NFP_NET_CFG_STATS_TX_DISCARDS },
{ "dev_tx_errors", NFP_NET_CFG_STATS_TX_ERRORS },
{ "dev_tx_bytes", NFP_NET_CFG_STATS_TX_OCTETS },
{ "dev_tx_uc_bytes", NFP_NET_CFG_STATS_TX_UC_OCTETS },
{ "dev_tx_mc_bytes", NFP_NET_CFG_STATS_TX_MC_OCTETS },
{ "dev_tx_bc_bytes", NFP_NET_CFG_STATS_TX_BC_OCTETS },
{ "dev_tx_pkts", NFP_NET_CFG_STATS_TX_FRAMES },
{ "dev_tx_mc_pkts", NFP_NET_CFG_STATS_TX_MC_FRAMES },
{ "dev_tx_bc_pkts", NFP_NET_CFG_STATS_TX_BC_FRAMES },
{ "bpf_pass_pkts", NFP_NET_CFG_STATS_APP0_FRAMES },
{ "bpf_pass_bytes", NFP_NET_CFG_STATS_APP0_BYTES },
/* see comments in outro functions in nfp_bpf_jit.c to find out
* how different BPF modes use app-specific counters
*/
{ "bpf_app1_pkts", NFP_NET_CFG_STATS_APP1_FRAMES },
{ "bpf_app1_bytes", NFP_NET_CFG_STATS_APP1_BYTES },
{ "bpf_app2_pkts", NFP_NET_CFG_STATS_APP2_FRAMES },
{ "bpf_app2_bytes", NFP_NET_CFG_STATS_APP2_BYTES },
{ "bpf_app3_pkts", NFP_NET_CFG_STATS_APP3_FRAMES },
{ "bpf_app3_bytes", NFP_NET_CFG_STATS_APP3_BYTES },
};
static const struct nfp_et_stat nfp_mac_et_stats[] = {
{ "rx_octets", NFP_MAC_STATS_RX_IN_OCTETS, },
{ "rx_frame_too_long_errors",
NFP_MAC_STATS_RX_FRAME_TOO_LONG_ERRORS, },
{ "rx_range_length_errors", NFP_MAC_STATS_RX_RANGE_LENGTH_ERRORS, },
{ "rx_vlan_received_ok", NFP_MAC_STATS_RX_VLAN_RECEIVED_OK, },
{ "rx_errors", NFP_MAC_STATS_RX_IN_ERRORS, },
{ "rx_broadcast_pkts", NFP_MAC_STATS_RX_IN_BROADCAST_PKTS, },
{ "rx_drop_events", NFP_MAC_STATS_RX_DROP_EVENTS, },
{ "rx_alignment_errors", NFP_MAC_STATS_RX_ALIGNMENT_ERRORS, },
{ "rx_pause_mac_ctrl_frames",
NFP_MAC_STATS_RX_PAUSE_MAC_CTRL_FRAMES, },
{ "rx_frames_received_ok", NFP_MAC_STATS_RX_FRAMES_RECEIVED_OK, },
{ "rx_frame_check_sequence_errors",
NFP_MAC_STATS_RX_FRAME_CHECK_SEQUENCE_ERRORS, },
{ "rx_unicast_pkts", NFP_MAC_STATS_RX_UNICAST_PKTS, },
{ "rx_multicast_pkts", NFP_MAC_STATS_RX_MULTICAST_PKTS, },
{ "rx_pkts", NFP_MAC_STATS_RX_PKTS, },
{ "rx_undersize_pkts", NFP_MAC_STATS_RX_UNDERSIZE_PKTS, },
{ "rx_pkts_64_octets", NFP_MAC_STATS_RX_PKTS_64_OCTETS, },
{ "rx_pkts_65_to_127_octets",
NFP_MAC_STATS_RX_PKTS_65_TO_127_OCTETS, },
{ "rx_pkts_128_to_255_octets",
NFP_MAC_STATS_RX_PKTS_128_TO_255_OCTETS, },
{ "rx_pkts_256_to_511_octets",
NFP_MAC_STATS_RX_PKTS_256_TO_511_OCTETS, },
{ "rx_pkts_512_to_1023_octets",
NFP_MAC_STATS_RX_PKTS_512_TO_1023_OCTETS, },
{ "rx_pkts_1024_to_1518_octets",
NFP_MAC_STATS_RX_PKTS_1024_TO_1518_OCTETS, },
{ "rx_pkts_1519_to_max_octets",
NFP_MAC_STATS_RX_PKTS_1519_TO_MAX_OCTETS, },
{ "rx_jabbers", NFP_MAC_STATS_RX_JABBERS, },
{ "rx_fragments", NFP_MAC_STATS_RX_FRAGMENTS, },
{ "rx_oversize_pkts", NFP_MAC_STATS_RX_OVERSIZE_PKTS, },
{ "rx_pause_frames_class0", NFP_MAC_STATS_RX_PAUSE_FRAMES_CLASS0, },
{ "rx_pause_frames_class1", NFP_MAC_STATS_RX_PAUSE_FRAMES_CLASS1, },
{ "rx_pause_frames_class2", NFP_MAC_STATS_RX_PAUSE_FRAMES_CLASS2, },
{ "rx_pause_frames_class3", NFP_MAC_STATS_RX_PAUSE_FRAMES_CLASS3, },
{ "rx_pause_frames_class4", NFP_MAC_STATS_RX_PAUSE_FRAMES_CLASS4, },
{ "rx_pause_frames_class5", NFP_MAC_STATS_RX_PAUSE_FRAMES_CLASS5, },
{ "rx_pause_frames_class6", NFP_MAC_STATS_RX_PAUSE_FRAMES_CLASS6, },
{ "rx_pause_frames_class7", NFP_MAC_STATS_RX_PAUSE_FRAMES_CLASS7, },
{ "rx_mac_ctrl_frames_received",
NFP_MAC_STATS_RX_MAC_CTRL_FRAMES_RECEIVED, },
{ "rx_mac_head_drop", NFP_MAC_STATS_RX_MAC_HEAD_DROP, },
{ "tx_queue_drop", NFP_MAC_STATS_TX_QUEUE_DROP, },
{ "tx_octets", NFP_MAC_STATS_TX_OUT_OCTETS, },
{ "tx_vlan_transmitted_ok", NFP_MAC_STATS_TX_VLAN_TRANSMITTED_OK, },
{ "tx_errors", NFP_MAC_STATS_TX_OUT_ERRORS, },
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/kernel.h`, `linux/netdevice.h`, `linux/etherdevice.h`, `linux/interrupt.h`, `linux/pci.h`, `linux/ethtool.h`, `linux/firmware.h`.
- Detected declarations: `struct nfp_et_stat`, `function nfp_net_get_nspinfo`, `function nfp_get_drvinfo`, `function nfp_net_get_drvinfo`, `function nfp_net_nway_reset`, `function nfp_app_get_drvinfo`, `function nfp_net_set_fec_link_mode`, `function nfp_add_media_link_mode`, `function nfp_net_get_link_ksettings`, `function nfp_net_set_link_ksettings`.
- 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.
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.