drivers/net/ethernet/meta/fbnic/fbnic_txrx.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/meta/fbnic/fbnic_txrx.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/meta/fbnic/fbnic_txrx.h
Extension
.h
Size
5888 bytes
Lines
208
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 fbnic_pkt_buff {
	struct xdp_buff buff;
	ktime_t hwtstamp;
	bool add_frag_failed;
};

struct fbnic_queue_stats {
	u64 packets;
	u64 bytes;
	union {
		struct {
			u64 csum_partial;
			u64 lso;
			u64 ts_packets;
			u64 ts_lost;
			u64 stop;
			u64 wake;
		} twq;
		struct {
			u64 alloc_failed;
			u64 csum_complete;
			u64 csum_none;
			u64 length_errors;
		} rx;
		struct {
			u64 alloc_failed;
		} bdq;
	};
	u64 dropped;
	struct u64_stats_sync syncp;
};

#define FBNIC_PAGECNT_BIAS_MAX	PAGE_SIZE

struct fbnic_rx_buf {
	netmem_ref netmem;
	long pagecnt_bias;
};

struct fbnic_ring {
	/* Pointer to buffer specific info */
	union {
		struct fbnic_pkt_buff *pkt;	/* RCQ */
		struct fbnic_rx_buf *rx_buf;	/* BDQ */
		void **tx_buf;			/* TWQ */
		void *buffer;			/* Generic pointer */
	};

	u32 __iomem *doorbell;		/* Pointer to CSR space for ring */
	__le64 *desc;			/* Descriptor ring memory */
	u16 size_mask;			/* Size of ring in descriptors - 1 */
	u8 q_idx;			/* Logical netdev ring index */
	u8 flags;			/* Ring flags (FBNIC_RING_F_*) */

	u32 head, tail;			/* Head/Tail of ring */

	union {
		/* Rx BDQs only */
		struct page_pool *page_pool;

		/* Deferred_head is used to cache the head for TWQ1 if
		 * an attempt is made to clean TWQ1 with zero napi_budget.
		 * We do not use it for any other ring.
		 */
		s32 deferred_head;
	};

	struct fbnic_queue_stats stats;

	/* Slow path fields follow */
	dma_addr_t dma;			/* Phys addr of descriptor memory */
	size_t size;			/* Size of descriptor ring in memory */
};

struct fbnic_q_triad {
	struct fbnic_ring sub0, sub1, cmpl;
	struct xdp_rxq_info xdp_rxq;
};

struct fbnic_napi_vector {
	struct napi_struct napi;
	struct device *dev;		/* Device for DMA unmapping */
	struct fbnic_dev *fbd;
	struct dentry *dbg_nv;

	u16 v_idx;
	u8 txt_count;
	u8 rxt_count;

	struct fbnic_q_triad qt[];

Annotation

Implementation Notes