The following changes since commit 98ffb8f3ecebed9984d1744f142eb8be10c14dbd: Fix bugs in [v]snprintf usage (2013-01-30 22:31:09 +0100) are available in the git repository at: git://git.kernel.dk/fio.git master David M. Lee (1): Allow override of CFLAGS Jens Axboe (4): windows: fix typo in <netinet/tcp.h> header configure: add TCP_NODELAY check net: 'nodelay' HOWTO/man page update Only disable stdout ETA output if results are going to stdout HOWTO | 3 +++ Makefile | 2 +- configure | 22 ++++++++++++++++++++++ engines/net.c | 6 ++++++ eta.c | 3 ++- fio.1 | 3 +++ os/windows/posix/include/netinet/tcp.h | 2 +- 7 files changed, 38 insertions(+), 3 deletions(-) --- Diff of recent changes: diff --git a/HOWTO b/HOWTO index c46b883..ea8730c 100644 --- a/HOWTO +++ b/HOWTO @@ -1402,6 +1402,9 @@ that defines them is selected. [netsplice] port=int [net] port=int The TCP or UDP port to bind to or connect to. +[netsplice] nodelay=bool +[net] nodelay=bool Set TCP_NODELAY on TCP connections. + [netsplice] protocol=str [netsplice] proto=str [net] protocol=str diff --git a/Makefile b/Makefile index a4a478d..45b20e6 100644 --- a/Makefile +++ b/Makefile @@ -177,7 +177,7 @@ FIO-VERSION-FILE: FORCE @$(SHELL) ./FIO-VERSION-GEN -include FIO-VERSION-FILE -CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"' +override CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"' .c.o: .depend FORCE $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $< diff --git a/configure b/configure index 995b5df..d332c5e 100755 --- a/configure +++ b/configure @@ -201,6 +201,7 @@ CYGWIN*) output_sym "CONFIG_GETTIMEOFDAY" output_sym "CONFIG_CLOCK_GETTIME" output_sym "CONFIG_SCHED_IDLE" + output_sym "CONFIG_TCP_NODELAY" echo "CC=$CC" >> $config_host_mak echo "EXTFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak exit 0 @@ -861,6 +862,24 @@ if compile_prog "" "" "SCHED_IDLE"; then fi echo "SCHED_IDLE $sched_idle" +########################################## +# Check whether we have TCP_NODELAY +tcp_nodelay="no" +cat > $TMPC << EOF +#include <stdio.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/tcp.h> +int main(int argc, char **argv) +{ + return getsockopt(0, 0, TCP_NODELAY, NULL, NULL); +} +EOF +if compile_prog "" "" "TCP_NODELAY"; then + tcp_nodelay="yes" +fi +echo "TCP_NODELAY $tcp_nodelay" + ############################################################################# echo "# Automatically generated by configure - do not modify" > $config_host_mak @@ -967,6 +986,9 @@ fi if test "$sched_idle" = "yes" ; then output_sym "CONFIG_SCHED_IDLE" fi +if test "$tcp_nodelay" = "yes" ; then + output_sym "CONFIG_TCP_NODELAY" +fi echo "LIBS+=$LIBS" >> $config_host_mak echo "CC=$cc" >> $config_host_mak diff --git a/engines/net.c b/engines/net.c index d0f4fa0..3e03bc9 100644 --- a/engines/net.c +++ b/engines/net.c @@ -92,12 +92,14 @@ static struct fio_option options[] = { }, }, }, +#ifdef CONFIG_TCP_NODELAY { .name = "nodelay", .type = FIO_OPT_BOOL, .off1 = offsetof(struct netio_options, nodelay), .help = "Use TCP_NODELAY on TCP connections", }, +#endif { .name = "listen", .type = FIO_OPT_STR_SET, @@ -479,6 +481,7 @@ static int fio_netio_connect(struct thread_data *td, struct fio_file *f) return 1; } +#ifdef CONFIG_TCP_NODELAY if (o->nodelay && o->proto == FIO_TYPE_TCP) { optval = 1; if (setsockopt(f->fd, IPPROTO_TCP, TCP_NODELAY, (void *) &optval, sizeof(int)) < 0) { @@ -486,6 +489,7 @@ static int fio_netio_connect(struct thread_data *td, struct fio_file *f) return 1; } } +#endif if (o->proto == FIO_TYPE_UDP) return 0; @@ -539,6 +543,7 @@ static int fio_netio_accept(struct thread_data *td, struct fio_file *f) goto err; } +#ifdef CONFIG_TCP_NODELAY if (o->nodelay && o->proto == FIO_TYPE_TCP) { optval = 1; if (setsockopt(f->fd, IPPROTO_TCP, TCP_NODELAY, (void *) &optval, sizeof(int)) < 0) { @@ -546,6 +551,7 @@ static int fio_netio_accept(struct thread_data *td, struct fio_file *f) return 1; } } +#endif reset_all_stats(td); td_set_runstate(td, state); diff --git a/eta.c b/eta.c index 39fe10f..cfb8679 100644 --- a/eta.c +++ b/eta.c @@ -285,7 +285,8 @@ int calc_thread_status(struct jobs_eta *je, int force) static struct timeval rate_prev_time, disp_prev_time; if (!force) { - if (output_format != FIO_OUTPUT_NORMAL) + if (output_format != FIO_OUTPUT_NORMAL && + f_out == stdout) return 0; if (temp_stall_ts || eta_print == FIO_ETA_NEVER) return 0; diff --git a/fio.1 b/fio.1 index 6b7e945..bacc634 100644 --- a/fio.1 +++ b/fio.1 @@ -1162,6 +1162,9 @@ used and must be omitted. .BI (net,netsplice)port \fR=\fPint The TCP or UDP port to bind to or connect to. .TP +.BI (net,netsplice)nodelay \fR=\fPbool +Set TCP_NODELAY on TCP connections. +.TP .BI (net,netsplice)protocol \fR=\fPstr "\fR,\fP proto" \fR=\fPstr The network protocol to use. Accepted values are: .RS diff --git a/os/windows/posix/include/netinet/tcp.h b/os/windows/posix/include/netinet/tcp.h index 1b48076..250c4c3 100644 --- a/os/windows/posix/include/netinet/tcp.h +++ b/os/windows/posix/include/netinet/tcp.h @@ -1,4 +1,4 @@ #ifndef NETINET_TCP_H -#define NET_INET_TCP_H +#define NETINET_TCP_H #endif -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html