-
Notifications
You must be signed in to change notification settings - Fork 151
Rework controller reconfiguration #1060
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
Open
hreinecke
wants to merge
4
commits into
linux-nvme:master
Choose a base branch
from
hreinecke:ctrl-reconfig
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Separate out __nvme_deconfigure_ctrl() to make clear which attributes are to be saved during nvme_reconfigure_ctrl(). Signed-off-by: Hannes Reinecke <[email protected]>
The 'address' attribute is required in nvme_reconfigure_ctrl(), so we need to update it before calling the function and must not modify it in nvme_reconfigure_ctrl(). Signed-off-by: Hannes Reinecke <[email protected]>
The controller attributes have a different scope across reconfiguration; some are immutable, some persist across reconfiguration, and some will be reset when calling nvme_reconfigure_ctrl(). Signed-off-by: Hannes Reinecke <[email protected]>
…lers When a controller is disconnected it will just clear the volatile attributes, but remain part of the tree structure. So when traversing the tree one could access a disconnected controller, but then c->name is NULL. So fixup all places calling nvme_ctrl_get_name() to ensure that they don't crash on an empty name. Signed-off-by: Hannes Reinecke <[email protected]>
igaw
reviewed
Nov 3, 2025
| if (ret < 0) | ||
| return ret; | ||
|
|
||
| FREE_CTRL_ATTR(c->address); |
Collaborator
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.
Isn't nvme_init_ctrl called only once and thus c->address should be NULL at this point anyway?
Collaborator
|
The tests will not pass with this change ( before: test_lookup:
ctrls created:
ctrl0 0x0x28b04a90: tcp 192.168.1.1 192.168.1.20 (null) 4420 [PASS]
ctrl1 0x0x28b04c90: tcp 192.168.1.1 192.168.1.20 (null) 4421 [PASS]
ctrl2 0x0x28b05020: tcp 192.168.1.2 192.168.1.20 eth1 4420 [PASS]
ctrl3 0x0x28b05240: tcp 192.168.1.2 192.168.1.20 eth1 4421 [PASS]
ctrl4 0x0x28b05460: rdma 192.168.1.3 192.168.1.20 (null) (null) [PASS]
ctrl5 0x0x28b05640: rdma 192.168.1.4 192.168.1.20 (null) (null) [PASS]
ctrl6 0x0x28b05820: fc nn-0x201700a09890f5bf:pn-0x201900a09890f5bf nn-0x200000109b579ef3:pn-0x100000109b579ef3 (null) (null) [PASS]
ctrl7 0x0x28b05a00: fc nn-0x201700a09890f5bf:pn-0x201900a09890f5bf nn-0x200000109b579ef6:pn-0x100000109b579ef6 (null) (null) [PASS]
lookup controller:
ctrl0 0x0x28b04a90: tcp 192.168.1.1 192.168.1.20 (null) 4420
4420 -> ctrl0 0x0x28b04a90: tcp 192.168.1.1 192.168.1.20 (null) 4420 [PASS]
4420 192.168.1.20 -> ctrl0 0x0x28b04a90: tcp 192.168.1.1 192.168.1.20 (null) 4420 [PASS]
after: test_lookup:
ctrls created:
ctrl0 0x0x3ff75a90: tcp 192.168.1.1 192.168.1.20 (null) 4420 [PASS]
ctrl1 0x0x3ff75c90: tcp 192.168.1.1 192.168.1.20 (null) 4421 [PASS]
ctrl2 0x0x3ff75e90: tcp 192.168.1.2 192.168.1.20 eth1 4420 [PASS]
ctrl3 0x0x3ff760b0: tcp 192.168.1.2 192.168.1.20 eth1 4421 [PASS]
ctrl4 0x0x3ff762d0: rdma 192.168.1.3 192.168.1.20 (null) (null) [PASS]
ctrl5 0x0x3ff764b0: rdma 192.168.1.4 192.168.1.20 (null) (null) [PASS]
ctrl6 0x0x3ff76690: fc nn-0x201700a09890f5bf:pn-0x201900a09890f5bf nn-0x200000109b579ef3:pn-0x100000109b579ef3 (null) (null) [PASS]
ctrl7 0x0x3ff76870: fc nn-0x201700a09890f5bf:pn-0x201900a09890f5bf nn-0x200000109b579ef6:pn-0x100000109b579ef6 (null) (null) [PASS]
lookup controller:
ctrl0 0x0x3ff75a90: tcp 192.168.1.1 192.168.1.20 (null) 4420
4420 -> 0x0x3ff76a90: tcp 192.168.1.1 (null) (null) 4420 [FAILED]
4420 192.168.1.20 -> 0x0x3ff76c70: tcp 192.168.1.1 192.168.1.20 (null) 4420 [FAILED] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Calling nvme_reconfigure_ctrl() requires some attributes to be cleared and other to remain constant. This patchset documents the scope of the controller attributes, and also ensures that the code does not trip over an empty 'name' attribute (which is volatile and only set after 'connect' succeeded).
Fixes: #951