The following changes since commit 5e4c7118da52cb62aa9361dcac16c68001813cb9:
Add verify_only to man page (2014-01-24 12:15:07 -0800)
are available in the git repository at:
git://git.kernel.dk/fio.git master
Bruce Cran (2):
Fix Windows headers for IPv6
Update Windows build for new threading library
Grant Grundler (1):
fio: consolidate rand_seed to uint64_t
Jens Axboe (4):
server: fix wrong error return on host lookup failure
configure: add test for whether required IPv6 helpers
client/server: don't reset ipv6 expectations
engine: protect net engine IPv6 support with configure check
Makefile | 2 +-
README | 22 +++++++++-------------
cconv.c | 4 ++--
client.c | 2 +-
configure | 28 ++++++++++++++++++++++++++++
engines/net.c | 4 ++++
ioengine.h | 2 +-
options.c | 2 +-
os/windows/examples.wxs | 4 ++++
os/windows/install.wxs | 4 ----
os/windows/posix/include/arpa/inet.h | 13 +++----------
os/windows/posix/include/netinet/in.h | 13 -------------
server.c | 12 ++++++------
server.h | 2 +-
thread_options.h | 4 ++--
15 files changed, 63 insertions(+), 55 deletions(-)
---
Diff of recent changes:
diff --git a/Makefile b/Makefile
index 8c2c514..3f654f0 100644
--- a/Makefile
+++ b/Makefile
@@ -132,7 +132,7 @@ ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
SOURCE := $(filter-out engines/mmap.c,$(SOURCE))
SOURCE += os/windows/posix.c
LIBS += -lpthread -lpsapi -lws2_32
- CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format
+ CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format -static
endif
OBJS = $(SOURCE:.c=.o)
diff --git a/README b/README
index e90f493..4da0d24 100644
--- a/README
+++ b/README
@@ -105,24 +105,20 @@ Configure will attempt to determine the target platform
automatically.
Windows
-------
-On Windows Cygwin (http://www.cygwin.com/) is required in order to
-build fio. To create an MSI installer package install WiX 3.7 from
+On Windows, Cygwin (http://www.cygwin.com/) is required in order to
+build fio. To create an MSI installer package install WiX 3.8 from
http://wixtoolset.org and run dobuild.cmd from the
os/windows directory.
-How to compile FIO on 64-bit Windows:
+How to compile fio on 64-bit Windows:
- 1. Install Cygwin (http://www.cygwin.com/setup.exe). Install 'make' and all
+ 1. Install Cygwin (http://www.cygwin.com/). Install 'make' and all
packages starting with 'mingw64-i686' and 'mingw64-x86_64'.
- 2. Download
ftp://sourceware.org/pub/pthreads-win32/prebuilt-dll-2-9-1-release/dll/x64/pthreadGC2.dll
- and copy to the fio source directory.
- 3. Open the Cygwin Terminal.
- 4. Go to the fio directory (source files).
- 5. Run 'make clean'.
- 6. Run 'make'.
-
-To build fio on 32-bit Windows, download x86/pthreadGC2.dll instead and do
-'./configure --build-32bit-win=yes' before 'make'.
+ 2. Open the Cygwin Terminal.
+ 3. Go to the fio directory (source files).
+ 4. Run 'make clean && make -j'.
+
+To build fio on 32-bit Windows, run './configure --build-32bit-win' before
'make'.
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
diff --git a/cconv.c b/cconv.c
index 3f41ae4..0d30f07 100644
--- a/cconv.c
+++ b/cconv.c
@@ -119,7 +119,7 @@ void convert_thread_options_to_cpu(struct thread_options *o,
o->do_disk_util = le32_to_cpu(top->do_disk_util);
o->override_sync = le32_to_cpu(top->override_sync);
o->rand_repeatable = le32_to_cpu(top->rand_repeatable);
- o->rand_seed = le32_to_cpu(top->rand_seed);
+ o->rand_seed = le64_to_cpu(top->rand_seed);
o->use_os_rand = le32_to_cpu(top->use_os_rand);
o->log_avg_msec = le32_to_cpu(top->log_avg_msec);
o->norandommap = le32_to_cpu(top->norandommap);
@@ -285,7 +285,7 @@ void convert_thread_options_to_net(struct
thread_options_pack *top,
top->do_disk_util = cpu_to_le32(o->do_disk_util);
top->override_sync = cpu_to_le32(o->override_sync);
top->rand_repeatable = cpu_to_le32(o->rand_repeatable);
- top->rand_seed = cpu_to_le32(o->rand_seed);
+ top->rand_seed = __cpu_to_le64(o->rand_seed);
top->use_os_rand = cpu_to_le32(o->use_os_rand);
top->log_avg_msec = cpu_to_le32(o->log_avg_msec);
top->norandommap = cpu_to_le32(o->norandommap);
diff --git a/client.c b/client.c
index 7975ce6..467d093 100644
--- a/client.c
+++ b/client.c
@@ -238,7 +238,7 @@ struct fio_client *fio_client_add_explicit(struct
client_ops *ops,
int ipv6;
ipv6 = type == Fio_client_ipv6;
- if (fio_server_parse_host(hostname, &ipv6,
+ if (fio_server_parse_host(hostname, ipv6,
&client->addr.sin_addr,
&client->addr6.sin6_addr))
goto err;
diff --git a/configure b/configure
index 2dda142..6baa579 100755
--- a/configure
+++ b/configure
@@ -1091,6 +1091,31 @@ if compile_prog "" "" "pwritev"; then
fi
echo "pwritev/preadv $pwritev"
+##########################################
+# Check whether we have the required functions for ipv6
+ipv6="no"
+cat > $TMPC << EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+#include <stdio.h>
+int main(int argc, char **argv)
+{
+ struct addrinfo hints;
+ struct in6_addr addr;
+ int ret;
+
+ ret = getaddrinfo(NULL, NULL, &hints, NULL);
+ freeaddrinfo(NULL);
+ printf("%s\n", gai_strerror(ret));
+ addr = in6addr_any;
+ return 0;
+}
+EOF
+if compile_prog "" "" "ipv6"; then
+ ipv6="yes"
+fi
+echo "IPv6 helpers $ipv6"
#############################################################################
@@ -1210,6 +1235,9 @@ fi
if test "$pwritev" = "yes" ; then
output_sym "CONFIG_PWRITEV"
fi
+if test "$ipv6" = "yes" ; then
+ output_sym "CONFIG_IPV6"
+fi
echo "LIBS+=$LIBS" >> $config_host_mak
echo "CFLAGS+=$CFLAGS" >> $config_host_mak
diff --git a/engines/net.c b/engines/net.c
index 4be106a..1dc55d5 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -94,18 +94,22 @@ static struct fio_option options[] = {
.oval = FIO_TYPE_TCP,
.help = "Transmission Control Protocol",
},
+#ifdef CONFIG_IPV6
{ .ival = "tcpv6",
.oval = FIO_TYPE_TCP_V6,
.help = "Transmission Control Protocol V6",
},
+#endif
{ .ival = "udp",
.oval = FIO_TYPE_UDP,
.help = "User Datagram Protocol",
},
+#ifdef CONFIG_IPV6
{ .ival = "udpv6",
.oval = FIO_TYPE_UDP_V6,
.help = "User Datagram Protocol V6",
},
+#endif
{ .ival = "unix",
.oval = FIO_TYPE_UNIX,
.help = "UNIX domain socket",
diff --git a/ioengine.h b/ioengine.h
index 949af91..0756bc7 100644
--- a/ioengine.h
+++ b/ioengine.h
@@ -56,7 +56,7 @@ struct io_u {
/*
* Initial seed for generating the buffer contents
*/
- unsigned long rand_seed;
+ uint64_t rand_seed;
/*
* IO engine state, may be different from above when we get
diff --git a/options.c b/options.c
index 525d318..8287011 100644
--- a/options.c
+++ b/options.c
@@ -1656,7 +1656,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
{
.name = "randseed",
.lname = "The random generator seed",
- .type = FIO_OPT_INT,
+ .type = FIO_OPT_STR_VAL,
.off1 = td_var_offset(rand_seed),
.help = "Set the random generator seed value",
.parent = "rw",
diff --git a/os/windows/examples.wxs b/os/windows/examples.wxs
index 644799d..a21182a 100755
--- a/os/windows/examples.wxs
+++ b/os/windows/examples.wxs
@@ -21,6 +21,9 @@
<File Source="..\..\examples\netio.fio" />
</Component>
<Component>
+ <File Source="..\..\examples\netio_multicast.fio" />
+ </Component>
+ <Component>
<File Source="..\..\examples\ssd-test.fio" />
</Component>
<Component>
@@ -60,6 +63,7 @@
<ComponentRef Id="fsx.fio" />
<ComponentRef Id="iometer_file_access_server.fio" />
<ComponentRef Id="netio.fio" />
+ <ComponentRef Id="netio_multicast.fio" />
<ComponentRef Id="ssd_test.fio" />
<ComponentRef Id="surface_scan.fio" />
<ComponentRef Id="tiobench_example.fio" />
diff --git a/os/windows/install.wxs b/os/windows/install.wxs
index adc50f6..599fe39 100755
--- a/os/windows/install.wxs
+++ b/os/windows/install.wxs
@@ -27,9 +27,6 @@
<File
Source="..\..\fio.exe"/>
</Component>
<Component>
- <File KeyPath="yes"
Source="..\..\libwinpthread-1.dll"/>
- </Component>
- <Component>
<File Id="README"
Name="README.txt" Source="..\..\README"/>
</Component>
<Component>
@@ -52,7 +49,6 @@
<Feature Id="AlwaysInstall" Absent="disallow"
ConfigurableDirectory="INSTALLDIR" Display="hidden" Level="1" Title="Flexible
IO Tester">
<ComponentRef Id="fio.exe"/>
- <ComponentRef Id="pthreadGC2.dll"/>
<ComponentRef Id="HOWTO"/>
<ComponentRef Id="README"/>
<ComponentRef Id="REPORTING_BUGS"/>
diff --git a/os/windows/posix/include/arpa/inet.h
b/os/windows/posix/include/arpa/inet.h
index 59c50ad..30498c6 100644
--- a/os/windows/posix/include/arpa/inet.h
+++ b/os/windows/posix/include/arpa/inet.h
@@ -1,21 +1,14 @@
#ifndef ARPA_INET_H
#define ARPA_INET_H
-#include <winsock2.h>
+#include <ws2tcpip.h>
#include <inttypes.h>
typedef int socklen_t;
typedef int in_addr_t;
-#define IP_MULTICAST_IF 2
-#define IP_MULTICAST_TTL 3
-#define IP_ADD_MEMBERSHIP 5
-
-struct ip_mreq
-{
- struct in_addr imr_multiaddr;
- struct in_addr imr_interface;
-};
+/* EAI_SYSTEM isn't used on Windows, so map it to EAI_FAIL */
+#define EAI_SYSTEM EAI_FAIL
in_addr_t inet_network(const char *cp);
diff --git a/os/windows/posix/include/netinet/in.h
b/os/windows/posix/include/netinet/in.h
index b58c209..f7e2419 100644
--- a/os/windows/posix/include/netinet/in.h
+++ b/os/windows/posix/include/netinet/in.h
@@ -4,18 +4,5 @@
#include <inttypes.h>
#include <sys/un.h>
-struct in6_addr
-{
- uint8_t s6_addr[16];
-};
-
-struct sockaddr_in6
-{
- sa_family_t sin6_family; /* AF_INET6 */
- in_port_t sin6_port; /* Port number */
- uint32_t sin6_flowinfo; /* IPv6 traffic class and flow
information */
- struct in6_addr sin6_addr; /* IPv6 address */
- uint32_t sin6_scope_id; /* Set of interfaces for a scope
*/
-};
#endif /* NETINET_IN_H */
diff --git a/server.c b/server.c
index 9b13df8..b6961fd 100644
--- a/server.c
+++ b/server.c
@@ -1392,13 +1392,13 @@ static int fio_init_server_connection(void)
return sk;
}
-int fio_server_parse_host(const char *host, int *ipv6, struct in_addr *inp,
+int fio_server_parse_host(const char *host, int ipv6, struct in_addr *inp,
struct in6_addr *inp6)
{
int ret = 0;
- if (*ipv6)
+ if (ipv6)
ret = inet_pton(AF_INET6, host, inp6);
else
ret = inet_pton(AF_INET, host, inp);
@@ -1407,17 +1407,17 @@ int fio_server_parse_host(const char *host, int *ipv6,
struct in_addr *inp,
struct addrinfo hints, *res;
memset(&hints, 0, sizeof(hints));
- hints.ai_family = *ipv6 ? AF_INET6 : AF_INET;
+ hints.ai_family = ipv6 ? AF_INET6 : AF_INET;
hints.ai_socktype = SOCK_STREAM;
ret = getaddrinfo(host, NULL, &hints, &res);
if (ret) {
log_err("fio: failed to resolve <%s> (%s)\n", host,
gai_strerror(ret));
- return 0;
+ return 1;
}
- if (*ipv6)
+ if (ipv6)
memcpy(inp6, &((struct sockaddr_in6 *)
res->ai_addr)->sin6_addr, sizeof(*inp6));
else
memcpy(inp, &((struct sockaddr_in *)
res->ai_addr)->sin_addr, sizeof(*inp));
@@ -1508,7 +1508,7 @@ int fio_server_parse_string(const char *str, char **ptr,
int *is_sock,
*ptr = strdup(host);
- if (fio_server_parse_host(*ptr, ipv6, inp, inp6)) {
+ if (fio_server_parse_host(*ptr, *ipv6, inp, inp6)) {
free(*ptr);
*ptr = NULL;
return 1;
diff --git a/server.h b/server.h
index 57e15d7..adb190a 100644
--- a/server.h
+++ b/server.h
@@ -156,7 +156,7 @@ extern int fio_net_send_cmd(int, uint16_t, const void *,
off_t, uint64_t *, stru
extern int fio_net_send_simple_cmd(int, uint16_t, uint64_t, struct flist_head
*);
extern void fio_server_set_arg(const char *);
extern int fio_server_parse_string(const char *, char **, int *, int *, struct
in_addr *, struct in6_addr *, int *);
-extern int fio_server_parse_host(const char *, int *, struct in_addr *, struct
in6_addr *);
+extern int fio_server_parse_host(const char *, int, struct in_addr *, struct
in6_addr *);
extern const char *fio_server_op(unsigned int);
extern void fio_server_got_signal(int);
diff --git a/thread_options.h b/thread_options.h
index 2f807cd..79c3a89 100644
--- a/thread_options.h
+++ b/thread_options.h
@@ -100,7 +100,7 @@ struct thread_options {
unsigned int do_disk_util;
unsigned int override_sync;
unsigned int rand_repeatable;
- unsigned int rand_seed;
+ unsigned long long rand_seed;
unsigned int use_os_rand;
unsigned int log_avg_msec;
unsigned int norandommap;
@@ -324,7 +324,7 @@ struct thread_options_pack {
uint32_t do_disk_util;
uint32_t override_sync;
uint32_t rand_repeatable;
- uint32_t rand_seed;
+ uint64_t rand_seed;
uint32_t use_os_rand;
uint32_t log_avg_msec;
uint32_t norandommap;
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html