网卡驱动部分数据结构关系图
2020-08-27 15:01:13 15 举报
LiquidIO网卡驱动收包重要结构关系图
作者其他创作
大纲/内容
struct octeon_droq_desc *desc_ring;// 队列描述符(VP)
char cb[48] __aligned(8);// Control buffer. Free for use by every layer. Put private vars here
struct octeon_recv_buffer
u32 buffer_size;// The size of each buffer pointed by the buffer pointer.
...
zero-copy
u32 poll_mode;
代码注释
struct cavium_pci_device *pci_dev;
struct octeon_skb_page_info *pg_info =((struct octeon_skb_page_info *)(skb->cb));
u32 read_idx;// 读指针
u32 write_idx;// 写指针
struct octeon_skb_page_info
cavium_atomic_t pkts_pending;// 待处理的数据包个数
u64 buffer_ptr;
struct octeon_device
struct sk_buff
cavium_dma_addr_t dma;
struct octeon_recv_buffer *recv_buf_list;
get_rbd(buffer);
u32 q_no;
struct octeon_droq_ops ops;
struct net_device
计算表达式
static void liquidio_napi_drv_callback(void *arg)
struct octeon_droq
struct page *page;
u32 pkt_count;// 记录上一次总的收包数。记录pkts_sent_reg的值
struct octeon_droq_desc// 传输队列描述符
char\t\t\tname[IFNAMSIZ];
u64 info_ptr;
数据结构成员
struct octeon_droq_ops
void cavium_iomem *pkts_sent_reg;// 网卡DMA已完成的数据包的总数,由硬件写入(SLI_PKT(0..63)_CNTS)
struct octeon_device *oct_dev;
void *buffer;
alloc_page(GFP_ATOMIC);
void (*napi_fn)(void *);
自定义数据结构名
buffer_ptr = dma + page_offset;
u32 refill_threshold;// buffer重装阈值
struct octeon_skb_page_info pg_info;
handle
struct page *vmalloc_to_page(const void *vmalloc_addr)
size_t desc_ring_dma;// 队列描述符(DMA映射的总线地址BP)
u8 *data;
颜色图示说明
return
struct octeon_droq *droq[MAX_POSSIBLE_OCTEON_OUTPUT_QUEUES];
no-zero-copy
u32 refill_count;// 待重装的buffer个数
unsigned int page_offset;
函数调用结果返回
u32 max_count;// Number of descriptors in this ring.
内核数据结构名
u32 drop_on_max;
static inline struct sk_buff *dev_alloc_skb(unsigned int length)return buf;
void *farg;
void cavium_volatile_t cavium_iomem *pkts_credit_reg;// Doorbell寄存器(SLI_PKT(0..63)_SLIST_BAOFF_DBELL)
收藏
0 条评论
下一页