drivers/net/ethernet/intel/ice/ice_txrx.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ice/ice_txrx.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/intel/ice/ice_txrx.h
Extension
.h
Size
13887 bytes
Lines
480
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 ice_tx_buf {
	union {
		struct ice_tx_desc *next_to_watch;
		u32 rs_idx;
	};
	union {
		void *raw_buf;		/* used for XDP_TX and FDir rules */
		struct sk_buff *skb;	/* used for .ndo_start_xmit() */
		struct xdp_frame *xdpf;	/* used for .ndo_xdp_xmit() */
		struct xdp_buff *xdp;	/* used for XDP_TX ZC */
	};
	unsigned int bytecount;
	union {
		unsigned int gso_segs;
		unsigned int nr_frags;	/* used for mbuf XDP */
	};
	u32 tx_flags:12;
	u32 type:4;			/* &ice_tx_buf_type */
	u32 vid:16;
	DEFINE_DMA_UNMAP_LEN(len);
	DEFINE_DMA_UNMAP_ADDR(dma);
};

struct ice_tx_offload_params {
	u64 cd_qw1;
	struct ice_tx_ring *tx_ring;
	u32 td_cmd;
	u32 td_offset;
	u32 td_l2tag1;
	u32 cd_tunnel_params;
	u16 cd_l2tag2;
	u16 cd_gcs_params;
	u8 header_len;
};

struct ice_ring_stats {
	struct rcu_head rcu;	/* to avoid race on free */
	struct u64_stats_sync syncp;
	struct_group(stats,
		u64_stats_t pkts;
		u64_stats_t bytes;
		union {
			struct_group(tx,
				u64_stats_t tx_restart_q;
				u64_stats_t tx_busy;
				u64_stats_t tx_linearize;
				/* negative if no pending Tx descriptors */
				int prev_pkt;
			);
			struct_group(rx,
				u64_stats_t rx_non_eop_descs;
				u64_stats_t rx_page_failed;
				u64_stats_t rx_buf_failed;
			);
		};
	);
};

/**
 * ice_stats_read - Read a single ring stat value
 * @stats: pointer to ring_stats structure for a queue
 * @member: the ice_ring_stats member to read
 *
 * Shorthand for reading a single 64-bit stat value from struct
 * ice_ring_stats.
 *
 * Return: the value of the requested stat.
 */
#define ice_stats_read(stats, member) ({				\
	struct ice_ring_stats *__stats = (stats);			\
	unsigned int start;						\
	u64 val;							\
	do {								\
		start = u64_stats_fetch_begin(&__stats->syncp);		\
		val = u64_stats_read(&__stats->member);			\
	} while (u64_stats_fetch_retry(&__stats->syncp, start));	\
	val;								\
})

/**
 * ice_stats_inc - Increment a single ring stat value
 * @stats: pointer to the ring_stats structure for a queue
 * @member: the ice_ring_stats member to increment
 *
 * Shorthand for incrementing a single 64-bit stat value in struct
 * ice_ring_stats.
 */
#define ice_stats_inc(stats, member) do {				\
	struct ice_ring_stats *__stats = (stats);			\
	u64_stats_update_begin(&__stats->syncp);			\

Annotation

Implementation Notes