drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h- Extension
.h- Size
- 36315 bytes
- Lines
- 1262
- 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.
- 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/ethtool.hlinux/pci.hlinux/iommu.hlinux/net_tstamp.hlinux/ptp_clock_kernel.hlinux/timecounter.hlinux/soc/marvell/silicons.hlinux/soc/marvell/octeontx2/asm.hnet/macsec.hnet/pkt_cls.hnet/devlink.hlinux/time64.hlinux/dim.huapi/linux/if_macsec.hnet/page_pool/helpers.hmbox.hnpc.hotx2_reg.hotx2_txrx.hotx2_devlink.hrvu.hrvu_trace.hqos.hrep.hcn10k_ipsec.hcn20k.h
Detected Declarations
struct otx2_lmt_infostruct otx2_rss_infostruct otx2_dev_statsstruct otx2_drv_statsstruct mboxstruct otx2_hwstruct otx2_vf_configstruct flr_workstruct refill_workstruct ptpv2_tstampstruct otx2_ptpstruct otx2_mac_tablestruct otx2_flow_configstruct otx2_tc_flow_statsstruct otx2_tc_flowstruct dev_hw_opsstruct cn10k_txsc_statsstruct cn10k_rxsc_statsstruct cn10k_mcs_txscstruct cn10k_mcs_rxscstruct cn10k_mcs_cfgstruct pf_irq_datastruct otx2_nicenum arua_mapped_qtypesenum otx2_errlvlenum otx2_errcodes_reenum otx2_xdp_actionenum vfpermfunction is_otx2_lbkvffunction is_96xx_A0function is_96xx_B0function is_otx2_sdp_repfunction is_dev_otx2function is_dev_cn10kbfunction is_dev_cn10ka_b0function otx2_setup_dev_hw_settingsfunction otx2_write64function otx2_read64function otx2_mbox_bbuf_initfunction otx2_sync_mbox_bbuffunction otx2_write128function otx2_atomic64_addfunction otx2_atomic64_addfunction __cn10k_aura_freeptrfunction cn10k_aura_freeptrfunction otx2_aura_allocptrfunction otx2_aura_freeptrfunction otx2_get_pool_idx
Annotated Snippet
struct otx2_lmt_info {
u64 lmt_addr;
u16 lmt_id;
};
struct otx2_rss_info {
u8 enable;
u32 flowkey_cfg;
u16 rss_size;
#define RSS_HASH_KEY_SIZE 44 /* 352 bit key */
u8 key[RSS_HASH_KEY_SIZE];
u32 ind_tbl[MAX_RSS_INDIR_TBL_SIZE];
};
/* NIX (or NPC) RX errors */
enum otx2_errlvl {
NPC_ERRLVL_RE,
NPC_ERRLVL_LID_LA,
NPC_ERRLVL_LID_LB,
NPC_ERRLVL_LID_LC,
NPC_ERRLVL_LID_LD,
NPC_ERRLVL_LID_LE,
NPC_ERRLVL_LID_LF,
NPC_ERRLVL_LID_LG,
NPC_ERRLVL_LID_LH,
NPC_ERRLVL_NIX = 0x0F,
};
enum otx2_errcodes_re {
/* NPC_ERRLVL_RE errcodes */
ERRCODE_FCS = 0x7,
ERRCODE_FCS_RCV = 0x8,
ERRCODE_UNDERSIZE = 0x10,
ERRCODE_OVERSIZE = 0x11,
ERRCODE_OL2_LEN_MISMATCH = 0x12,
/* NPC_ERRLVL_NIX errcodes */
ERRCODE_OL3_LEN = 0x10,
ERRCODE_OL4_LEN = 0x11,
ERRCODE_OL4_CSUM = 0x12,
ERRCODE_IL3_LEN = 0x20,
ERRCODE_IL4_LEN = 0x21,
ERRCODE_IL4_CSUM = 0x22,
};
enum otx2_xdp_action {
OTX2_XDP_TX = BIT(0),
OTX2_XDP_REDIRECT = BIT(1),
OTX2_AF_XDP_FRAME = BIT(2),
};
struct otx2_dev_stats {
u64 rx_bytes;
u64 rx_frames;
u64 rx_ucast_frames;
u64 rx_bcast_frames;
u64 rx_mcast_frames;
u64 rx_drops;
u64 tx_bytes;
u64 tx_frames;
u64 tx_ucast_frames;
u64 tx_bcast_frames;
u64 tx_mcast_frames;
u64 tx_drops;
atomic_long_t tx_discards;
};
/* Driver counted stats */
struct otx2_drv_stats {
atomic_t rx_fcs_errs;
atomic_t rx_oversize_errs;
atomic_t rx_undersize_errs;
atomic_t rx_csum_errs;
atomic_t rx_len_errs;
atomic_t rx_other_errs;
};
struct mbox {
struct otx2_mbox mbox;
struct work_struct mbox_wrk;
struct otx2_mbox mbox_up;
struct work_struct mbox_up_wrk;
struct otx2_nic *pfvf;
void *bbuf_base; /* Bounce buffer for mbox memory */
struct mutex lock; /* serialize mailbox access */
int num_msgs; /* mbox number of messages */
int up_num_msgs; /* mbox_up number of messages */
};
/* Egress rate limiting definitions */
Annotation
- Immediate include surface: `linux/ethtool.h`, `linux/pci.h`, `linux/iommu.h`, `linux/net_tstamp.h`, `linux/ptp_clock_kernel.h`, `linux/timecounter.h`, `linux/soc/marvell/silicons.h`, `linux/soc/marvell/octeontx2/asm.h`.
- Detected declarations: `struct otx2_lmt_info`, `struct otx2_rss_info`, `struct otx2_dev_stats`, `struct otx2_drv_stats`, `struct mbox`, `struct otx2_hw`, `struct otx2_vf_config`, `struct flr_work`, `struct refill_work`, `struct ptpv2_tstamp`.
- 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.