summaryrefslogtreecommitdiff
path: root/drivers/ntb/ntb_transport.c
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 /drivers/ntb/ntb_transport.c
parent0e041fb5369975c183d22ffeb156ea0dae760088 (diff)
downloadlwn-06917f753547e6bba8a5d17f79971d1c071a70dd.tar.gz
lwn-06917f753547e6bba8a5d17f79971d1c071a70dd.zip
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>
Diffstat (limited to 'drivers/ntb/ntb_transport.c')
-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 @@
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/types.h>
+#include <linux/uaccess.h>
#include "linux/ntb.h"
#include "linux/ntb_transport.h"
@@ -993,7 +994,7 @@ static int ntb_transport_probe(struct ntb_client *self, struct ntb_dev *ndev)
if (rc)
goto err1;
- mw->vbase = ioremap(mw->phys_addr, mw->phys_size);
+ mw->vbase = ioremap_wc(mw->phys_addr, mw->phys_size);
if (!mw->vbase) {
rc = -ENOMEM;
goto err1;
@@ -1375,7 +1376,15 @@ static void ntb_tx_copy_callback(void *data)
static void ntb_memcpy_tx(struct ntb_queue_entry *entry, void __iomem *offset)
{
+#ifdef ARCH_HAS_NOCACHE_UACCESS
+ /*
+ * Using non-temporal mov to improve performance on non-cached
+ * writes, even though we aren't actually copying from user space.
+ */
+ __copy_from_user_inatomic_nocache(offset, entry->buf, entry->len);
+#else
memcpy_toio(offset, entry->buf, entry->len);
+#endif
/* Ensure that the data is fully copied out before setting the flags */
wmb();