return 1;
}
+ if (cmd->pdu_len > FIO_SERVER_MAX_FRAGMENT_PDU) {
+ log_err("fio: command payload too large: %u\n", cmd->pdu_len);
+ return 1;
+ }
+
return 0;
}
struct all_io_list state;
state.threads = cpu_to_le64((uint64_t) 0);
- fio_net_queue_cmd(FIO_NET_CMD_VTRIGGER, &state, sizeof(state), NULL, SK_F_COPY);
+ fio_net_queue_cmd(FIO_NET_CMD_VTRIGGER, &state, sizeof(state), NULL, SK_F_COPY | SK_F_INLINE);
} else
- fio_net_queue_cmd(FIO_NET_CMD_VTRIGGER, rep, sz, NULL, SK_F_FREE);
+ fio_net_queue_cmd(FIO_NET_CMD_VTRIGGER, rep, sz, NULL, SK_F_FREE | SK_F_INLINE);
exec_trigger(buf);
return 0;
{
struct fio_net_cmd cmd;
struct iovec iov[2];
+ size_t this_len;
+ int ret;
iov[0].iov_base = (void *) &cmd;
iov[0].iov_len = sizeof(cmd);
- iov[1].iov_base = (void *) buf;
- iov[1].iov_len = size;
- __fio_init_net_cmd(&cmd, opcode, size, tag);
- cmd.flags = __cpu_to_le32(flags);
- fio_net_cmd_crc_pdu(&cmd, buf);
+ do {
+ uint32_t this_flags = flags;
+
+ this_len = size;
+ if (this_len > FIO_SERVER_MAX_FRAGMENT_PDU)
+ this_len = FIO_SERVER_MAX_FRAGMENT_PDU;
+
+ if (this_len < size)
+ this_flags |= FIO_NET_CMD_F_MORE;
+
+ __fio_init_net_cmd(&cmd, opcode, this_len, tag);
+ cmd.flags = __cpu_to_le32(this_flags);
+ fio_net_cmd_crc_pdu(&cmd, buf);
- return fio_sendv_data(sk, iov, 2);
+ iov[1].iov_base = (void *) buf;
+ iov[1].iov_len = this_len;
+
+ ret = fio_sendv_data(sk, iov, 2);
+ size -= this_len;
+ buf += this_len;
+ } while (!ret && size);
+
+ return ret;
}
static void finish_entry(struct sk_entry *entry)
}
int fio_server_get_verify_state(const char *name, int threadnumber,
- void **datap, int *version)
+ void **datap)
{
struct thread_io_list *s;
struct cmd_sendfile out;
* the header, and the thread_io_list checksum
*/
s = rep->data + sizeof(struct verify_state_hdr);
- if (verify_state_hdr(rep->data, s, version)) {
+ if (verify_state_hdr(rep->data, s)) {
ret = EILSEQ;
goto fail;
}
return -1;
}
#ifdef SO_REUSEPORT
- if (setsockopt(sk, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt)) < 0) {
- log_err("fio: setsockopt(REUSEPORT): %s\n", strerror(errno));
- close(sk);
- return -1;
- }
+ /*
+ * Not fatal if fails, so just ignore it if that happens
+ */
+ setsockopt(sk, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt));
#endif
if (use_ipv6) {