summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphilippe56 <felix@linux.ibm.com>2019-04-11 06:57:48 +0200
committerAlastair D'Silva <deece@users.noreply.github.com>2019-04-11 14:57:48 +1000
commit9bd471ee2cfd147f430994a1e266257de99222e4 (patch)
tree903abd15ff157dab898520baa0b2d2070728103d
parenta475a8d599da909f0a9179f124bbe475de8c47aa (diff)
'ocxl_memcpy -p0' forks as many of processes as permitted by AFU (#28)
* 'ocxl_memcpy -p0' forks as many of processes as permitted by AFU Signed-off-by: Philippe Bergheaud <felix@linux.ibm.com>
-rw-r--r--afutests/memcpy/README.md1
-rw-r--r--afutests/memcpy/ocxl_memcpy.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/afutests/memcpy/README.md b/afutests/memcpy/README.md
index 1bc5a0d..8ef1387 100644
--- a/afutests/memcpy/README.md
+++ b/afutests/memcpy/README.md
@@ -25,6 +25,7 @@ Usage
-i Send an interrupt after copy
-l <loops> Run this number of memcpy loops (default 1)
-p <procs> Fork this number of processes (default 1)
+ -p 0 Use the maximum number of processes permitted by the AFU
-r Reallocate the destination buffer in between 2 loops
-s <bufsize> Copy this number of bytes (default 2048)
-t <timeout> Seconds to wait for the AFU to signal completion
diff --git a/afutests/memcpy/ocxl_memcpy.c b/afutests/memcpy/ocxl_memcpy.c
index caaacf9..de5dfc6 100644
--- a/afutests/memcpy/ocxl_memcpy.c
+++ b/afutests/memcpy/ocxl_memcpy.c
@@ -33,6 +33,7 @@
#define LOG_INF(pid, fmt, x...) printf("Process %d: " fmt, pid, ##x)
#define AFU_NAME "IBM,MEMCPY3"
+#define AFU_MAX_PROCESSES 512
#define CACHELINESIZE 128
/* Queue sizes other than 512kB don't seem to work (still true?) */
@@ -662,6 +663,7 @@ void usage(char *name)
fprintf(stderr, "\t-w\t\tSend a wake_host_thread command after copy\n");
fprintf(stderr, "\t-l <loops>\tRun this number of memcpy loops (default 1)\n");
fprintf(stderr, "\t-p <procs>\tFork this number of processes (default 1)\n");
+ fprintf(stderr, "\t-p 0\t\tUse the maximum number of processes permitted by the AFU\n");
fprintf(stderr, "\t-r\t\tReallocate the destination buffer in between 2 loops\n");
fprintf(stderr, "\t-s <bufsize>\tCopy this number of bytes (default 2048)\n");
fprintf(stderr, "\t-t <timeout>\tSeconds to wait for the AFU to signal completion\n");
@@ -729,6 +731,9 @@ int main(int argc, char *argv[])
}
}
+ if (processes == 0)
+ processes = AFU_MAX_PROCESSES;
+
if (args.completion_timeout == -1) {
args.completion_timeout = processes / 5;
if (args.completion_timeout < 10)