netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin LaHaise <ben.lahaise@neterion.com>
To: netdev@vger.kernel.org
Subject: [4/6] vxge: prefetch RxD descriptors
Date: Tue, 4 Aug 2009 16:21:39 -0400	[thread overview]
Message-ID: <20090804202139.GE9924@neterion.com> (raw)

This patch prefetches RxD descriptors which helps to lower the latency of a 
cache miss in vxge_hw_ring_rxd_next_completed.  This lowers the % of CPU 
time used by vxge_hw_ring_rxd_next_completed() where the descriptor is 
accessed in profiling netperf on a P4 Xeon from 1.5% to 1.0%.

Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
---
--- a/drivers/net/vxge/vxge-main.c.orig	2009-05-04 15:04:14.000000000 -0700
+++ b/drivers/net/vxge/vxge-main.c	2009-05-04 14:58:48.000000000 -0700
@@ -445,6 +431,7 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *
 	vxge_hw_ring_replenish(ringh, 0);
 
 	do {
+		prefetch((char *)dtr + L1_CACHE_BYTES);
 		rx_priv = vxge_hw_ring_rxd_private_get(dtr);
 		skb = rx_priv->skb;
 		data_size = rx_priv->data_size;
diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c
index 7be0ae1..9a6b10d 100644
--- a/drivers/net/vxge/vxge-traffic.c
+++ b/drivers/net/vxge/vxge-traffic.c
@@ -731,6 +731,7 @@ vxge_hw_channel_dtr_try_complete(struct __vxge_hw_channel *channel, void **dtrh)
 	vxge_assert(channel->compl_index < channel->length);
 
 	*dtrh =	channel->work_arr[channel->compl_index];
+	prefetch(*dtrh);
 }
 
 /*

                 reply	other threads:[~2009-08-04 20:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090804202139.GE9924@neterion.com \
    --to=ben.lahaise@neterion.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).