summaryrefslogtreecommitdiffstats
path: root/drivers/ntb/test/ntb_perf.c
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2016-03-07 23:57:25 +0100
committerJon Mason <jdmason@kudzu.us>2016-03-18 01:50:15 +0100
commitee5f750f1c9d675028ecedc5439b7171f6647cb8 (patch)
tree5cd4227da7117e99d2937245ead8e57e654201cf /drivers/ntb/test/ntb_perf.c
parentntb: stop link work when we do not have memory (diff)
downloadlinux-ee5f750f1c9d675028ecedc5439b7171f6647cb8.tar.xz
linux-ee5f750f1c9d675028ecedc5439b7171f6647cb8.zip
ntb: add missing setup of translation window
The perf tool is missing the setup of translation window. Adding call to setup the translation window for backed memory. Signed-off-by: John Kading <john.kading@gd-ms.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'drivers/ntb/test/ntb_perf.c')
-rw-r--r--drivers/ntb/test/ntb_perf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index 6bdc1e7b7503..f798beb01ac6 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -425,6 +425,7 @@ static int perf_set_mw(struct perf_ctx *perf, resource_size_t size)
{
struct perf_mw *mw = &perf->mw;
size_t xlat_size, buf_size;
+ int rc;
if (!size)
return -EINVAL;
@@ -448,6 +449,13 @@ static int perf_set_mw(struct perf_ctx *perf, resource_size_t size)
mw->buf_size = 0;
}
+ rc = ntb_mw_set_trans(perf->ntb, 0, mw->dma_addr, mw->xlat_size);
+ if (rc) {
+ dev_err(&perf->ntb->dev, "Unable to set mw0 translation\n");
+ perf_free_mw(perf);
+ return -EIO;
+ }
+
return 0;
}