aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netback/common.h
diff options
context:
space:
mode:
authorZoltan Kiss <zoltan.kiss@citrix.com>2014-03-06 16:48:27 -0500
committerDavid S. Miller <davem@davemloft.net>2014-03-07 15:56:35 -0500
commit62bad3199a4c20505fc36c169deef20b25e17c5f (patch)
tree9aea137ac129ba2a011974dbb45fe9cf292215f4 /drivers/net/xen-netback/common.h
parentf53c3fe8dad725b014e9c7682720d8e3e2a8a5b3 (diff)
xen-netback: Remove old TX grant copy definitons and fix indentations
These became obsolete with grant mapping. I've left intentionally the indentations in this way, to improve readability of previous patches. NOTE: if bisect brought you here, you should apply the series up until "xen-netback: Timeout packets in RX path", otherwise Windows guests can't work properly and malicious guests can block other guests by not releasing their sent packets. Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netback/common.h')
-rw-r--r--drivers/net/xen-netback/common.h36
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 @@
48typedef unsigned int pending_ring_idx_t; 48typedef 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 */
76struct pending_tx_info { 51struct 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 */