gve.h (03ab8e6297acd1bc0eedaa050e2a1635c576fd11) gve.h (82fd151d38d9fda714c5bb2e9e79ecd6bdc72da6)
1/* SPDX-License-Identifier: (GPL-2.0 OR MIT)
2 * Google virtual Ethernet (gve) driver
3 *
4 * Copyright (C) 2015-2021 Google, Inc.
5 */
6
7#ifndef _GVE_H_
8#define _GVE_H_

--- 46 unchanged lines hidden (view full) ---

55};
56
57/* The page info for a single slot in the RX data queue */
58struct gve_rx_slot_page_info {
59 struct page *page;
60 void *page_address;
61 u32 page_offset; /* offset to write to in page */
62 int pagecnt_bias; /* expected pagecnt if only the driver has a ref */
1/* SPDX-License-Identifier: (GPL-2.0 OR MIT)
2 * Google virtual Ethernet (gve) driver
3 *
4 * Copyright (C) 2015-2021 Google, Inc.
5 */
6
7#ifndef _GVE_H_
8#define _GVE_H_

--- 46 unchanged lines hidden (view full) ---

55};
56
57/* The page info for a single slot in the RX data queue */
58struct gve_rx_slot_page_info {
59 struct page *page;
60 void *page_address;
61 u32 page_offset; /* offset to write to in page */
62 int pagecnt_bias; /* expected pagecnt if only the driver has a ref */
63 u8 can_flip;
63 u16 pad; /* adjustment for rx padding */
64 u8 can_flip; /* tracks if the networking stack is using the page */
64};
65
66/* A list of pages registered with the device during setup and used by a queue
67 * as buffers
68 */
69struct gve_queue_page_list {
70 u32 id; /* unique id */
71 u32 num_entries;

--- 72 unchanged lines hidden (view full) ---

144
145/* A single received packet split across multiple buffers may be
146 * reconstructed using the information in this structure.
147 */
148struct gve_rx_ctx {
149 /* head and tail of skb chain for the current packet or NULL if none */
150 struct sk_buff *skb_head;
151 struct sk_buff *skb_tail;
65};
66
67/* A list of pages registered with the device during setup and used by a queue
68 * as buffers
69 */
70struct gve_queue_page_list {
71 u32 id; /* unique id */
72 u32 num_entries;

--- 72 unchanged lines hidden (view full) ---

145
146/* A single received packet split across multiple buffers may be
147 * reconstructed using the information in this structure.
148 */
149struct gve_rx_ctx {
150 /* head and tail of skb chain for the current packet or NULL if none */
151 struct sk_buff *skb_head;
152 struct sk_buff *skb_tail;
152 u16 total_expected_size;
153 u8 expected_frag_cnt;
154 u8 curr_frag_cnt;
155 u8 reuse_frags;
153 u32 total_size;
154 u8 frag_cnt;
155 bool drop_pkt;
156};
157
156};
157
158struct gve_rx_cnts {
159 u32 ok_pkt_bytes;
160 u16 ok_pkt_cnt;
161 u16 total_pkt_cnt;
162 u16 cont_pkt_cnt;
163 u16 desc_err_pkt_cnt;
164};
165
158/* Contains datapath state used to represent an RX queue. */
159struct gve_rx_ring {
160 struct gve_priv *gve;
161 union {
162 /* GQI fields */
163 struct {
164 struct gve_rx_desc_queue desc;
165 struct gve_rx_data_queue data;
166
167 /* threshold for posting new buffs and descs */
168 u32 db_threshold;
169 u16 packet_buffer_size;
166/* Contains datapath state used to represent an RX queue. */
167struct gve_rx_ring {
168 struct gve_priv *gve;
169 union {
170 /* GQI fields */
171 struct {
172 struct gve_rx_desc_queue desc;
173 struct gve_rx_data_queue data;
174
175 /* threshold for posting new buffs and descs */
176 u32 db_threshold;
177 u16 packet_buffer_size;
178
179 u32 qpl_copy_pool_mask;
180 u32 qpl_copy_pool_head;
181 struct gve_rx_slot_page_info *qpl_copy_pool;
170 };
171
172 /* DQO fields. */
173 struct {
174 struct gve_rx_buf_queue_dqo bufq;
175 struct gve_rx_compl_queue_dqo complq;
176
177 struct gve_rx_buf_state_dqo *buf_states;

--- 33 unchanged lines hidden (view full) ---

211 u32 mask; /* masks the cnt and fill_cnt to the size of the ring */
212 u64 rx_copybreak_pkt; /* free-running count of copybreak packets */
213 u64 rx_copied_pkt; /* free-running total number of copied packets */
214 u64 rx_skb_alloc_fail; /* free-running count of skb alloc fails */
215 u64 rx_buf_alloc_fail; /* free-running count of buffer alloc fails */
216 u64 rx_desc_err_dropped_pkt; /* free-running count of packets dropped by descriptor error */
217 u64 rx_cont_packet_cnt; /* free-running multi-fragment packets received */
218 u64 rx_frag_flip_cnt; /* free-running count of rx segments where page_flip was used */
182 };
183
184 /* DQO fields. */
185 struct {
186 struct gve_rx_buf_queue_dqo bufq;
187 struct gve_rx_compl_queue_dqo complq;
188
189 struct gve_rx_buf_state_dqo *buf_states;

--- 33 unchanged lines hidden (view full) ---

223 u32 mask; /* masks the cnt and fill_cnt to the size of the ring */
224 u64 rx_copybreak_pkt; /* free-running count of copybreak packets */
225 u64 rx_copied_pkt; /* free-running total number of copied packets */
226 u64 rx_skb_alloc_fail; /* free-running count of skb alloc fails */
227 u64 rx_buf_alloc_fail; /* free-running count of buffer alloc fails */
228 u64 rx_desc_err_dropped_pkt; /* free-running count of packets dropped by descriptor error */
229 u64 rx_cont_packet_cnt; /* free-running multi-fragment packets received */
230 u64 rx_frag_flip_cnt; /* free-running count of rx segments where page_flip was used */
219 u64 rx_frag_copy_cnt; /* free-running count of rx segments copied into skb linear portion */
231 u64 rx_frag_copy_cnt; /* free-running count of rx segments copied */
232 u64 rx_frag_alloc_cnt; /* free-running count of rx page allocations */
233
220 u32 q_num; /* queue index */
221 u32 ntfy_id; /* notification block index */
222 struct gve_queue_resources *q_resources; /* head and tail pointer idx */
223 dma_addr_t q_resources_bus; /* dma address for the queue resources */
224 struct u64_stats_sync statss; /* sync stats for 32bit archs */
225
226 struct gve_rx_ctx ctx; /* Info for packet currently being processed in this ring. */
227};

--- 648 unchanged lines hidden ---
234 u32 q_num; /* queue index */
235 u32 ntfy_id; /* notification block index */
236 struct gve_queue_resources *q_resources; /* head and tail pointer idx */
237 dma_addr_t q_resources_bus; /* dma address for the queue resources */
238 struct u64_stats_sync statss; /* sync stats for 32bit archs */
239
240 struct gve_rx_ctx ctx; /* Info for packet currently being processed in this ring. */
241};

--- 648 unchanged lines hidden ---