aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2015-05-19 16:45:46 -0400
committerJon Mason <jdmason@kudzu.us>2015-07-04 14:09:21 -0400
commit06917f753547e6bba8a5d17f79971d1c071a70dd (patch)
treec7dd7a7c0e94bd380a1c89d7d14e5c600c15ad78
parent0e041fb5369975c183d22ffeb156ea0dae760088 (diff)
NTB: Improve performance with write combining
Changing the memory window BAR mappings to write combining significantly boosts the performance. We will also use memcpy that uses non-temporal store, which showed performance improvement when doing non-cached memcpys. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
-rw-r--r--drivers/ntb/ntb_transport.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index dc14ec81c43e..7a765d3230d8 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -58,6 +58,7 @@
58#include <linux/pci.h> 58#include <linux/pci.h>
59#include <linux/slab.h> 59#include <linux/slab.h>
60#include <linux/types.h> 60#include <linux/types.h>
61#include <linux/uaccess.h>
61#include "linux/ntb.h" 62#include "linux/ntb.h"
62#include "linux/ntb_transport.h" 63#include "linux/ntb_transport.h"
63 64
@@ -993,7 +994,7 @@ static int ntb_transport_probe(struct ntb_client *self, struct ntb_dev *ndev)
993 if (rc) 994 if (rc)
994 goto err1; 995 goto err1;
995 996
996 mw->vbase = ioremap(mw->phys_addr, mw->phys_size); 997 mw->vbase = ioremap_wc(mw->phys_addr, mw->phys_size);
997 if (!mw->vbase) { 998 if (!mw->vbase) {
998 rc = -ENOMEM; 999 rc = -ENOMEM;
999 goto err1; 1000 goto err1;
@@ -1375,7 +1376,15 @@ static void ntb_tx_copy_callback(void *data)
1375 1376
1376static void ntb_memcpy_tx(struct ntb_queue_entry *entry, void __iomem *offset) 1377static void ntb_memcpy_tx(struct ntb_queue_entry *entry, void __iomem *offset)
1377{ 1378{
1379#ifdef ARCH_HAS_NOCACHE_UACCESS
1380 /*
1381 * Using non-temporal mov to improve performance on non-cached
1382 * writes, even though we aren't actually copying from user space.
1383 */
1384 __copy_from_user_inatomic_nocache(offset, entry->buf, entry->len);
1385#else
1378 memcpy_toio(offset, entry->buf, entry->len); 1386 memcpy_toio(offset, entry->buf, entry->len);
1387#endif
1379 1388
1380 /* Ensure that the data is fully copied out before setting the flags */ 1389 /* Ensure that the data is fully copied out before setting the flags */
1381 wmb(); 1390 wmb();