drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c- Extension
.c- Size
- 57659 bytes
- Lines
- 2076
- 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/ethtool.hlinux/ethtool_netlink.hlinux/netdevice.hlinux/pci.hnet/ipv6.hfbnic.hfbnic_netdev.hfbnic_tlv.h
Detected Declarations
struct fbnic_statenum fbnic_self_test_resultsfunction fbnic_get_drvinfofunction fbnic_get_regs_lenfunction fbnic_get_regsfunction fbnic_clone_swap_cfgfunction fbnic_aggregate_vector_countersfunction fbnic_clone_swapfunction fbnic_clone_freefunction fbnic_get_coalescefunction fbnic_set_coalescefunction FIELD_MAXfunction fbnic_get_ringparamfunction fbnic_set_ringsfunction fbnic_set_ringparamfunction fbnic_get_rxb_enqueue_stringsfunction fbnic_get_rxb_fifo_stringsfunction fbnic_get_rxb_dequeue_stringsfunction fbnic_get_xdp_queue_stringsfunction fbnic_get_stringsfunction fbnic_report_hw_statsfunction fbnic_get_xdp_queue_statsfunction fbnic_get_ethtool_statsfunction fbnic_get_sset_countfunction fbnic_get_rss_hash_idxfunction fbnic_get_cls_rule_allfunction fbnic_get_cls_rulefunction fbnic_get_rx_ring_countfunction fbnic_get_rxnfcfunction fbnic_cls_rule_any_locfunction fbnic_set_cls_rule_insfunction fbnic_clear_nfc_macdafunction fbnic_clear_nfc_ip_addrfunction fbnic_set_cls_rule_delfunction fbnic_set_rxnfcfunction fbnic_get_rxfh_key_sizefunction fbnic_get_rxfh_indir_sizefunction fbnic_get_rxfhfunction fbnic_set_indirfunction fbnic_set_rxfhfunction fbnic_get_rss_hash_optsfunction fbnic_set_rss_hash_optsfunction fbnic_modify_rxfh_contextfunction fbnic_create_rxfh_contextfunction fbnic_remove_rxfh_contextfunction fbnic_ethtool_regs_testfunction fbnic_ethtool_msix_testfunction fbnic_ethtool_mbx_self_test
Annotated Snippet
struct fbnic_stat {
u8 string[ETH_GSTRING_LEN];
unsigned int size;
unsigned int offset;
};
#define FBNIC_STAT_FIELDS(type, name, stat) { \
.string = name, \
.size = sizeof_field(struct type, stat), \
.offset = offsetof(struct type, stat), \
}
/* Hardware statistics not captured in rtnl_link_stats */
#define FBNIC_HW_STAT(name, stat) \
FBNIC_STAT_FIELDS(fbnic_hw_stats, name, stat)
static const struct fbnic_stat fbnic_gstrings_hw_stats[] = {
/* TTI */
FBNIC_HW_STAT("tti_cm_drop_frames", tti.cm_drop.frames),
FBNIC_HW_STAT("tti_cm_drop_bytes", tti.cm_drop.bytes),
FBNIC_HW_STAT("tti_frame_drop_frames", tti.frame_drop.frames),
FBNIC_HW_STAT("tti_frame_drop_bytes", tti.frame_drop.bytes),
FBNIC_HW_STAT("tti_tbi_drop_frames", tti.tbi_drop.frames),
FBNIC_HW_STAT("tti_tbi_drop_bytes", tti.tbi_drop.bytes),
/* TMI */
FBNIC_HW_STAT("ptp_illegal_req", tmi.ptp_illegal_req),
FBNIC_HW_STAT("ptp_good_ts", tmi.ptp_good_ts),
FBNIC_HW_STAT("ptp_bad_ts", tmi.ptp_bad_ts),
/* RPC */
FBNIC_HW_STAT("rpc_unkn_etype", rpc.unkn_etype),
FBNIC_HW_STAT("rpc_unkn_ext_hdr", rpc.unkn_ext_hdr),
FBNIC_HW_STAT("rpc_ipv4_frag", rpc.ipv4_frag),
FBNIC_HW_STAT("rpc_ipv6_frag", rpc.ipv6_frag),
FBNIC_HW_STAT("rpc_ipv4_esp", rpc.ipv4_esp),
FBNIC_HW_STAT("rpc_ipv6_esp", rpc.ipv6_esp),
FBNIC_HW_STAT("rpc_tcp_opt_err", rpc.tcp_opt_err),
FBNIC_HW_STAT("rpc_out_of_hdr_err", rpc.out_of_hdr_err),
};
#define FBNIC_HW_FIXED_STATS_LEN ARRAY_SIZE(fbnic_gstrings_hw_stats)
#define FBNIC_RXB_ENQUEUE_STAT(name, stat) \
FBNIC_STAT_FIELDS(fbnic_rxb_enqueue_stats, name, stat)
static const struct fbnic_stat fbnic_gstrings_rxb_enqueue_stats[] = {
FBNIC_RXB_ENQUEUE_STAT("rxb_integrity_err%u", integrity_err),
FBNIC_RXB_ENQUEUE_STAT("rxb_mac_err%u", mac_err),
FBNIC_RXB_ENQUEUE_STAT("rxb_parser_err%u", parser_err),
FBNIC_RXB_ENQUEUE_STAT("rxb_frm_err%u", frm_err),
FBNIC_RXB_ENQUEUE_STAT("rxb_drbo%u_frames", drbo.frames),
FBNIC_RXB_ENQUEUE_STAT("rxb_drbo%u_bytes", drbo.bytes),
};
#define FBNIC_HW_RXB_ENQUEUE_STATS_LEN \
ARRAY_SIZE(fbnic_gstrings_rxb_enqueue_stats)
#define FBNIC_RXB_FIFO_STAT(name, stat) \
FBNIC_STAT_FIELDS(fbnic_rxb_fifo_stats, name, stat)
static const struct fbnic_stat fbnic_gstrings_rxb_fifo_stats[] = {
FBNIC_RXB_FIFO_STAT("rxb_fifo%u_drop", trans_drop),
FBNIC_RXB_FIFO_STAT("rxb_fifo%u_dropped_frames", drop.frames),
FBNIC_RXB_FIFO_STAT("rxb_fifo%u_ecn", trans_ecn),
FBNIC_RXB_FIFO_STAT("rxb_fifo%u_level", level),
};
#define FBNIC_HW_RXB_FIFO_STATS_LEN ARRAY_SIZE(fbnic_gstrings_rxb_fifo_stats)
#define FBNIC_RXB_DEQUEUE_STAT(name, stat) \
FBNIC_STAT_FIELDS(fbnic_rxb_dequeue_stats, name, stat)
static const struct fbnic_stat fbnic_gstrings_rxb_dequeue_stats[] = {
FBNIC_RXB_DEQUEUE_STAT("rxb_intf%u_frames", intf.frames),
FBNIC_RXB_DEQUEUE_STAT("rxb_intf%u_bytes", intf.bytes),
FBNIC_RXB_DEQUEUE_STAT("rxb_pbuf%u_frames", pbuf.frames),
FBNIC_RXB_DEQUEUE_STAT("rxb_pbuf%u_bytes", pbuf.bytes),
};
#define FBNIC_HW_RXB_DEQUEUE_STATS_LEN \
ARRAY_SIZE(fbnic_gstrings_rxb_dequeue_stats)
#define FBNIC_HW_Q_STAT(name, stat) \
FBNIC_STAT_FIELDS(fbnic_hw_q_stats, name, stat.value)
static const struct fbnic_stat fbnic_gstrings_hw_q_stats[] = {
FBNIC_HW_Q_STAT("rde_%u_pkt_err", rde_pkt_err),
FBNIC_HW_Q_STAT("rde_%u_pkt_cq_drop", rde_pkt_cq_drop),
Annotation
- Immediate include surface: `linux/ethtool.h`, `linux/ethtool_netlink.h`, `linux/netdevice.h`, `linux/pci.h`, `net/ipv6.h`, `fbnic.h`, `fbnic_netdev.h`, `fbnic_tlv.h`.
- Detected declarations: `struct fbnic_stat`, `enum fbnic_self_test_results`, `function fbnic_get_drvinfo`, `function fbnic_get_regs_len`, `function fbnic_get_regs`, `function fbnic_clone_swap_cfg`, `function fbnic_aggregate_vector_counters`, `function fbnic_clone_swap`, `function fbnic_clone_free`, `function fbnic_get_coalesce`.
- 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.