|
@@ -58,6 +58,7 @@
|
|
#include <linux/pci.h>
|
|
#include <linux/pci.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/types.h>
|
|
#include <linux/types.h>
|
|
|
|
+#include <linux/uaccess.h>
|
|
#include "linux/ntb.h"
|
|
#include "linux/ntb.h"
|
|
#include "linux/ntb_transport.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)
|
|
if (rc)
|
|
goto err1;
|
|
goto err1;
|
|
|
|
|
|
- mw->vbase = ioremap(mw->phys_addr, mw->phys_size);
|
|
|
|
|
|
+ mw->vbase = ioremap_wc(mw->phys_addr, mw->phys_size);
|
|
if (!mw->vbase) {
|
|
if (!mw->vbase) {
|
|
rc = -ENOMEM;
|
|
rc = -ENOMEM;
|
|
goto err1;
|
|
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)
|
|
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);
|
|
memcpy_toio(offset, entry->buf, entry->len);
|
|
|
|
+#endif
|
|
|
|
|
|
/* Ensure that the data is fully copied out before setting the flags */
|
|
/* Ensure that the data is fully copied out before setting the flags */
|
|
wmb();
|
|
wmb();
|