| .. | .. |
|---|
| 48 | 48 | #include <linux/debugfs.h> |
|---|
| 49 | 49 | |
|---|
| 50 | 50 | typedef unsigned int pending_ring_idx_t; |
|---|
| 51 | | -#define INVALID_PENDING_RING_IDX (~0U) |
|---|
| 52 | 51 | |
|---|
| 53 | 52 | struct pending_tx_info { |
|---|
| 54 | 53 | struct xen_netif_tx_request req; /* tx request */ |
|---|
| .. | .. |
|---|
| 81 | 80 | |
|---|
| 82 | 81 | /* Discriminate from any valid pending_idx value. */ |
|---|
| 83 | 82 | #define INVALID_PENDING_IDX 0xFFFF |
|---|
| 84 | | - |
|---|
| 85 | | -#define MAX_BUFFER_OFFSET XEN_PAGE_SIZE |
|---|
| 86 | 83 | |
|---|
| 87 | 84 | #define MAX_PENDING_REQS XEN_NETIF_TX_RING_SIZE |
|---|
| 88 | 85 | |
|---|
| .. | .. |
|---|
| 263 | 260 | struct xenvif_hash_cache cache; |
|---|
| 264 | 261 | }; |
|---|
| 265 | 262 | |
|---|
| 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 | + |
|---|
| 266 | 279 | struct xenvif { |
|---|
| 267 | 280 | /* Unique identifier for this interface. */ |
|---|
| 268 | 281 | domid_t domid; |
|---|
| .. | .. |
|---|
| 279 | 292 | u8 ip_csum:1; |
|---|
| 280 | 293 | u8 ipv6_csum:1; |
|---|
| 281 | 294 | u8 multicast_control:1; |
|---|
| 295 | + |
|---|
| 296 | + /* headroom requested by xen-netfront */ |
|---|
| 297 | + u16 xdp_headroom; |
|---|
| 282 | 298 | |
|---|
| 283 | 299 | /* Is this interface disabled? True when backend discovers |
|---|
| 284 | 300 | * frontend is rogue. |
|---|
| .. | .. |
|---|
| 297 | 313 | |
|---|
| 298 | 314 | struct xenbus_watch credit_watch; |
|---|
| 299 | 315 | struct xenbus_watch mcast_ctrl_watch; |
|---|
| 316 | + |
|---|
| 317 | + struct backend_info *be; |
|---|
| 300 | 318 | |
|---|
| 301 | 319 | spinlock_t lock; |
|---|
| 302 | 320 | |
|---|
| .. | .. |
|---|
| 346 | 364 | int xenvif_xenbus_init(void); |
|---|
| 347 | 365 | void xenvif_xenbus_fini(void); |
|---|
| 348 | 366 | |
|---|
| 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 | | - |
|---|
| 354 | 367 | /* (Un)Map communication rings. */ |
|---|
| 355 | 368 | void xenvif_unmap_frontend_data_rings(struct xenvif_queue *queue); |
|---|
| 356 | 369 | int xenvif_map_frontend_data_rings(struct xenvif_queue *queue, |
|---|
| .. | .. |
|---|
| 373 | 386 | irqreturn_t xenvif_ctrl_irq_fn(int irq, void *data); |
|---|
| 374 | 387 | |
|---|
| 375 | 388 | 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); |
|---|
| 378 | 390 | |
|---|
| 379 | 391 | void xenvif_carrier_on(struct xenvif *vif); |
|---|
| 380 | 392 | |
|---|
| 381 | 393 | /* Callback from stack when TX packet can be released */ |
|---|
| 382 | 394 | 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); |
|---|
| 386 | 395 | |
|---|
| 387 | 396 | static inline pending_ring_idx_t nr_pending_reqs(struct xenvif_queue *queue) |
|---|
| 388 | 397 | { |
|---|
| .. | .. |
|---|
| 393 | 402 | irqreturn_t xenvif_interrupt(int irq, void *dev_id); |
|---|
| 394 | 403 | |
|---|
| 395 | 404 | extern bool separate_tx_rx_irq; |
|---|
| 405 | +extern bool provides_xdp_headroom; |
|---|
| 396 | 406 | |
|---|
| 397 | 407 | extern unsigned int rx_drain_timeout_msecs; |
|---|
| 398 | 408 | extern unsigned int rx_stall_timeout_msecs; |
|---|