Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io_uring: Fix error status of cqe #1764

Merged
merged 2 commits into from
May 28, 2024

Conversation

minwooim
Copy link
Contributor

The 'io_uring_cmd' ioengine returns the status code type and status code of
NVMe CQE [27:17] to io_u in case of errors. The first patch fixes the CQE
value being returned as negative since it's not an errno. The next one is a
trivial patch to support hexadecimal format to 'ignore_error' option to mask
values such as the status type and status code in a more comfortable way.

minwooim added 2 commits May 15, 2024 14:36
Since cqe->res is expected to be a negative value of errno, it's been
flipped to a positive value before passing it to io_u.c.  However, in
case of io_uring_cmd with cmd_type=nvme, cqe->res might represent a NVMe
completion status type and code along with control fields such as DNR
since nvme_uring_cmd_end_io() in the NVMe driver sets the completion
status value and passes it up to io_uring.

For example, If a DULBE(Deallocated or Unwritten Logical Block Error)
is coming up from the device, cqe->res here would be 0x4287 which is a
DULBE error code of media error type.

This patch unified the error code to a positive value regardless of the
error type.

Signed-off-by: Minwoo Im <[email protected]>
The 'ignore_error=str' option expects either the name or the numeric
value of the errno in string format.  With recent additions like
io_uring_cmd ioengine, it's been possible to check not only errno values
but also the actual status values provided by the storage device.

Given that most status codes in NVMe specs are represented in
hexadecimal, specifying error values in hexadecimal is also useful to
ignore some errors.

For example, DULBE (Deallocated or Unwritten Logical Block Error) status
code can be ignored:

	ignore_error=0x287

Signed-off-by: Minwoo Im <[email protected]>
@axboe axboe merged commit dfccaca into axboe:master May 28, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants