diff options
author | stephen hemminger <stephen@networkplumber.org> | 2017-07-24 10:57:27 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-07-24 17:38:28 -0700 |
commit | 43bf99ce009de710b68473480a611f3b5ddd11d5 (patch) | |
tree | e4c3eca7c71b0db3a39a8398895b04b3a83600a7 /drivers/net/hyperv | |
parent | 37b9dfa0d833227bc65353eec9dd0b00e1545a00 (diff) | |
download | lwn-43bf99ce009de710b68473480a611f3b5ddd11d5.tar.gz lwn-43bf99ce009de710b68473480a611f3b5ddd11d5.zip |
netvsc: prefetch the first incoming ring element
In interrupt handler, prefetch the first incoming ring element
so that it is in cache by the time NAPI poll gets to it.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv')
-rw-r--r-- | drivers/net/hyperv/netvsc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 0a9d9feedc3f..06f39a99da7c 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -30,6 +30,7 @@ #include <linux/if_ether.h> #include <linux/vmalloc.h> #include <linux/rtnetlink.h> +#include <linux/prefetch.h> #include <asm/sync_bitops.h> @@ -1265,10 +1266,15 @@ int netvsc_poll(struct napi_struct *napi, int budget) void netvsc_channel_cb(void *context) { struct netvsc_channel *nvchan = context; + struct vmbus_channel *channel = nvchan->channel; + struct hv_ring_buffer_info *rbi = &channel->inbound; + + /* preload first vmpacket descriptor */ + prefetch(hv_get_ring_buffer(rbi) + rbi->priv_read_index); if (napi_schedule_prep(&nvchan->napi)) { /* disable interupts from host */ - hv_begin_read(&nvchan->channel->inbound); + hv_begin_read(rbi); __napi_schedule(&nvchan->napi); } |