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

nvme: Live Migration #2560

Merged
merged 1 commit into from
Dec 20, 2024
Merged

nvme: Live Migration #2560

merged 1 commit into from
Dec 20, 2024

Conversation

NateThornton
Copy link
Contributor

Implementation of TP 4159 PCIe Infrastructure for Live Migration plugin. Includes command support for Track Send, Migration Receive, Migration Send, and Controller Data Queue; Identify Controller LM related fields; Bash and ZSH completions.

Changes are isolated to the User Data Migration subset, with Track Memory functionality deferred to a future commit.

TP4159 PCIe Infrastructure for Live Migration 2024.07.30 Ratified.pdf

@igaw
Copy link
Collaborator

igaw commented Nov 11, 2024

From a quick look, it looks good. The compiler is not happy though:

../plugins/lm/lm-nvme.c:485:65: error: '_Static_assert' with no message is a C2x extension [-Werror,-Wc2x-extensions]

@NateThornton NateThornton force-pushed the lm branch 2 times, most recently from ea71a95 to 3aec9ef Compare November 11, 2024 17:13
const char *sz = "CDQ Size (in dwords)";
const char *cntlid = "Controller ID";
const char *qt = "Queue Type (default: 0 = User Data Migration Queue)";
const char *consent = "I consent this will not work and understand a CDQ cannot be mapped "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one!

plugins/lm/lm-nvme.c Outdated Show resolved Hide resolved
plugins/lm/lm-nvme.c Outdated Show resolved Hide resolved
@NateThornton
Copy link
Contributor Author

@igaw Thanks for your feedback - I will make the corresponding changes to libnvme and then update this PR once available

@NateThornton NateThornton force-pushed the lm branch 3 times, most recently from c2fd66f to 694e013 Compare December 11, 2024 21:05
@NateThornton
Copy link
Contributor Author

As we placed the new lm iocts in libnvme version 1.12, I think this change is still pending the next libnvme release.

Then one follow-up change to meson.build is required to grab that new release.

@@ -617,6 +618,118 @@ _nvme () {
;;
esac
;;
(lm)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NateThornton Self-reminder these need updating too

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and while at, also split the tab completions changes into a separate patch. don't forget to update the docs too :)

@@ -1,6 +1,6 @@
[wrap-git]
url = https://github.com/linux-nvme/libnvme.git
revision = 8efcec730603ffcc379ba0bf821e4c24ec87715b
revision = 27ed889d0b1917919763816c97a49bb6e29d4547
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, could split the libnvme build dependency into a separate patch and have it first? This makes any backporting way simpler.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #2616

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually you just add a patch to a PR, no need for an extra PR just to update the dependency.

obj_add_uint(r, "mcumq", le16_to_cpu(ctrl->mcudmq));
obj_add_uint(r, "mcmr", le16_to_cpu(ctrl->mcmr));
obj_add_uint(r, "nmcmr", le16_to_cpu(ctrl->nmcmr));
obj_add_uint(r, "mcdqpc", le16_to_cpu(ctrl->mcdqpc));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the nvme-print*.c updates should be a separate patch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad you pointed this out because it's already included in #2607. Surprised I didn't get a merge conflict.

return err;
}

static void json_controller_state_data(struct nvme_lm_controller_state_data *data, size_t len)
Copy link
Collaborator

@igaw igaw Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it might make sense to support builds without json-c dependencies for this new plugin. Most plugins depend on json-c to be available. @ikegami-t started to split the plugins so they work also when json-c is missing (see the ocp plugin). I think it would be good to have this from the beginning as it is currently small code base. LM is something in the base spec, so not unlikely to change or get udpated soonish :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored following ocp plugin as an example.

@NateThornton NateThornton force-pushed the lm branch 2 times, most recently from 34a081d to c9af9e5 Compare December 18, 2024 01:07
@igaw
Copy link
Collaborator

igaw commented Dec 18, 2024

The commit subject should be prefix, e.g. plugins/lm: introduce live migration plugin, plugins/ls: add print files, ...
Commit message shouldn't contain version information such as 'reverted ...'. After it gets merged no one cares about this things. If we really want to preserve the development history we would need to change a few things anyway.

Reverted nvme-print-stdout.c changes: still something in the first patch. As I said, I don't mind that nvme-print-stdout.c and nvme-print-json.c get updated, it just deserves it's own patch.

Also why patch 2 removing stuff added previously. These patches should really be consisting out of new code being added and a tiny change in the meson.build file.

And the build is unhappy due to printf formatting issues.

@NateThornton NateThornton force-pushed the lm branch 4 times, most recently from d187075 to 84f5e93 Compare December 18, 2024 15:12
@NateThornton
Copy link
Contributor Author

I should have clarified my intent to squash the commits after they were individually reviewed. Everything now is in one commit and the build is passing.

I think the remaining warnings are acceptable, but if something needs to be done to clean them up LMK.

As we placed the new lm_* ioctls in release 12 of libnvme, does this merge need to wait until that is released?

Implementation of TP 4159 PCIe Infrastructure for Live Migration plugin.
Includes command support for Track Send, Migration Receive, Migration
Send, and Controller Data Queue; Identify Controller LM related fields;
Bash and ZSH completions.

Changes are isolated to the User Data Migration subset, with Track
Memory functionality deferred to a future commit.

Signed-off-by: Nate Thornton <[email protected]>
@igaw
Copy link
Collaborator

igaw commented Dec 20, 2024

I've dropped the changes in nvme-print-stdout.c. These were removing the output for the LM feature.

Thanks!

@igaw igaw merged commit 6d2a869 into linux-nvme:master Dec 20, 2024
16 of 17 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