aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netback/common.h
diff options
context:
space:
mode:
authorZoltan Kiss <zoltan.kiss@citrix.com>2014-03-24 19:59:49 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-26 16:33:42 -0400
commit869b9b19b3affd81cee853d33c0b124797f3c387 (patch)
tree04bdb4dff188ae19ca61f02692d9a6b3c6b03274 /drivers/net/xen-netback/common.h
parentb8b6529f0536cf0d9e35e0833732199b66bf7cbc (diff)
xen-netback: Stop using xenvif_tx_pending_slots_available
Since the early days TX stops if there isn't enough free pending slots to consume a maximum sized (slot-wise) packet. Probably the reason for that is to avoid the case when we don't have enough free pending slot in the ring to finish the packet. But if we make sure that the pending ring has the same size as the shared ring, that shouldn't really happen. The frontend can only post packets which fit the to the free space of the shared ring. If it doesn't, the frontend has to stop, as it can only increase the req_prod when the whole packet fits onto the ring. This patch avoid using this checking, makes sure the 2 ring has the same size, and remove a checking from the callback. As now we don't stop the NAPI instance on this condition, we don't have to wake it up if we free pending slots up. 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.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index 0355f8767e3b..89b2d429c440 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -81,7 +81,7 @@ struct xenvif_rx_meta {
81 81
82#define MAX_BUFFER_OFFSET PAGE_SIZE 82#define MAX_BUFFER_OFFSET PAGE_SIZE
83 83
84#define MAX_PENDING_REQS 256 84#define MAX_PENDING_REQS XEN_NETIF_TX_RING_SIZE
85 85
86/* It's possible for an skb to have a maximal number of frags 86/* It's possible for an skb to have a maximal number of frags
87 * but still be less than MAX_BUFFER_OFFSET in size. Thus the 87 * but still be less than MAX_BUFFER_OFFSET in size. Thus the
@@ -251,12 +251,6 @@ static inline pending_ring_idx_t nr_pending_reqs(struct xenvif *vif)
251 vif->pending_prod + vif->pending_cons; 251 vif->pending_prod + vif->pending_cons;
252} 252}
253 253
254static inline bool xenvif_tx_pending_slots_available(struct xenvif *vif)
255{
256 return nr_pending_reqs(vif) + XEN_NETBK_LEGACY_SLOTS_MAX
257 < MAX_PENDING_REQS;
258}
259
260/* Callback from stack when TX packet can be released */ 254/* Callback from stack when TX packet can be released */
261void xenvif_zerocopy_callback(struct ubuf_info *ubuf, bool zerocopy_success); 255void xenvif_zerocopy_callback(struct ubuf_info *ubuf, bool zerocopy_success);
262 256