[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [RFC PATCH V2 8/8] netback: remove unwanted notification generation during NAPI processing.
In original implementation, tx_build_gops tends to update req_event pointer every time it sees tx error or finish one batch. Remove those code to only update req_event pointer when we really want to shut down NAPI. Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- drivers/net/xen-netback/interface.c | 5 +++-- drivers/net/xen-netback/netback.c | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index 05caccc..7cf0947 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c @@ -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); diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index fa864f4..34f34f5 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -663,7 +663,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, @@ -1048,7 +1047,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; } @@ -1188,7 +1187,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; -- 1.7.2.5 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |