Use persistent discovery controller by default#3472
Conversation
|
The idea of #3112 is to make the DC persistent based on the info from the DC. The global setting is basically wrong. It should always be off by default and only when the DC announces it wants be used as persistent, nvme-cli should do it. |
a13506d to
c1c9bd9
Compare
|
@igaw is more along the lines of what the feature request meant? |
|
Yes as far I can tell from a quick glance. Did you have a chance to test this against a target? @martin-gpy in case you have a cycle for testing, I would appreciate it! |
|
@igaw Yes i did and it does seems to work as expected. Though one thing that doesn't make sense to me is why |
Well, thing it that the decision to create a persistent discovery controller is pretty much an admin choice. For some fabrics (like FC) creating a PDC is pretty much pointless as the fabrics always knows which ports are attached, and will always be notified if new ports are accessible. And creating a PDC eats up resources on the target, so admins might decide not to use them to save resources on the target. So yes, an admin-settable option is still required. |
|
Oops, pushed the wrong button. Sorry. |
4ccd4fc to
bdccb46
Compare
|
@igaw is there a way to generate the docs and the accesors for |
|
Why is the 'pdc supported' flag tagged to the host? It is the subsystem (well, the description of the subsystem in the discovery log page) which specifies whether PDC is supported. I think it would be better to move the flag to the subsystem... |
Same reason |
7403d70 to
80a57f9
Compare
NVMe PDC (Persistent Discovery Controller) Closes: linux-nvme#3112 Link: linux-nvme#3112 Signed-off-by: Jesse Taube <jtaubepe@redhat.com>
80a57f9 to
ecb174c
Compare
|
fwiw, I think with your change we can drop the global pdc setting. From what I learned in this discussion, it never made sense. |
|
The current implementation is the result of the request to have a compile-time setting on whether PDC should be created per default or not. But yes, I do agree
But then we should rather have this as an option in 'discovery.conf' ... |
If it is enabled there is no way to disable it too. Imo it's good to keep as the logic for it makes significantly more sence than the logic that uses the fabric context. Though having the ability to set the default value probably should be removed |
I added it as both. as of now there isn't really a way to have global settings in |
| libnvme_host_set_epcsd_enabled(h, true); | ||
|
|
||
| if (epcsd_disabled) | ||
| libnvme_host_set_epcsd_enabled(h, false); |
There was a problem hiding this comment.
tempted to argue for
if (epcsd_enabled || epcsd_disabled)
libnvme_host_set_epcsd_enabled(h, epcsd_enabled);but this might be a bit too obfuscated...
| (eflags & NVMF_DISC_EFLAGS_EPCSD) && | ||
| libnvme_host_is_epcsd_enabled(h, DEFAULT_EPCSD_ENABLED)) { | ||
| libnvmf_context_set_persistent(fctx, true); | ||
| break; |
There was a problem hiding this comment.
could you move this part into the existing loop where we already have the NVMF_DISC_EFLAGS_EPCSD check?
|
Looks good. Just a couple of nitpicks. Could add a prefix to the subject, e.g. "fabrics: ..." and drop the links to github. The commit message should contain everything it needs to make it self explenatory. We might have to move eventually to a different hosters and then all those links are pretty useless. Thanks! |
|
I wonder: do we really need this complexity? IE is it really worth it to have two additional settings? |
|
/*
* Are we supposed to keep the discovery
* controller around?
*/
disconnect = !nfctx.persistent;
if (strcmp(e->subnqn, NVME_DISC_SUBSYS_NAME)) {
/*
* Does this discovery controller doesn't
* support explicit persistent connection?
*/
if (!(eflags & NVMF_DISC_EFLAGS_EPCSD))
disconnect = true;
else
disconnect = false;
}Thus |
That would be preferable. I would think the decision matrix should be: -> Does the controller support explicit persistent connections (ie NVMF_DISC_EFLAGS_EPCSD is set)? This requires unique discovery subsystems to work correctly. Which is fine as I would not create a PDC for the default discovery NQN; the kernel will create a new discovery controller for every default discovery NQN, so we're having a hard time identifying which of the tons of discovery subsystems we should be using. |
No description provided.