lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1326808024-3744-9-git-send-email-wei.liu2@citrix.com>
Date:	Tue, 17 Jan 2012 13:47:04 +0000
From:	Wei Liu <wei.liu2@...rix.com>
To:	ian.campbell@...rix.com, netdev@...r.kernel.org,
	xen-devel@...ts.xensource.com
CC:	konrad.wilk@...cle.com, david.vrabel@...rix.com,
	paul.durrant@...rix.com, Wei Liu <wei.liu2@...rix.com>
Subject: [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@...rix.com>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ