drivers/net/ethernet/huawei/hinic3/hinic3_rx.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/huawei/hinic3/hinic3_rx.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/huawei/hinic3/hinic3_rx.h
Extension
.h
Size
3776 bytes
Lines
129
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 hinic3_rxq_stats {
	u64                   packets;
	u64                   bytes;
	u64                   errors;
	u64                   csum_errors;
	u64                   other_errors;
	u64                   dropped;
	u64                   rx_buf_empty;
	u64                   alloc_skb_err;
	u64                   alloc_rx_buf_err;
	u64                   restore_drop_sge;
	struct u64_stats_sync syncp;
};

/* RX Completion information that is provided by HW for a specific RX WQE */
struct hinic3_rq_cqe {
	__le32 status;
	__le32 vlan_len;
	__le32 offload_type;
	__le32 rsvd3;
	__le32 rsvd4;
	__le32 rsvd5;
	__le32 rsvd6;
	__le32 pkt_info;
};

struct hinic3_rq_wqe {
	__le32 buf_hi_addr;
	__le32 buf_lo_addr;
	__le32 cqe_hi_addr;
	__le32 cqe_lo_addr;
};

struct hinic3_rx_info {
	struct page      *page;
	u32              page_offset;
};

struct hinic3_rxq {
	struct net_device       *netdev;

	u16                     q_id;
	u32                     q_depth;
	u32                     q_mask;

	u16                     buf_len;
	u32                     buf_len_shift;

	struct hinic3_rxq_stats rxq_stats;
	u32                     cons_idx;
	u32                     delta;

	u32                     irq_id;
	u16                     msix_entry_idx;

	/* cqe_arr and rx_info are arrays of rq_depth elements. Each element is
	 * statically associated (by index) to a specific rq_wqe.
	 */
	struct hinic3_rq_cqe   *cqe_arr;
	struct hinic3_rx_info  *rx_info;
	struct page_pool       *page_pool;

	struct hinic3_io_queue *rq;

	struct hinic3_irq_cfg  *irq_cfg;
	u16                    next_to_alloc;
	u16                    next_to_update;
	struct device          *dev; /* device for DMA mapping */

	dma_addr_t             cqe_start_paddr;

	struct dim             dim;

	u8                     last_coalesc_timer_cfg;
	u8                     last_pending_limit;
} ____cacheline_aligned;

struct hinic3_dyna_rxq_res {
	u16                   next_to_alloc;
	struct hinic3_rx_info *rx_info;
	dma_addr_t            cqe_start_paddr;
	void                  *cqe_start_vaddr;
	struct page_pool      *page_pool;
};

int hinic3_alloc_rxqs(struct net_device *netdev);
void hinic3_free_rxqs(struct net_device *netdev);

int hinic3_alloc_rxqs_res(struct net_device *netdev, u16 num_rq,
			  u32 rq_depth, struct hinic3_dyna_rxq_res *rxqs_res);

Annotation

Implementation Notes