@@ -58,8 +58,8 @@ static irqreturn_t xenvif_interrupt(int irq, void *dev_id)
if (xenvif_rx_schedulable(vif))
netif_wake_queue(vif->dev);
- if (likely(napi_schedule_prep(&vif->napi)))
- __napi_schedule(&vif->napi);
+ if (RING_HAS_UNCONSUMED_REQUESTS(&vif->tx))
+ napi_schedule(&vif->napi);
return IRQ_HANDLED;
}
@@ -74,6 +74,7 @@ static int xenvif_poll(struct napi_struct *napi, int budget)
if (work_done < budget) {
int more_to_do = 0;
unsigned long flag;
+
local_irq_save(flag);
RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, more_to_do);
@@ -662,7 +662,6 @@ static void xenvif_tx_err(struct xenvif *vif,
txp = RING_GET_REQUEST(&vif->tx, cons++);
} while (1);
vif->tx.req_cons = cons;
- xenvif_check_rx_xenvif(vif);
}
static int xenvif_count_requests(struct xenvif *vif,
@@ -1047,7 +1046,7 @@ static unsigned xenvif_tx_build_gops(struct xenvif *vif,
int pool_idx;
struct pending_tx_info *pending_tx_info;
- RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, work_to_do);
+ work_to_do = RING_HAS_UNCONSUMED_REQUESTS(&vif->tx);
if (!work_to_do) {
break;
}
@@ -1187,7 +1186,6 @@ static unsigned xenvif_tx_build_gops(struct xenvif *vif,
gop = request_gop;
vif->tx.req_cons = idx;
- xenvif_check_rx_xenvif(vif);
if ((gop - tco) >= MAX_PENDING_REQS)
break;