drivers/net/ethernet/intel/fm10k/fm10k.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/fm10k/fm10k.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/fm10k/fm10k.h- Extension
.h- Size
- 15996 bytes
- Lines
- 567
- 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/types.hlinux/etherdevice.hlinux/cpumask.hlinux/rtnetlink.hlinux/if_vlan.hlinux/pci.hfm10k_pf.hfm10k_vf.h
Detected Declarations
struct fm10k_l2_accelstruct fm10k_tx_bufferstruct fm10k_rx_bufferstruct fm10k_queue_statsstruct fm10k_tx_queue_statsstruct fm10k_rx_queue_statsstruct fm10k_ringstruct fm10k_ring_containerstruct fm10k_q_vectorstruct fm10k_ring_featurestruct fm10k_iov_datastruct fm10k_macvlan_requeststruct fm10k_mac_requeststruct fm10k_vlan_requeststruct fm10k_intfcstruct fm10k_cbenum fm10k_ring_state_tenum fm10k_non_q_vectorsenum fm10k_ring_f_enumenum fm10k_macvlan_request_typeenum fm10k_flags_tenum fm10k_state_tenum fm10k_tx_flagsfunction fm10k_mbx_lockfunction fm10k_mbx_unlockfunction fm10k_mbx_trylockfunction fm10k_test_staterrfunction fm10k_desc_unusedfunction fm10k_dbg_q_vector_initfunction fm10k_dcbnl_set_ops
Annotated Snippet
struct fm10k_l2_accel {
int size;
u16 count;
u16 dglort;
struct rcu_head rcu;
struct net_device *macvlan[];
};
enum fm10k_ring_state_t {
__FM10K_TX_DETECT_HANG,
__FM10K_HANG_CHECK_ARMED,
__FM10K_TX_XPS_INIT_DONE,
/* This must be last and is used to calculate BITMAP size */
__FM10K_TX_STATE_SIZE__,
};
#define check_for_tx_hang(ring) \
test_bit(__FM10K_TX_DETECT_HANG, (ring)->state)
#define set_check_for_tx_hang(ring) \
set_bit(__FM10K_TX_DETECT_HANG, (ring)->state)
#define clear_check_for_tx_hang(ring) \
clear_bit(__FM10K_TX_DETECT_HANG, (ring)->state)
struct fm10k_tx_buffer {
struct fm10k_tx_desc *next_to_watch;
struct sk_buff *skb;
unsigned int bytecount;
u16 gso_segs;
u16 tx_flags;
DEFINE_DMA_UNMAP_ADDR(dma);
DEFINE_DMA_UNMAP_LEN(len);
};
struct fm10k_rx_buffer {
dma_addr_t dma;
struct page *page;
u32 page_offset;
};
struct fm10k_queue_stats {
u64 packets;
u64 bytes;
};
struct fm10k_tx_queue_stats {
u64 restart_queue;
u64 csum_err;
u64 tx_busy;
u64 tx_done_old;
u64 csum_good;
};
struct fm10k_rx_queue_stats {
u64 alloc_failed;
u64 csum_err;
u64 errors;
u64 csum_good;
u64 switch_errors;
u64 drops;
u64 pp_errors;
u64 link_errors;
u64 length_errors;
};
struct fm10k_ring {
struct fm10k_q_vector *q_vector;/* backpointer to host q_vector */
struct net_device *netdev; /* netdev ring belongs to */
struct device *dev; /* device for DMA mapping */
struct fm10k_l2_accel __rcu *l2_accel; /* L2 acceleration list */
void *desc; /* descriptor ring memory */
union {
struct fm10k_tx_buffer *tx_buffer;
struct fm10k_rx_buffer *rx_buffer;
};
u32 __iomem *tail;
DECLARE_BITMAP(state, __FM10K_TX_STATE_SIZE__);
dma_addr_t dma; /* phys. address of descriptor ring */
unsigned int size; /* length in bytes */
u8 queue_index; /* needed for queue management */
u8 reg_idx; /* holds the special value that gets
* the hardware register offset
* associated with this ring, which is
* different for DCB and RSS modes
*/
u8 qos_pc; /* priority class of queue */
u16 vid; /* default VLAN ID of queue */
u16 count; /* amount of descriptors */
u16 next_to_alloc;
Annotation
- Immediate include surface: `linux/types.h`, `linux/etherdevice.h`, `linux/cpumask.h`, `linux/rtnetlink.h`, `linux/if_vlan.h`, `linux/pci.h`, `fm10k_pf.h`, `fm10k_vf.h`.
- Detected declarations: `struct fm10k_l2_accel`, `struct fm10k_tx_buffer`, `struct fm10k_rx_buffer`, `struct fm10k_queue_stats`, `struct fm10k_tx_queue_stats`, `struct fm10k_rx_queue_stats`, `struct fm10k_ring`, `struct fm10k_ring_container`, `struct fm10k_q_vector`, `struct fm10k_ring_feature`.
- 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.