#define MAX_BUFFER_OFFSET PAGE_SIZE
-#define MAX_PENDING_REQS 256
+#define MAX_PENDING_REQS XEN_NETIF_TX_RING_SIZE
/* It's possible for an skb to have a maximal number of frags
* but still be less than MAX_BUFFER_OFFSET in size. Thus the
vif->pending_prod + vif->pending_cons;
}
-static inline bool xenvif_tx_pending_slots_available(struct xenvif *vif)
-{
- return nr_pending_reqs(vif) + XEN_NETBK_LEGACY_SLOTS_MAX
- < MAX_PENDING_REQS;
-}
-
/* Callback from stack when TX packet can be released */
void xenvif_zerocopy_callback(struct ubuf_info *ubuf, bool zerocopy_success);
local_irq_save(flags);
RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, more_to_do);
- if (!(more_to_do &&
- xenvif_tx_pending_slots_available(vif)))
+ if (!more_to_do)
__napi_complete(napi);
local_irq_restore(flags);
struct sk_buff *skb;
int ret;
- while (xenvif_tx_pending_slots_available(vif) &&
- (skb_queue_len(&vif->tx_queue) < budget)) {
+ while (skb_queue_len(&vif->tx_queue) < budget) {
struct xen_netif_tx_request txreq;
struct xen_netif_tx_request txfrags[XEN_NETBK_LEGACY_SLOTS_MAX];
struct xen_netif_extra_info extras[XEN_NETIF_EXTRA_TYPE_MAX-1];
wake_up(&vif->dealloc_wq);
spin_unlock_irqrestore(&vif->callback_lock, flags);
- if (RING_HAS_UNCONSUMED_REQUESTS(&vif->tx) &&
- xenvif_tx_pending_slots_available(vif)) {
- local_bh_disable();
- napi_schedule(&vif->napi);
- local_bh_enable();
- }
-
if (likely(zerocopy_success))
vif->tx_zerocopy_success++;
else
static inline int tx_work_todo(struct xenvif *vif)
{
- if (likely(RING_HAS_UNCONSUMED_REQUESTS(&vif->tx)) &&
- xenvif_tx_pending_slots_available(vif))
+ if (likely(RING_HAS_UNCONSUMED_REQUESTS(&vif->tx)))
return 1;
return 0;