[net] window_size Set the desired socket buffer size for the connection.
+[net] mss Set the TCP maximum segment size (TCP_MAXSEG).
+
[e4defrag] donorname=str
File will be used as a block donor(swap extents between files)
[e4defrag] inplace=int
fi
echo "Net engine window_size $window_size"
+##########################################
+# Check whether we have TCP_MAXSEG
+mss="no"
+cat > $TMPC << EOF
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+int main(int argc, char **argv)
+{
+ return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
+}
+EOF
+if compile_prog "" "" "TCP_MAXSEG"; then
+ mss="yes"
+fi
+echo "TCP_MAXSEG $mss"
+
##########################################
# Check whether we have RLIMIT_MEMLOCK
rlimit_memlock="no"
if test "$window_size" = "yes" ; then
output_sym "CONFIG_NET_WINDOWSIZE"
fi
+if test "$mss" = "yes" ; then
+ output_sym "CONFIG_NET_MSS"
+fi
if test "$rlimit_memlock" = "yes" ; then
output_sym "CONFIG_RLIMIT_MEMLOCK"
fi
unsigned int nodelay;
unsigned int ttl;
unsigned int window_size;
+ unsigned int mss;
char *intfc;
};
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_NETIO,
},
+#endif
+#ifdef CONFIG_NET_MSS
+ {
+ .name = "mss",
+ .lname = "Maximum segment size",
+ .type = FIO_OPT_INT,
+ .off1 = offsetof(struct netio_options, mss),
+ .minval = 0,
+ .help = "Set TCP maximum segment size",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_NETIO,
+ },
#endif
{
.name = NULL,
#endif
}
+static int set_mss(struct thread_data *td, int fd)
+{
+#ifdef CONFIG_NET_MSS
+ struct netio_options *o = td->eo;
+ unsigned int mss;
+ int ret;
+
+ if (!o->mss || !is_tcp(o))
+ return 0;
+
+ mss = o->mss;
+ ret = setsockopt(fd, IPPROTO_TCP, TCP_MAXSEG, (void *) &mss,
+ sizeof(mss));
+ if (ret < 0)
+ td_verror(td, errno, "setsockopt TCP_MAXSEG");
+
+ return ret;
+#else
+ td_verror(td, -EINVAL, "setsockopt TCP_MAXSEG");
+ return -1;
+#endif
+}
+
+
/*
* Return -1 for error and 'nr events' for a positive number
* of events
close(f->fd);
return 1;
}
+ if (set_mss(td, f->fd)) {
+ close(f->fd);
+ return 1;
+ }
if (is_udp(o)) {
if (!fio_netio_is_multicast(td->o.filename))
close(fd);
return 1;
}
+ if (set_mss(td, fd)) {
+ close(fd);
+ return 1;
+ }
if (td->o.filename) {
if (!is_udp(o) || !fio_netio_is_multicast(td->o.filename)) {
.BI (net, window_size) \fR=\fPint
Set the desired socket buffer size for the connection.
.TP
+.BI (net, mss) \fR=\fPint
+Set the TCP maximum segment size (TCP_MAXSEG).
+.TP
.BI (e4defrag,donorname) \fR=\fPstr
File will be used as a block donor (swap extents between files)
.TP