oxidecomputer / oxidecomputer/propolis

nvme: don't pad strings with zeros

Open
#790 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
270
Forks
42
Avg merge
4d 5h
Merged PRs (30d)
6

Description

In #789 it was noted that we were trying to workaround cases where the virtual NVMe devices are padding the model, serial, and firmware revision entries of the identify controller data structure with the value 0x0 which turns it into a NUL character. This isn't quite correct per the NVMe spec. Instead, these fields are expected to be padded with strings and spaces. This means that the defaults that we're using which zero fill these fields (and any other strings) are incorrect and we should really be filling them with spaces. This is defined in Conventions section (§1.5) of the NVMe specification. While this wasn't explicit in NVMe 1.0 and NVMe 1.1, in NVMe 1.2 it makes it clear with: The string is left justified and shall be padded with spaces (ASCII character 20h) to the right if necessary. It's wroth noting that this is the same convention used in many other places.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the NVMe identify controller data structure and the defaults used for model, serial, firmware revision, and other string fields. Compare the padding behavior with the NVMe specification's Conventions section (§1.5). Done means these fields use space padding rather than NUL characters, with relevant tests or validation passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.