Merge branch 'doc_runtime' of https://github.com/sitsofe/fio
authorJens Axboe <axboe@kernel.dk>
Sun, 27 Aug 2017 16:04:28 +0000 (10:04 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 27 Aug 2017 16:04:28 +0000 (10:04 -0600)
README
configure
engines/rdma.c
os/os.h
stat.c
time.c

diff --git a/README b/README
index a6eba8f007756dfce72786dab93bcb9630cb9fa9..72ff465ed7ebe68c11960619733bf600c9394016 100644 (file)
--- a/README
+++ b/README
@@ -181,7 +181,9 @@ To build fio on 32-bit Windows, run ``./configure --build-32bit-win`` before
 It's recommended that once built or installed, fio be run in a Command Prompt or
 other 'native' console such as console2, since there are known to be display and
 signal issues when running it under a Cygwin shell (see
-http://code.google.com/p/mintty/issues/detail?id=56 for details).
+https://github.com/mintty/mintty/issues/56 and
+https://github.com/mintty/mintty/wiki/Tips#inputoutput-interaction-with-alien-programs
+for details).
 
 
 Documentation
index 59af1b6c3d1b8df402300b85b9ea454dd9c0c927..cefd61032284ddc36013a7d7ab1d8aaa9bc71b71 100755 (executable)
--- a/configure
+++ b/configure
@@ -697,8 +697,7 @@ if test "$libverbs" != "yes" ; then
   libverbs="no"
 fi
 cat > $TMPC << EOF
-#include <stdio.h>
-#include <infiniband/arch.h>
+#include <infiniband/verbs.h>
 int main(int argc, char **argv)
 {
   struct ibv_pd *pd = ibv_alloc_pd(NULL);
index 8d31ff307b6cfd21260bbd5b82013ed35a2e0bd7..da00cba8b66b3f6db0bcd3a9cba8b45b9362ffa7 100644 (file)
@@ -44,7 +44,6 @@
 #include "../optgroup.h"
 
 #include <rdma/rdma_cma.h>
-#include <infiniband/arch.h>
 
 #define FIO_RDMA_MAX_IO_DEPTH    512
 
@@ -216,7 +215,7 @@ static int client_recv(struct thread_data *td, struct ibv_wc *wc)
                rd->rmt_nr = ntohl(rd->recv_buf.nr);
 
                for (i = 0; i < rd->rmt_nr; i++) {
-                       rd->rmt_us[i].buf = ntohll(rd->recv_buf.rmt_us[i].buf);
+                       rd->rmt_us[i].buf = be64_to_cpu(rd->recv_buf.rmt_us[i].buf);
                        rd->rmt_us[i].rkey = ntohl(rd->recv_buf.rmt_us[i].rkey);
                        rd->rmt_us[i].size = ntohl(rd->recv_buf.rmt_us[i].size);
 
@@ -1300,7 +1299,7 @@ static int fio_rdmaio_init(struct thread_data *td)
                }
 
                rd->send_buf.rmt_us[i].buf =
-                   htonll((uint64_t) (unsigned long)io_u->buf);
+                   cpu_to_be64((uint64_t) (unsigned long)io_u->buf);
                rd->send_buf.rmt_us[i].rkey = htonl(io_u->mr->rkey);
                rd->send_buf.rmt_us[i].size = htonl(max_bs);
 
diff --git a/os/os.h b/os/os.h
index 2e1552914cd2fa9593230e14e6e68edeeafcc02c..f62b4270f8383851dede8402dc925066770623f5 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -204,16 +204,20 @@ static inline uint64_t fio_swap64(uint64_t val)
 
 #ifndef FIO_HAVE_BYTEORDER_FUNCS
 #ifdef CONFIG_LITTLE_ENDIAN
+#define __be64_to_cpu(x)               fio_swap64(x)
 #define __le16_to_cpu(x)               (x)
 #define __le32_to_cpu(x)               (x)
 #define __le64_to_cpu(x)               (x)
+#define __cpu_to_be64(x)               fio_swap64(x)
 #define __cpu_to_le16(x)               (x)
 #define __cpu_to_le32(x)               (x)
 #define __cpu_to_le64(x)               (x)
 #else
+#define __be64_to_cpu(x)               (x)
 #define __le16_to_cpu(x)               fio_swap16(x)
 #define __le32_to_cpu(x)               fio_swap32(x)
 #define __le64_to_cpu(x)               fio_swap64(x)
+#define __cpu_to_be64(x)               (x)
 #define __cpu_to_le16(x)               fio_swap16(x)
 #define __cpu_to_le32(x)               fio_swap32(x)
 #define __cpu_to_le64(x)               fio_swap64(x)
@@ -221,6 +225,10 @@ static inline uint64_t fio_swap64(uint64_t val)
 #endif /* FIO_HAVE_BYTEORDER_FUNCS */
 
 #ifdef FIO_INTERNAL
+#define be64_to_cpu(val) ({                    \
+       typecheck(uint64_t, val);               \
+       __be64_to_cpu(val);                     \
+})
 #define le16_to_cpu(val) ({                    \
        typecheck(uint16_t, val);               \
        __le16_to_cpu(val);                     \
@@ -235,6 +243,10 @@ static inline uint64_t fio_swap64(uint64_t val)
 })
 #endif
 
+#define cpu_to_be64(val) ({                    \
+       typecheck(uint64_t, val);               \
+       __cpu_to_be64(val);                     \
+})
 #define cpu_to_le16(val) ({                    \
        typecheck(uint16_t, val);               \
        __cpu_to_le16(val);                     \
diff --git a/stat.c b/stat.c
index 4aa9cb8f3d80797fe59deec69dfdcadb29968530..91c74abef420f8fb0e8453e5a9be1fecff1e6f56 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -100,7 +100,8 @@ static unsigned int plat_val_to_idx(unsigned long long val)
  */
 static unsigned long long plat_idx_to_val(unsigned int idx)
 {
-       unsigned int error_bits, k, base;
+       unsigned int error_bits;
+       unsigned long long k, base;
 
        assert(idx < FIO_IO_U_PLAT_NR);
 
@@ -111,7 +112,7 @@ static unsigned long long plat_idx_to_val(unsigned int idx)
 
        /* Find the group and compute the minimum value of that group */
        error_bits = (idx >> FIO_IO_U_PLAT_BITS) - 1;
-       base = 1 << (error_bits + FIO_IO_U_PLAT_BITS);
+       base = ((unsigned long long) 1) << (error_bits + FIO_IO_U_PLAT_BITS);
 
        /* Find its bucket number of the group */
        k = idx % FIO_IO_U_PLAT_VAL;
diff --git a/time.c b/time.c
index edfe779bc2423876e949be48b11fb3ed354af986..07984190d67a914173e1980f0ed0461b45ea5ee8 100644 (file)
--- a/time.c
+++ b/time.c
@@ -8,17 +8,17 @@ static unsigned long ns_granularity;
 
 void timespec_add_msec(struct timespec *ts, unsigned int msec)
 {
-       unsigned long adj_nsec = 1000000 * msec;
+       uint64_t adj_nsec = 1000000ULL * msec;
 
        ts->tv_nsec += adj_nsec;
        if (adj_nsec >= 1000000000) {
-               unsigned long adj_sec = adj_nsec / 1000000000UL;
+               uint64_t adj_sec = adj_nsec / 1000000000;
 
-               ts->tv_nsec -=  adj_sec * 1000000000UL;
+               ts->tv_nsec -= adj_sec * 1000000000;
                ts->tv_sec += adj_sec;
        }
-       if (ts->tv_nsec >= 1000000000UL){
-               ts->tv_nsec -= 1000000000UL;
+       if (ts->tv_nsec >= 1000000000){
+               ts->tv_nsec -= 1000000000;
                ts->tv_sec++;
        }
 }