-
Notifications
You must be signed in to change notification settings - Fork 635
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
Added NBFT table support #1791
Added NBFT table support #1791
Conversation
Just two quick remarks as we have to agree on this first (the implementation can be changed update/changed without breaking any users):
|
This would result in 3-level subcommands like Let's summarize the functionality we need, independent of the FW implementation:
No. 4) and 5) would need integration of NBFT support in the standard subcommands |
I think a) is not really controversial just the question of the name. I don't mind going with The bigger issue for me is b). This needs a strong argument why it should exists in the first place. This includes documentation how to use it correctly (if we agree it should exist). |
Just to make it clear: Why do we need another 'connect' command? This needs to be explained. What are the use cases? |
This comment was marked as resolved.
This comment was marked as resolved.
I've pondered this some more. The main difference between
Idea: we could also add |
|
So the argument is that we only need either |
Actually, I would do it exactly the other way round. |
} | ||
|
||
if (ret) | ||
fprintf(stderr, "no controller found\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should handle the case errno == ENVME_CONNECT_ALREADY
here. Dracut may need to do multiple connection attempts. "no controller found" is not a helpful error message if the subsystem at hand is already connected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is nvme_errno_to_string()
which translates the error codes into something more useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might actually consider not returning an error if we find that (all?) connections specified in the NBFT are already set up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW nvme connect-all
ignores already connected targets. It only logs the warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mwilck are we good here? Do you still want to make this change?
nbft.c
Outdated
nbft_json = json_create_object(); | ||
if (!nbft_json) | ||
return NULL; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a "version" field to the json output. This way, if the format of the json changes in the future, consumers will be able to detect it easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case the schema and parser in libnvme needs to be updated accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was referring to the format of the JSON only here, i.e. the API presented to consumers of the JSON by nvme-cli. Currently the code for converting the NBFT to JSON is only in nvme-cli, not in libnvme. So I'm unsure what changes in schema and parser you're referring to.
You are right that we should reflect possible changes in the NBFT format itself, too. So maybe we need to version fields, or a 2-digit version, one part indicating the version of the NBFT, and the other the version of the JSON output. When the NBFT format changes, the JSON will almost certainly change as well, but not vice versa.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was referring the JSON config file. But this seems to be a different one. Still a schema for it wouldn't hurt, I suppose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still a schema for it wouldn't hurt, I suppose.
ack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the last remaining open issues.
This applies only to
Hm. AFAICS, the distinctive difference between I don't want to turn this into a religious matter. If everyone else agrees |
I don't have any objections to "connect-all --nbft". |
As I understood @mwilck, he wants to keep the effort limited hence the wish only to do one connect command. As far I can tell the newly nbtf connect code will life in a separate function and |
I just want clarification how the command line API should look like. And I believe this decision should be made now. To me, the important thing is that the final command line API provides commands to execute any of the following:
|
Let me suggest the following:
edit: I updated the last proposal. So it's what @mwilck suggested in the beginning using the |
I realize that the code in this PR doesn't build because it doesn't contain the changes to |
FWIW, we can also progress quickly on the libnvme part and then look/update this PR. |
3198db6
to
d13c14a
Compare
I have squashed and rebased both linux-nvme/libnvme#572 and #1791 onto the HEAD of the master branch. After some work on the libnvme.spec file in my rh_linux_poc here I was able to get my fedora RPMs to compile and install. However, testing these new rebased bits in my QEMU POC fails. After rebasing everything to the HEAD of the master branch in libnvme and nvme-cli, these changes no longer work with dracutdevs/dracut#2184 and with timberland-sig/edk2@9e63dc0. I am no longer able to boot my QEMU host with NVMe/TCP using these bits. |
9cfa0ec
to
84e4bbc
Compare
Pushed a major update which should address all comments. Please review. |
All issues have been resolved. The newest version of the rh_linux_poc which includes all the needed prebuilt rpms and artifacts used to test this latest nvme-cli changes can be seen here. The dracut patches used with this version of nvme-cli can be seen here. The prebuilt Fedora RPMs are all publicly available in my COPR repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only minor change requests/question
- just splitting the patch slightly
- questions on some comments in the connect algorithm code.
- updating of the man pages.
Looks in great shape
84e4bbc
to
c94829b
Compare
To prepare for the addition of nbft functionality fixup the fabrics declarations. Signed-off-by: John Meneghini <jmeneghi@redhat.com>
c94829b
to
7cc9231
Compare
I've addressed all of @igaw s comments. There are now three commits. Documentation has been added, and
|
To build the Timberland sig nvme-cli repository you need to clone the repository, |
80ab18a
to
7979dfd
Compare
Added support for parsing the contents of the NBFT table (per NVMe-oF boot specification v1.0) with the connect-all and discover commands. nvme discover/connect-all --nbft ignore /etc/nvme config and use NBFT tables nvme discover/connect-all --no-nbft ignore NBFT tables and use /etc/nvme config nvme discover/connect-all --nbft-path=<STR> user-defined path for NBFT tables Signed-off-by: Stuart Hayes <stuart_hayes@dell.com> Signed-off-by: Martin Belanger <martin.belanger@dell.com> Use the new nbft public API. Signed-off-by: Tomas Bzatek <tbzatek@redhat.com> Signed-off-by: Martin Wilck <mwilck@suse.com> Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Display contents of the ACPI NBFT files. Usage: nvme nbft show <device> [OPTIONS] Options: [ --output-format=<FMT>, -o <FMT> ] --- Output format: normal|json [ --subsystem, -s ] --- show NBFT subsystems [ --hfi, -H ] --- show NBFT HFIs [ --discovery, -d ] --- show NBFT discovery controllers [ --nbft-path=<STR> ] --- user-defined path for NBFT tables Signed-off-by: Stuart Hayes <stuart_hayes@dell.com> Signed-off-by: Martin Wilck <mwilck@suse.com> Signed-off-by: John Meneghini <jmeneghi@redhat.com>
7979dfd
to
f41dea3
Compare
Thanks a lot! We have some time to stabilize or change things without any concerns of breaking stuff (inside this project, obviously only), since we still have time until the next release. But I suspect you really want to keep the command line options now as it is :) |
Added support for parsing and printing the contents of the NBFT table (per NVMe-oF boot specification v1.0).
Signed-off-by: Stuart Hayes stuart_hayes@dell.com
Signed-off-by: Martin Belanger martin.belanger@dell.com
Signed-off-by: Tomas Bzatek tbzatek@redhat.com
Signed-off-by: Martin Wilck mwilck@suse.com
Signed-off-by: John Meneghini jmeneghi@redhat.com