Subject: [PATCH] gnu: Add perftest.

From: Manuel Graf <[email-masked]>
Date: Fri, 31 Aug 2018 17:24:42 +0200

* gnu/packages/linux.scm (perftest): New variable.
---
 gnu/packages/linux.scm                             | 33 ++++++++
 .../linux-perftest-fix-netinet-ip.h-includes.patch | 96 ++++++++++++++++++++++
 2 files changed, 129 insertions(+)
 create mode 100644 gnu/packages/patches/linux-perftest-fix-netinet-ip.h-includes.patch

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 63b3ece8e..f46877561 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3622,6 +3622,39 @@ The following service daemons are also provided:
            license:cc0               ; most files in ccan/
            license:bsd-3))))         ; providers/hfi1verbs are dual GPL2/BSD-3
 
+(define-public perftest
+  (package
+    (name "perftest")
+    (version "4.2-0.8")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/V"
+                           version
+                           "/perftest-"
+                           version
+                           ".g0e24e67.tar.gz"))
+       (sha256
+        (base32 "1r3pxn7cx3grb8myb4q1b0pk447pc06cifd0v7ym13xw00372dlx"))
+       (patches (search-patches "linux-perftest-fix-netinet-ip.h-includes.patch"))))
+    (build-system gnu-build-system)
+    (inputs `(("rdma-core" ,rdma-core)))
+    (home-page "https://github.com/linux-rdma/perftest/")
+    (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
+    (description "This is a collection of tests written over uverbs intended for
+use as a performance micro-benchmark. The tests may be used for HW or SW tuning
+as well as for functional testing.
+
+The collection contains a set of bandwidth and latency benchmark such as:
+@enumerate
+@item Send        - @code{ib_send_bw} and @code{ib_send_lat}
+@item RDMA Read   - @code{ib_read_bw} and @code{ib_read_lat}
+@item RDMA Write  - @code{ib_write_bw} and @code{ib_wriet_lat}
+@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
+@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
+@end enumerate")
+    (license license:gpl2)))
+
 (define-public rng-tools
   (package
     (name "rng-tools")
diff --git a/gnu/packages/patches/linux-perftest-fix-netinet-ip.h-includes.patch b/gnu/packages/patches/linux-perftest-fix-netinet-ip.h-includes.patch
new file mode 100644
index 000000000..d9cb8cff4
--- /dev/null
+++ b/gnu/packages/patches/linux-perftest-fix-netinet-ip.h-includes.patch
@@ -0,0 +1,96 @@
+From cfc1c97189e074935c198c2e939e27832808dbed Mon Sep 17 00:00:00 2001
+From: Manuel Graf <[email-masked]>
+Date: Mon, 27 Aug 2018 14:19:41 +0200
+Subject: [PATCH] fix netinet/ip.h include
+
+do not use absolute path of header file in include directives.
+---
+ src/raw_ethernet_fs_rate.c        | 2 +-
+ src/raw_ethernet_resources.c      | 2 +-
+ src/raw_ethernet_resources.h      | 2 +-
+ src/raw_ethernet_send_burst_lat.c | 2 +-
+ src/raw_ethernet_send_bw.c        | 2 +-
+ src/raw_ethernet_send_lat.c       | 2 +-
+ 6 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/raw_ethernet_fs_rate.c b/src/raw_ethernet_fs_rate.c
+index f20c4ed..d9accd7 100755
+--- a/src/raw_ethernet_fs_rate.c
++++ b/src/raw_ethernet_fs_rate.c
+@@ -45,7 +45,7 @@
+ #include <string.h>
+ #include <signal.h>
+ #include <getopt.h>
+-#include </usr/include/netinet/ip.h>
++#include <netinet/ip.h>
+ #include <poll.h>
+ #include "perftest_parameters.h"
+ #include "perftest_resources.h"
+diff --git a/src/raw_ethernet_resources.c b/src/raw_ethernet_resources.c
+index 290855e..555e54d 100755
+--- a/src/raw_ethernet_resources.c
++++ b/src/raw_ethernet_resources.c
+@@ -45,7 +45,7 @@
+ #include <signal.h>
+ #include <getopt.h>
+ #include <unistd.h>
+-#include </usr/include/netinet/ip.h>
++#include <netinet/ip.h>
+ #include <poll.h>
+ #include "perftest_parameters.h"
+ #include "perftest_resources.h"
+diff --git a/src/raw_ethernet_resources.h b/src/raw_ethernet_resources.h
+index 9be98e4..39ae157 100755
+--- a/src/raw_ethernet_resources.h
++++ b/src/raw_ethernet_resources.h
+@@ -13,7 +13,7 @@
+ #include <string.h>
+ #include <signal.h>
+ #include <getopt.h>
+-#include </usr/include/netinet/ip.h>
++#include <netinet/ip.h>
+ #include <poll.h>
+ #include "perftest_parameters.h"
+ #include "perftest_resources.h"
+diff --git a/src/raw_ethernet_send_burst_lat.c b/src/raw_ethernet_send_burst_lat.c
+index ccc077c..f351a68 100755
+--- a/src/raw_ethernet_send_burst_lat.c
++++ b/src/raw_ethernet_send_burst_lat.c
+@@ -45,7 +45,7 @@
+ #include <string.h>
+ #include <signal.h>
+ #include <getopt.h>
+-#include </usr/include/netinet/ip.h>
++#include <netinet/ip.h>
+ #include <poll.h>
+ #include "perftest_parameters.h"
+ #include "perftest_resources.h"
+diff --git a/src/raw_ethernet_send_bw.c b/src/raw_ethernet_send_bw.c
+index e3ec1b0..c7bd8be 100755
+--- a/src/raw_ethernet_send_bw.c
++++ b/src/raw_ethernet_send_bw.c
+@@ -45,7 +45,7 @@
+ #include <string.h>
+ #include <signal.h>
+ #include <getopt.h>
+-#include </usr/include/netinet/ip.h>
++#include <netinet/ip.h>
+ #include <poll.h>
+ #include "perftest_parameters.h"
+ #include "perftest_resources.h"
+diff --git a/src/raw_ethernet_send_lat.c b/src/raw_ethernet_send_lat.c
+index a9e3715..4aec524 100755
+--- a/src/raw_ethernet_send_lat.c
++++ b/src/raw_ethernet_send_lat.c
+@@ -45,7 +45,7 @@
+ #include <string.h>
+ #include <signal.h>
+ #include <getopt.h>
+-#include </usr/include/netinet/ip.h>
++#include <netinet/ip.h>
+ #include <poll.h>
+ #include "perftest_parameters.h"
+ #include "perftest_resources.h"
+-- 
+2.14.4
+
-- 
2.14.4