projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rework file random map
[fio.git]
/
engines
/
net.c
diff --git
a/engines/net.c
b/engines/net.c
index 3401039aa3480a0642ca86d50cf1002b94763ada..c5337994fa41509acad7a4cf91003b0ac1422503 100644
(file)
--- a/
engines/net.c
+++ b/
engines/net.c
@@
-79,7
+79,7
@@
static struct fio_option options[] = {
},
{ .ival = "udp",
.oval = FIO_TYPE_UDP,
},
{ .ival = "udp",
.oval = FIO_TYPE_UDP,
- .help = "U
nreliable
Datagram Protocol",
+ .help = "U
ser
Datagram Protocol",
},
{ .ival = "unix",
.oval = FIO_TYPE_UNIX,
},
{ .ival = "unix",
.oval = FIO_TYPE_UNIX,
@@
-144,7
+144,7
@@
static int fio_netio_prep(struct thread_data *td, struct io_u *io_u)
td_verror(td, EINVAL, "bad direction");
return 1;
}
td_verror(td, EINVAL, "bad direction");
return 1;
}
-
+
return 0;
}
return 0;
}
@@
-496,8
+496,9
@@
static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
static int fio_netio_open_file(struct thread_data *td, struct fio_file *f)
{
int ret;
static int fio_netio_open_file(struct thread_data *td, struct fio_file *f)
{
int ret;
+ struct netio_options *o = td->eo;
- if (
td_read(td)
)
+ if (
o->listen
)
ret = fio_netio_accept(td, f);
else
ret = fio_netio_connect(td, f);
ret = fio_netio_accept(td, f);
else
ret = fio_netio_connect(td, f);
@@
-686,6
+687,11
@@
static int fio_netio_init(struct thread_data *td)
struct netio_options *o = td->eo;
int ret;
struct netio_options *o = td->eo;
int ret;
+#ifdef WIN32
+ WSADATA wsd;
+ WSAStartup(MAKEWORD(2,2), &wsd);
+#endif
+
if (td_random(td)) {
log_err("fio: network IO can't be random\n");
return 1;
if (td_random(td)) {
log_err("fio: network IO can't be random\n");
return 1;
@@
-701,13
+707,17
@@
static int fio_netio_init(struct thread_data *td)
if (o->proto != FIO_TYPE_TCP) {
if (o->listen) {
if (o->proto != FIO_TYPE_TCP) {
if (o->listen) {
-
log_err("fio: listen only valid for TCP proto IO\n");
-
return 1;
+ log_err("fio: listen only valid for TCP proto IO\n");
+ return 1;
}
if (td_rw(td)) {
}
if (td_rw(td)) {
-
log_err("fio: datagram network connections must be"
+ log_err("fio: datagram network connections must be"
" read OR write\n");
" read OR write\n");
- return 1;
+ return 1;
+ }
+ if (o->proto == FIO_TYPE_UNIX && !td->o.filename) {
+ log_err("fio: UNIX sockets need host/filename\n");
+ return 1;
}
o->listen = td_read(td);
}
}
o->listen = td_read(td);
}