/* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation; or, when distributed * separately from the Linux kernel or incorporated into other * software packages, subject to the following license: * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this source file (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, modify, * merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE.
*/
struct pending_tx_info { struct xen_netif_tx_request req; /* tx request */ unsignedint extra_count; /* Callback data for released SKBs. The callback is always * xenvif_zerocopy_callback, desc contains the pending_idx, which is * also an index in pending_tx_info array. It is initialized in * xenvif_alloc and it never changes. * skb_shinfo(skb)->destructor_arg points to the first mapped slot's * callback_struct in this array of struct pending_tx_info's, then ctx * to the next, or NULL if there is no more slot for this skb. * ubuf_to_vif is a helper which finds the struct xenvif from a pointer * to this field.
*/ struct ubuf_info_msgzc callback_struct;
};
/* Discriminate from any valid pending_idx value. */ #define INVALID_PENDING_IDX 0xFFFF
#define MAX_PENDING_REQS XEN_NETIF_TX_RING_SIZE
/* The maximum number of frags is derived from the size of a grant (same * as a Xen page size for now).
*/ #define MAX_XEN_SKB_FRAGS (65536 / XEN_PAGE_SIZE + 1)
#define NETBACK_INVALID_HANDLE -1
/* To avoid confusion, we define XEN_NETBK_LEGACY_SLOTS_MAX indicating * the maximum slots a valid packet can use. Now this value is defined * to be XEN_NETIF_NR_SLOTS_MIN, which is supposed to be supported by * all backend.
*/ #define XEN_NETBK_LEGACY_SLOTS_MAX XEN_NETIF_NR_SLOTS_MIN
/* Queue name is interface name with "-qNNN" appended */ #define QUEUE_NAME_SIZE (IFNAMSIZ + 5)
/* IRQ name is queue name with "-tx" or "-rx" appended */ #define IRQ_NAME_SIZE (QUEUE_NAME_SIZE + 3)
struct xenvif;
struct xenvif_stats { /* Stats fields to be updated per-queue. * A subset of struct net_device_stats that contains only the * fields that are updated in netback.c for each queue.
*/
u64 rx_bytes;
u64 rx_packets;
u64 tx_bytes;
u64 tx_packets;
/* Additional stats used by xenvif */ unsignedlong rx_gso_checksum_fixup; unsignedlong tx_zerocopy_sent; unsignedlong tx_zerocopy_success; unsignedlong tx_zerocopy_fail; unsignedlong tx_frag_overflow;
};
/* * TX/RX common EOI handling. * When feature-split-event-channels = 0, interrupt handler sets * NETBK_COMMON_EOI, otherwise NETBK_RX_EOI and NETBK_TX_EOI are set * by the RX and TX interrupt handlers. * RX and TX handler threads will issue an EOI when either * NETBK_COMMON_EOI or their specific bits (NETBK_RX_EOI or * NETBK_TX_EOI) are set and they will reset those bits.
*/
atomic_t eoi_pending; #define NETBK_RX_EOI 0x01 #define NETBK_TX_EOI 0x02 #define NETBK_COMMON_EOI 0x04
/* Use NAPI for guest TX */ struct napi_struct napi; /* When feature-split-event-channels = 0, tx_irq = rx_irq. */ unsignedint tx_irq; /* Only used when feature-split-event-channels = 1 */ char tx_irq_name[IRQ_NAME_SIZE]; /* DEVNAME-qN-tx */ struct xen_netif_tx_back_ring tx; struct sk_buff_head tx_queue; struct page *mmap_pages[MAX_PENDING_REQS];
pending_ring_idx_t pending_prod;
pending_ring_idx_t pending_cons;
u16 pending_ring[MAX_PENDING_REQS]; struct pending_tx_info pending_tx_info[MAX_PENDING_REQS];
grant_handle_t grant_tx_handle[MAX_PENDING_REQS];
struct gnttab_copy tx_copy_ops[2 * MAX_PENDING_REQS]; struct gnttab_map_grant_ref tx_map_ops[MAX_PENDING_REQS]; struct gnttab_unmap_grant_ref tx_unmap_ops[MAX_PENDING_REQS]; /* passed to gnttab_[un]map_refs with pages under (un)mapping */ struct page *pages_to_map[MAX_PENDING_REQS]; struct page *pages_to_unmap[MAX_PENDING_REQS];
/* This prevents zerocopy callbacks to race over dealloc_ring */
spinlock_t callback_lock; /* This prevents dealloc thread and NAPI instance to race over response * creation and pending_ring in xenvif_idx_release. In xenvif_tx_err * it only protect response creation
*/
spinlock_t response_lock;
pending_ring_idx_t dealloc_prod;
pending_ring_idx_t dealloc_cons;
u16 dealloc_ring[MAX_PENDING_REQS]; struct task_struct *dealloc_task;
wait_queue_head_t dealloc_wq;
atomic_t inflight_packets;
/* Use kthread for guest RX */ struct task_struct *task;
wait_queue_head_t wq; /* When feature-split-event-channels = 0, tx_irq = rx_irq. */ unsignedint rx_irq; /* Only used when feature-split-event-channels = 1 */ char rx_irq_name[IRQ_NAME_SIZE]; /* DEVNAME-qN-rx */ struct xen_netif_rx_back_ring rx; struct sk_buff_head rx_queue;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.