drivers/net/ethernet/marvell/octeon_ep/octep_tx.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/marvell/octeon_ep/octep_tx.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/marvell/octeon_ep/octep_tx.h
Extension
.h
Size
7825 bytes
Lines
318
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 octep_tx_sglist_desc {
	u16 len[4];
	dma_addr_t dma_ptr[4];
};

static_assert(sizeof(struct octep_tx_sglist_desc) == 40);

/* Each Scatter/Gather entry sent to hardwar hold four pointers.
 * So, number of entries required is (MAX_SKB_FRAGS + 1)/4, where '+1'
 * is for main skb which also goes as a gather buffer to Octeon hardware.
 * To allocate sufficient SGLIST entries for a packet with max fragments,
 * align by adding 3 before calcuating max SGLIST entries per packet.
 */
#define OCTEP_SGLIST_ENTRIES_PER_PKT ((MAX_SKB_FRAGS + 1 + 3) / 4)
#define OCTEP_SGLIST_SIZE_PER_PKT \
	(OCTEP_SGLIST_ENTRIES_PER_PKT * sizeof(struct octep_tx_sglist_desc))

struct octep_tx_buffer {
	struct sk_buff *skb;
	dma_addr_t dma;
	struct octep_tx_sglist_desc *sglist;
	dma_addr_t sglist_dma;
	u8 gather;
};

#define OCTEP_IQ_TXBUFF_INFO_SIZE (sizeof(struct octep_tx_buffer))

/* Hardware interface Tx statistics */
struct octep_iface_tx_stats {
	/* Total frames sent on the interface */
	u64 pkts;

	/* Total octets sent on the interface */
	u64 octs;

	/* Packets sent to a broadcast DMAC */
	u64 bcst;

	/* Packets sent to the multicast DMAC */
	u64 mcst;

	/* Packets dropped due to excessive collisions */
	u64 xscol;

	/* Packets dropped due to excessive deferral */
	u64 xsdef;

	/* Packets sent that experienced multiple collisions before successful
	 * transmission
	 */
	u64 mcol;

	/* Packets sent that experienced a single collision before successful
	 * transmission
	 */
	u64 scol;

	/* Packets sent with an octet count < 64 */
	u64 hist_lt64;

	/* Packets sent with an octet count == 64 */
	u64 hist_eq64;

	/* Packets sent with an octet count of 65–127 */
	u64 hist_65to127;

	/* Packets sent with an octet count of 128–255 */
	u64 hist_128to255;

	/* Packets sent with an octet count of 256–511 */
	u64 hist_256to511;

	/* Packets sent with an octet count of 512–1023 */
	u64 hist_512to1023;

	/* Packets sent with an octet count of 1024-1518 */
	u64 hist_1024to1518;

	/* Packets sent with an octet count of > 1518 */
	u64 hist_gt1518;

	/* Packets sent that experienced a transmit underflow and were
	 * truncated
	 */
	u64 undflw;

	/* Control/PAUSE packets sent */
	u64 ctl;
};

Annotation

Implementation Notes