public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Sachin Sant <sachinp@linux.ibm.com>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 2/3] io_uring: Test READV and WRITEV operations
Date: Wed, 15 Apr 2026 19:26:39 +0530	[thread overview]
Message-ID: <e4a4196d-03da-45a9-add8-4cf70286898d@linux.ibm.com> (raw)
In-Reply-To: <ad9hdOxg9CYxgNBb@yuki.lan>

>> +static void prepare_read_buffers(void)
>> +{
>> +	size_t i;
>> +
>> +	for (i = 0; i < NUM_VECS; i++)
>> +		memset(read_iovs[i].iov_base, 0, read_iovs[i].iov_len);
>> +}
>> +
>> +static void clear_iovec_buffers(struct iovec *iovs, int nvecs)
>> +{
>> +	int i;
>> +
>> +	for (i = 0; i < nvecs; i++)
>> +		memset(iovs[i].iov_base, 0, iovs[i].iov_len);
>> +}
> These two functions are nearly identical, we really need only one
> function to clear the buffers.
>
Indeed. Good catch. Will merge them.

>> +static void test_varying_sizes(void)
>> +{
>> +	int fd;
>> +	int expected_size = VAR_BUF1_SIZE + VAR_BUF2_SIZE + VAR_BUF3_SIZE;
>> +
>> +	tst_res(TINFO, "Testing vectors with varying sizes including zero-length buffer");
>> +
>> +	io_uring_init_buffer_pattern(var_write_iovs[0].iov_base, VAR_BUF1_SIZE, 'X');
>> +	io_uring_init_buffer_pattern(var_write_iovs[2].iov_base, VAR_BUF2_SIZE, 'Y');
>> +	io_uring_init_buffer_pattern(var_write_iovs[3].iov_base, VAR_BUF3_SIZE, 'Z');
> Can we handle this with the prepare_write_buffers() as well?
These two functions implement different logic. prepare_write_buffers() 
create a rotating
pattern unique to each vector while io_uring_init_buffer_pattern() fills 
a buffer with
a single repeating character.

But I see your point. I will merge these two as well.

Thank You for the detailed review.

-- 
Thanks
- Sachin



-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-04-15 13:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24  5:22 [LTP] [PATCH v2 0/3] io_uring READ(V), WRITE(v) operation tests Sachin Sant
2026-03-24  5:22 ` [LTP] [PATCH v2 1/3] io_uring: Test IORING READ and WRITE operations Sachin Sant
2026-04-16  8:55   ` Martin Doucha
2026-04-16  9:36     ` Sachin Sant
2026-03-24  5:22 ` [LTP] [PATCH v2 2/3] io_uring: Test READV and WRITEV operations Sachin Sant
2026-04-15  9:59   ` Cyril Hrubis
2026-04-15 13:56     ` Sachin Sant [this message]
2026-03-24  5:22 ` [LTP] [PATCH v2 3/3] io_uring: Refactor io_uring01 to use common code Sachin Sant
2026-04-15  9:35 ` [LTP] [PATCH v2 0/3] io_uring READ(V), WRITE(v) operation tests Cyril Hrubis
2026-04-15 13:58   ` Sachin Sant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e4a4196d-03da-45a9-add8-4cf70286898d@linux.ibm.com \
    --to=sachinp@linux.ibm.com \
    --cc=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox