hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/xen-netback/common.h
....@@ -48,7 +48,6 @@
4848 #include <linux/debugfs.h>
4949
5050 typedef unsigned int pending_ring_idx_t;
51
-#define INVALID_PENDING_RING_IDX (~0U)
5251
5352 struct pending_tx_info {
5453 struct xen_netif_tx_request req; /* tx request */
....@@ -81,8 +80,6 @@
8180
8281 /* Discriminate from any valid pending_idx value. */
8382 #define INVALID_PENDING_IDX 0xFFFF
84
-
85
-#define MAX_BUFFER_OFFSET XEN_PAGE_SIZE
8683
8784 #define MAX_PENDING_REQS XEN_NETIF_TX_RING_SIZE
8885
....@@ -169,7 +166,7 @@
169166 struct pending_tx_info pending_tx_info[MAX_PENDING_REQS];
170167 grant_handle_t grant_tx_handle[MAX_PENDING_REQS];
171168
172
- struct gnttab_copy tx_copy_ops[MAX_PENDING_REQS];
169
+ struct gnttab_copy tx_copy_ops[2 * MAX_PENDING_REQS];
173170 struct gnttab_map_grant_ref tx_map_ops[MAX_PENDING_REQS];
174171 struct gnttab_unmap_grant_ref tx_unmap_ops[MAX_PENDING_REQS];
175172 /* passed to gnttab_[un]map_refs with pages under (un)mapping */
....@@ -263,6 +260,22 @@
263260 struct xenvif_hash_cache cache;
264261 };
265262
263
+struct backend_info {
264
+ struct xenbus_device *dev;
265
+ struct xenvif *vif;
266
+
267
+ /* This is the state that will be reflected in xenstore when any
268
+ * active hotplug script completes.
269
+ */
270
+ enum xenbus_state state;
271
+
272
+ enum xenbus_state frontend_state;
273
+ struct xenbus_watch hotplug_status_watch;
274
+ u8 have_hotplug_status_watch:1;
275
+
276
+ const char *hotplug_script;
277
+};
278
+
266279 struct xenvif {
267280 /* Unique identifier for this interface. */
268281 domid_t domid;
....@@ -279,6 +292,9 @@
279292 u8 ip_csum:1;
280293 u8 ipv6_csum:1;
281294 u8 multicast_control:1;
295
+
296
+ /* headroom requested by xen-netfront */
297
+ u16 xdp_headroom;
282298
283299 /* Is this interface disabled? True when backend discovers
284300 * frontend is rogue.
....@@ -297,6 +313,8 @@
297313
298314 struct xenbus_watch credit_watch;
299315 struct xenbus_watch mcast_ctrl_watch;
316
+
317
+ struct backend_info *be;
300318
301319 spinlock_t lock;
302320
....@@ -346,11 +364,6 @@
346364 int xenvif_xenbus_init(void);
347365 void xenvif_xenbus_fini(void);
348366
349
-int xenvif_schedulable(struct xenvif *vif);
350
-
351
-int xenvif_queue_stopped(struct xenvif_queue *queue);
352
-void xenvif_wake_queue(struct xenvif_queue *queue);
353
-
354367 /* (Un)Map communication rings. */
355368 void xenvif_unmap_frontend_data_rings(struct xenvif_queue *queue);
356369 int xenvif_map_frontend_data_rings(struct xenvif_queue *queue,
....@@ -373,16 +386,12 @@
373386 irqreturn_t xenvif_ctrl_irq_fn(int irq, void *data);
374387
375388 bool xenvif_have_rx_work(struct xenvif_queue *queue, bool test_kthread);
376
-void xenvif_rx_action(struct xenvif_queue *queue);
377
-void xenvif_rx_queue_tail(struct xenvif_queue *queue, struct sk_buff *skb);
389
+bool xenvif_rx_queue_tail(struct xenvif_queue *queue, struct sk_buff *skb);
378390
379391 void xenvif_carrier_on(struct xenvif *vif);
380392
381393 /* Callback from stack when TX packet can be released */
382394 void xenvif_zerocopy_callback(struct ubuf_info *ubuf, bool zerocopy_success);
383
-
384
-/* Unmap a pending page and release it back to the guest */
385
-void xenvif_idx_unmap(struct xenvif_queue *queue, u16 pending_idx);
386395
387396 static inline pending_ring_idx_t nr_pending_reqs(struct xenvif_queue *queue)
388397 {
....@@ -393,6 +402,7 @@
393402 irqreturn_t xenvif_interrupt(int irq, void *dev_id);
394403
395404 extern bool separate_tx_rx_irq;
405
+extern bool provides_xdp_headroom;
396406
397407 extern unsigned int rx_drain_timeout_msecs;
398408 extern unsigned int rx_stall_timeout_msecs;