Recent changes (master)
The following changes since commit 2768c33ec1a34cbc03f122876fea72a630da9ccb:
Merge branch 't0036-0037' of https://github.com/kawasaki/fio (2025-02-14 09:26:48 -0500)
are available in the Git repository at:
git://git.kernel.dk/fio.git master
for you to fetch changes up to 3ee531989f41b242b73d9f6cb33186a686a7133c:
crc/sha512: fix missing finalize part of sha512 hash (2025-02-17 16:30:07 -0700)
----------------------------------------------------------------
Jens Axboe (1):
crc/sha512: fix missing finalize part of sha512 hash
Ritesh Harjani (IBM) (1):
libaio: Add vectored io support
HOWTO.rst | 4 ++++ crc/sha512.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ crc/sha512.h | 1 + engines/libaio.c | 37 ++++++++++++++++++++++++++++++++++-- verify.c | 2 ++ 5 files changed, 99 insertions(+), 2 deletions(-)
---
Diff of recent changes:
HOWTO.rst +4 -0
@@ -2515,6 +2515,10 @@ with the caveat that when used on the command line, they must come after the not support torn-write protection. To learn a file's torn-write limits, issue statx with STATX_WRITE_ATOMIC. +.. option:: libaio_vectored=bool : [libaio] + + Submit vectored read and write requests. + .. option:: fdp=bool : [io_uring_cmd] [xnvme] Enable Flexible Data Placement mode for write commands.
crc/sha512.c +57 -0
60 lines not on this page · raw message
crc/sha512.h +1 -0
@@ -12,5 +12,6 @@ struct fio_sha512_ctx {void fio_sha512_init (struct fio_sha512_ctx *);void fio_sha512_update (struct fio_sha512_ctx *,const uint8_t *,unsigned int ); +void fio_sha512_final (struct fio_sha512_ctx *sctx);#endif
engines/libaio.c +35 -2
@@ -37,6 +37,7 @@ struct libaio_data {struct io_u **io_us;struct io_u **io_u_index; +struct iovec *iovecs;/* for vectored requests */ /* * Basic ring buffer. 'head' is incremented in _queue(), and
@@ -60,6 +61,7 @@ struct libaio_options {unsigned int userspace_reap;struct cmdprio_options cmdprio_options;unsigned int nowait; +unsigned int vectored; };static struct fio_option options[] = {
@@ -81,6 +83,16 @@ static struct fio_option options[] = { .category = FIO_OPT_C_ENGINE, .group = FIO_OPT_G_LIBAIO, }, + { + .name = "libaio_vectored", + .lname = "Use libaio preadv,pwritev", + .type = FIO_OPT_BOOL, + .off1 = offsetof(struct libaio_options, vectored), + .help = "Use libaio {preadv,pwritev} instead of libaio {pread,pwrite}", + .category = FIO_OPT_C_ENGINE, + .group =FIO_OPT_G_LIBAIO , + }, + CMDPRIO_OPTIONS(struct libaio_options, FIO_OPT_G_LIBAIO), { .name = NULL,
@@ -101,13 +113,32 @@ static int fio_libaio_prep(struct thread_data *td, struct io_u *io_u)struct libaio_options *o = td->eo;struct fio_file *f = io_u->file;struct iocb *iocb = &io_u->iocb; +struct libaio_data *ld = td->io_ops_data;if (io_u->ddir ==DDIR_READ ) { -io_prep_pread (iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset); +if (o->vectored) { +struct iovec *iov = &ld->iovecs[io_u->index]; + + iov->iov_base = io_u->xfer_buf; + iov->iov_len = (size_t )io_u->xfer_buflen; +io_prep_preadv (iocb, f->fd, iov,1 , io_u->offset); + }else { +io_prep_pread (iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, + io_u->offset); + }if (o->nowait) iocb->aio_rw_flags |=RWF_NOWAIT ; }else if (io_u->ddir ==DDIR_WRITE ) { -io_prep_pwrite (iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset); +if (o->vectored) { +struct iovec *iov = &ld->iovecs[io_u->index]; + + iov->iov_base = io_u->xfer_buf; + iov->iov_len = (size_t )io_u->xfer_buflen; +io_prep_pwritev (iocb, f->fd, iov,1 , io_u->offset); + }else { +io_prep_pwrite (iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, + io_u->offset); + }if (o->nowait) iocb->aio_rw_flags |=RWF_NOWAIT ;#ifdef FIO_HAVE_RWF_ATOMIC
@@ -394,6 +425,7 @@ static void fio_libaio_cleanup(struct thread_data *td)io_destroy (ld->aio_ctx);fio_cmdprio_cleanup (&ld->cmdprio); +free (ld->iovecs);free (ld->aio_events);free (ld->iocbs);free (ld->io_us);
@@ -428,6 +460,7 @@ static int fio_libaio_init(struct thread_data *td) ld->aio_events =calloc (ld->entries,sizeof (struct io_event )); ld->iocbs =calloc (ld->entries,sizeof (struct iocb *)); ld->io_us =calloc (ld->entries,sizeof (struct io_u *)); + ld->iovecs =calloc (ld->entries,sizeof (ld->iovecs[0 ])); td->io_ops_data = ld;
verify.c +2 -0
@@ -537,6 +537,7 @@ static int verify_io_u_sha512(struct verify_header *hdr, struct vcont *vc)fio_sha512_init (&sha512_ctx);fio_sha512_update (&sha512_ctx, p, hdr->len -hdr_size (vc->td, hdr)); +fio_sha512_final (&sha512_ctx);if (!memcmp (vh->sha512, sha512_ctx.buf,sizeof (sha512)))return 0 ;
@@ -1092,6 +1093,7 @@ static void fill_sha512(struct verify_header *hdr, void *p, unsigned int len)fio_sha512_init (&sha512_ctx);fio_sha512_update (&sha512_ctx, p, len); +fio_sha512_final (&sha512_ctx); }static void fill_sha256 (struct verify_header *hdr,void *p,unsigned int len)