]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
IB/qib: Add prefetch for eager buffers
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Wed, 2 May 2012 15:21:53 +0000 (11:21 -0400)
committerRoland Dreier <roland@purestorage.com>
Mon, 14 May 2012 19:36:18 +0000 (12:36 -0700)
Add a prefetch call when a packet has been stored.  The nature of the
prefetch is correctly determined by the alternatives mechanism.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/qib/qib_driver.c

index 6fc9365ba8a6032225e953f5bc4e2203390afcc4..8895cfec5019f3229d2945ffaae77678439de976 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/netdevice.h>
 #include <linux/vmalloc.h>
 #include <linux/module.h>
+#include <linux/prefetch.h>
 
 #include "qib.h"
 
@@ -481,8 +482,10 @@ u32 qib_kreceive(struct qib_ctxtdata *rcd, u32 *llic, u32 *npkts)
                        etail = qib_hdrget_index(rhf_addr);
                        updegr = 1;
                        if (tlen > sizeof(*hdr) ||
-                           etype >= RCVHQ_RCV_TYPE_NON_KD)
+                           etype >= RCVHQ_RCV_TYPE_NON_KD) {
                                ebuf = qib_get_egrbuf(rcd, etail);
+                               prefetch_range(ebuf, tlen - sizeof(*hdr));
+                       }
                }
                if (!eflags) {
                        u16 lrh_len = be16_to_cpu(hdr->lrh[2]) << 2;