configure: add TCP_NODELAY check
Signed-off-by: Jens Axboe <axboe@kernel.dk>
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 @@
},
},
},
+#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 @@
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 @@
return 1;
}
}
+#endif
if (o->proto == FIO_TYPE_UDP)
return 0;
@@ -539,6 +543,7 @@
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 @@
return 1;
}
}
+#endif
reset_all_stats(td);
td_set_runstate(td, state);