client: respect --eta=never for networked connections
[fio.git] / client.c
index 779fb9d7f8d04f53bd56388d13f869d0760980e5..82e12855ca5f904943238a47ddcd0ceef5cda730 100644 (file)
--- a/client.c
+++ b/client.c
@@ -942,6 +942,8 @@ static void convert_ts(struct thread_stat *dst, struct thread_stat *src)
        dst->kb_base            = le32_to_cpu(src->kb_base);
        dst->unit_base          = le32_to_cpu(src->unit_base);
 
+       dst->sig_figs           = le32_to_cpu(src->sig_figs);
+
        dst->latency_depth      = le32_to_cpu(src->latency_depth);
        dst->latency_target     = le64_to_cpu(src->latency_target);
        dst->latency_window     = le64_to_cpu(src->latency_window);
@@ -959,7 +961,7 @@ static void convert_ts(struct thread_stat *dst, struct thread_stat *src)
        dst->ss_deviation.u.f   = fio_uint64_to_double(le64_to_cpu(src->ss_deviation.u.i));
        dst->ss_criterion.u.f   = fio_uint64_to_double(le64_to_cpu(src->ss_criterion.u.i));
 
-       if (dst->ss_state & __FIO_SS_DATA) {
+       if (dst->ss_state & FIO_SS_DATA) {
                for (i = 0; i < dst->ss_dur; i++ ) {
                        dst->ss_iops_data[i] = le64_to_cpu(src->ss_iops_data[i]);
                        dst->ss_bw_data[i] = le64_to_cpu(src->ss_bw_data[i]);
@@ -982,6 +984,7 @@ static void convert_gs(struct group_run_stats *dst, struct group_run_stats *src)
 
        dst->kb_base    = le32_to_cpu(src->kb_base);
        dst->unit_base  = le32_to_cpu(src->unit_base);
+       dst->sig_figs   = le32_to_cpu(src->sig_figs);
        dst->groupid    = le32_to_cpu(src->groupid);
        dst->unified_rw_rep     = le32_to_cpu(src->unified_rw_rep);
 }
@@ -1167,6 +1170,7 @@ static void convert_jobs_eta(struct jobs_eta *je)
        je->nr_threads          = le32_to_cpu(je->nr_threads);
        je->is_pow2             = le32_to_cpu(je->is_pow2);
        je->unit_base           = le32_to_cpu(je->unit_base);
+       je->sig_figs            = le32_to_cpu(je->sig_figs);
 }
 
 void fio_client_sum_jobs_eta(struct jobs_eta *dst, struct jobs_eta *je)
@@ -1662,6 +1666,8 @@ int fio_handle_client(struct fio_client *client)
        dprint(FD_NET, "client: got cmd op %s from %s (pdu=%u)\n",
                fio_server_op(cmd->opcode), client->hostname, cmd->pdu_len);
 
+       client->last_cmd = cmd->opcode;
+
        switch (cmd->opcode) {
        case FIO_NET_CMD_QUIT:
                if (ops->quit)
@@ -1685,7 +1691,7 @@ int fio_handle_client(struct fio_client *client)
                struct cmd_ts_pdu *p = (struct cmd_ts_pdu *) cmd->payload;
 
                dprint(FD_NET, "client: ts->ss_state = %u\n", (unsigned int) le32_to_cpu(p->ts.ss_state));
-               if (le32_to_cpu(p->ts.ss_state) & __FIO_SS_DATA) {
+               if (le32_to_cpu(p->ts.ss_state) & FIO_SS_DATA) {
                        dprint(FD_NET, "client: received steadystate ring buffers\n");
 
                        size = le64_to_cpu(p->ts.ss_dur);
@@ -1828,6 +1834,9 @@ static void request_client_etas(struct client_ops *ops)
        struct client_eta *eta;
        int skipped = 0;
 
+       if (eta_print == FIO_ETA_NEVER)
+               return;
+
        dprint(FD_NET, "client: request eta (%d)\n", nr_clients);
 
        eta = calloc(1, sizeof(*eta) + __THREAD_RUNSTR_SZ(REAL_MAX_JOBS));
@@ -1897,16 +1906,19 @@ static int client_check_cmd_timeout(struct fio_client *client,
        int ret = 0;
 
        flist_for_each_safe(entry, tmp, &client->cmd_list) {
+               unsigned int op;
+
                reply = flist_entry(entry, struct fio_net_cmd_reply, list);
 
                if (mtime_since(&reply->ts, now) < FIO_NET_CLIENT_TIMEOUT)
                        continue;
 
+               op = reply->opcode;
                if (!handle_cmd_timeout(client, reply))
                        continue;
 
                log_err("fio: client %s, timeout on cmd %s\n", client->hostname,
-                                               fio_server_op(reply->opcode));
+                                               fio_server_op(op));
                ret = 1;
        }
 
@@ -1936,7 +1948,10 @@ static int fio_check_clients_timed_out(void)
                else
                        log_err("fio: client %s timed out\n", client->hostname);
 
-               client->error = ETIMEDOUT;
+               if (client->last_cmd != FIO_NET_CMD_VTRIGGER)
+                       client->error = ETIMEDOUT;
+               else
+                       log_info("fio: ignoring timeout due to vtrigger\n");
                remove_client(client);
                ret = 1;
        }