diff options
Diffstat (limited to 'drivers/net/xen-netback/common.h')
-rw-r--r-- | drivers/net/xen-netback/common.h | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index 5a991266a394..49109afa2253 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h | |||
@@ -48,37 +48,8 @@ | |||
48 | typedef unsigned int pending_ring_idx_t; | 48 | typedef unsigned int pending_ring_idx_t; |
49 | #define INVALID_PENDING_RING_IDX (~0U) | 49 | #define INVALID_PENDING_RING_IDX (~0U) |
50 | 50 | ||
51 | /* For the head field in pending_tx_info: it is used to indicate | ||
52 | * whether this tx info is the head of one or more coalesced requests. | ||
53 | * | ||
54 | * When head != INVALID_PENDING_RING_IDX, it means the start of a new | ||
55 | * tx requests queue and the end of previous queue. | ||
56 | * | ||
57 | * An example sequence of head fields (I = INVALID_PENDING_RING_IDX): | ||
58 | * | ||
59 | * ...|0 I I I|5 I|9 I I I|... | ||
60 | * -->|<-INUSE---------------- | ||
61 | * | ||
62 | * After consuming the first slot(s) we have: | ||
63 | * | ||
64 | * ...|V V V V|5 I|9 I I I|... | ||
65 | * -----FREE->|<-INUSE-------- | ||
66 | * | ||
67 | * where V stands for "valid pending ring index". Any number other | ||
68 | * than INVALID_PENDING_RING_IDX is OK. These entries are considered | ||
69 | * free and can contain any number other than | ||
70 | * INVALID_PENDING_RING_IDX. In practice we use 0. | ||
71 | * | ||
72 | * The in use non-INVALID_PENDING_RING_IDX (say 0, 5 and 9 in the | ||
73 | * above example) number is the index into pending_tx_info and | ||
74 | * mmap_pages arrays. | ||
75 | */ | ||
76 | struct pending_tx_info { | 51 | struct pending_tx_info { |
77 | struct xen_netif_tx_request req; /* coalesced tx request */ | 52 | struct xen_netif_tx_request req; /* tx request */ |
78 | pending_ring_idx_t head; /* head != INVALID_PENDING_RING_IDX | ||
79 | * if it is head of one or more tx | ||
80 | * reqs | ||
81 | */ | ||
82 | /* Callback data for released SKBs. The callback is always | 53 | /* Callback data for released SKBs. The callback is always |
83 | * xenvif_zerocopy_callback, desc contains the pending_idx, which is | 54 | * xenvif_zerocopy_callback, desc contains the pending_idx, which is |
84 | * also an index in pending_tx_info array. It is initialized in | 55 | * also an index in pending_tx_info array. It is initialized in |
@@ -148,11 +119,6 @@ struct xenvif { | |||
148 | struct pending_tx_info pending_tx_info[MAX_PENDING_REQS]; | 119 | struct pending_tx_info pending_tx_info[MAX_PENDING_REQS]; |
149 | grant_handle_t grant_tx_handle[MAX_PENDING_REQS]; | 120 | grant_handle_t grant_tx_handle[MAX_PENDING_REQS]; |
150 | 121 | ||
151 | /* Coalescing tx requests before copying makes number of grant | ||
152 | * copy ops greater or equal to number of slots required. In | ||
153 | * worst case a tx request consumes 2 gnttab_copy. | ||
154 | */ | ||
155 | struct gnttab_copy tx_copy_ops[2*MAX_PENDING_REQS]; | ||
156 | struct gnttab_map_grant_ref tx_map_ops[MAX_PENDING_REQS]; | 122 | struct gnttab_map_grant_ref tx_map_ops[MAX_PENDING_REQS]; |
157 | struct gnttab_unmap_grant_ref tx_unmap_ops[MAX_PENDING_REQS]; | 123 | struct gnttab_unmap_grant_ref tx_unmap_ops[MAX_PENDING_REQS]; |
158 | /* passed to gnttab_[un]map_refs with pages under (un)mapping */ | 124 | /* passed to gnttab_[un]map_refs with pages under (un)mapping */ |