public inbox for [email protected]
 help / color / mirror / Atom feed
From: Daniel H <[email protected]>
To: [email protected]
Subject: Ring Setup Question
Date: Thu, 23 Apr 2020 10:38:28 -0400	[thread overview]
Message-ID: <CAAUBs7+nziOz02XPaBsP_6-4wgT3fV+VzAzgwOGAkui3K=czRQ@mail.gmail.com> (raw)

I'm working on a implementation of for the Go language and I've been running
into a failed test case that I can't understand. The test is setup in the
following manner; first write some data into a file and then read the data
back using the io_uring. The simple test case of reading back all the bytes
passes. However, when using two reads to read half the amount of data what I
observe is the second time the ring is entered (after the first read completes
successfully) is that the resulting CQE doesn't match the UserData. The test
uses a monotonically increasing value for UserData and the following debug
messages show that each entry has a unique UserData field. I'm guessing
the ring is setup properly, however I'm not sure how to proceed.

=== RUN   TestRingFileReadWriterRead
pre enter
sq head: 0 tail: 1
sq entries: [{Opcode:22 Flags:2 Ioprio:0 Fd:8 Offset:0
Addr:824634362160 Len:7 UFlags:0 UserData:1 Anon0:[0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0]} {Opcode:0 Flags:0 Ioprio:0 Fd:0 Offset:0
Addr:0 Len:0 UFlags:0 UserData:0 Anon0:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0]}]
cq head: 0 tail: 0
cq entries: [{UserData:0 Res:0 Flags:0} {UserData:0 Res:0 Flags:0}]
enter complete
sq head: 1 tail: 1
sq entries: [{Opcode:22 Flags:2 Ioprio:0 Fd:8 Offset:0
Addr:824634362160 Len:7 UFlags:0 UserData:1 Anon0:[0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0]} {Opcode:0 Flags:0 Ioprio:0 Fd:0 Offset:0
Addr:0 Len:0 UFlags:0 UserData:0 Anon0:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0]}]
cq head: 1 tail: 1
cq entries: [{UserData:1 Res:7 Flags:0} {UserData:0 Res:0 Flags:0}]
pre enter
sq head: 1 tail: 2
sq entries: [{Opcode:22 Flags:2 Ioprio:0 Fd:8 Offset:0
Addr:824634362160 Len:7 UFlags:0 UserData:1 Anon0:[0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0]} {Opcode:22 Flags:2 Ioprio:0 Fd:8
Offset:7 Addr:824634363240 Len:7 UFlags:0 UserData:2 Anon0:[0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]}]
cq head: 1 tail: 1
cq entries: [{UserData:1 Res:7 Flags:0} {UserData:0 Res:0 Flags:0}]
enter complete
sq head: 2 tail: 2
sq entries: [{Opcode:22 Flags:2 Ioprio:0 Fd:8 Offset:0
Addr:824634362160 Len:7 UFlags:0 UserData:1 Anon0:[0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0]} {Opcode:22 Flags:2 Ioprio:0 Fd:8
Offset:7 Addr:824634363240 Len:7 UFlags:0 UserData
:2 Anon0:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]}]
cq head: 1 tail: 2
cq entries: [{UserData:1 Res:7 Flags:0} {UserData:1 Res:7 Flags:0}]

             reply	other threads:[~2020-04-23 14:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 14:38 Daniel H [this message]
2020-04-23 15:24 ` Ring Setup Question Jens Axboe

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='CAAUBs7+nziOz02XPaBsP_6-4wgT3fV+VzAzgwOGAkui3K=czRQ@mail.gmail.com' \
    [email protected] \
    [email protected] \
    /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