Categorize engine and profile options
[fio.git] / engines / net.c
index 3e03bc9c8742954049ba6246315ad6364222c49d..3a352de70e492fef403ecb8315287514a7cd1199 100644 (file)
@@ -61,6 +61,8 @@ static struct fio_option options[] = {
                .type   = FIO_OPT_STR_STORE,
                .cb     = str_hostname_cb,
                .help   = "Hostname for net IO engine",
+               .category = FIO_OPT_C_ENGINE,
+               .group  = FIO_OPT_G_NETIO,
        },
        {
                .name   = "port",
@@ -69,6 +71,8 @@ static struct fio_option options[] = {
                .minval = 1,
                .maxval = 65535,
                .help   = "Port to use for TCP or UDP net connections",
+               .category = FIO_OPT_C_ENGINE,
+               .group  = FIO_OPT_G_NETIO,
        },
        {
                .name   = "protocol",
@@ -91,6 +95,8 @@ static struct fio_option options[] = {
                            .help = "UNIX domain socket",
                          },
                },
+               .category = FIO_OPT_C_ENGINE,
+               .group  = FIO_OPT_G_NETIO,
        },
 #ifdef CONFIG_TCP_NODELAY
        {
@@ -98,6 +104,8 @@ static struct fio_option options[] = {
                .type   = FIO_OPT_BOOL,
                .off1   = offsetof(struct netio_options, nodelay),
                .help   = "Use TCP_NODELAY on TCP connections",
+               .category = FIO_OPT_C_ENGINE,
+               .group  = FIO_OPT_G_NETIO,
        },
 #endif
        {
@@ -105,12 +113,16 @@ static struct fio_option options[] = {
                .type   = FIO_OPT_STR_SET,
                .off1   = offsetof(struct netio_options, listen),
                .help   = "Listen for incoming TCP connections",
+               .category = FIO_OPT_C_ENGINE,
+               .group  = FIO_OPT_G_NETIO,
        },
        {
                .name   = "pingpong",
                .type   = FIO_OPT_STR_SET,
                .off1   = offsetof(struct netio_options, pingpong),
                .help   = "Ping-pong IO requests",
+               .category = FIO_OPT_C_ENGINE,
+               .group  = FIO_OPT_G_NETIO,
        },
        {
                .name   = NULL,
@@ -458,7 +470,7 @@ static int fio_netio_connect(struct thread_data *td, struct fio_file *f)
 {
        struct netio_data *nd = td->io_ops->data;
        struct netio_options *o = td->eo;
-       int type, domain, optval;
+       int type, domain;
 
        if (o->proto == FIO_TYPE_TCP) {
                domain = AF_INET;
@@ -483,7 +495,8 @@ static int fio_netio_connect(struct thread_data *td, struct fio_file *f)
 
 #ifdef CONFIG_TCP_NODELAY
        if (o->nodelay && o->proto == FIO_TYPE_TCP) {
-               optval = 1;
+               int optval = 1;
+
                if (setsockopt(f->fd, IPPROTO_TCP, TCP_NODELAY, (void *) &optval, sizeof(int)) < 0) {
                        log_err("fio: cannot set TCP_NODELAY option on socket (%s), disable with 'nodelay=0'\n", strerror(errno));
                        return 1;
@@ -522,7 +535,7 @@ static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
        struct netio_data *nd = td->io_ops->data;
        struct netio_options *o = td->eo;
        socklen_t socklen = sizeof(nd->addr);
-       int state, optval;
+       int state;
 
        if (o->proto == FIO_TYPE_UDP) {
                f->fd = nd->listenfd;
@@ -545,7 +558,8 @@ static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
 
 #ifdef CONFIG_TCP_NODELAY
        if (o->nodelay && o->proto == FIO_TYPE_TCP) {
-               optval = 1;
+               int optval = 1;
+
                if (setsockopt(f->fd, IPPROTO_TCP, TCP_NODELAY, (void *) &optval, sizeof(int)) < 0) {
                        log_err("fio: cannot set TCP_NODELAY option on socket (%s), disable with 'nodelay=0'\n", strerror(errno));
                        return 1;
@@ -968,7 +982,7 @@ static struct ioengine_ops ioengine_rw = {
        .options                = options,
        .option_struct_size     = sizeof(struct netio_options),
        .flags                  = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR |
-                                 FIO_PIPEIO,
+                                 FIO_PIPEIO | FIO_BIT_BASED,
 };
 
 static int str_hostname_cb(void *data, const char *input)