-
Notifications
You must be signed in to change notification settings - Fork 660
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
nbft: Always stick to HFI-defined host_traddr #2180
Comments
Hi @tbzatek - Regarding the
For TCP (and TCP only), |
Ah, thanks, I'm missing the low-level insight really. Still, wouldn't the end result effectively be equal, i.e. the kernel would use a network interface the Anyway, I think we'll first need to solve timberland-sig/edk2#29 and linux-nvme/libnvme#766 before fixing the loose end here. |
Not quite. When
Correct! If all you have is a source address and you want to use that to force the connection on a specific interface regardless of the routing tables, then you need to find out which interface owns that address and use it with |
I don't we should completely remove the fallback code. Doing that would strongly increase the risk of boot failures, which is never a good thing. However, I would suggest to walk the list of HFIs and use the fallback (without host_iface / host_traddr) only if connect attempts through all HFIs have failed. This would only work if multipath was configured in the NBFT via secondary HFI association. In theory, the NVMe boot spec allows 3 ways to set up multipath:
My proposed suggestion would cover only case 1. Covering the other cases would be complicated because we'd need to collect all NBFT data and do "deduplication" on them somehow before attempting to connect. |
Thanks Martin, useful insight! In our case, the In case of DHCP, the HFI IP address (as being assigned to the EFI DHCP client) may differ from what's actually assigned to the particular network interface in OS stage (due to DHCP client differences and different identifiers sent out). We don't want the kernel host driver to look up a different interface that is best for the At least that's my proposal, if it makes sense.
Yes, this is what I'm currently seeing due to the mixed-up HFI indexes in the NBFT table, i.e. wrong
Nice, I think this might be the way to go. |
Agree, the reason for the fallback is still valid and needed.
Agree with moving the fallback at the end, after all regular attempts. I would still like to keep the
Yes, it will currently fail until the firmware and the libnvme sides are fixed. I would suggest to postpone the proper fix to nvme-cli until everything else is fixed.
Right, I think what I have been talking about so far was for the case 2. We'll need to find a fix that suits both scenarios. |
Maybe we use the other information in the HFI TCP transport info descriptor (MAC address and/or PCI address) to look up and set host_iface in discover_from_nbft()? |
Yes, we should do that. It matters only for multipath scenarios, and I believe that there will be only a few (corner) cases where this makes an actual difference, but if we want to be correct, we have to do it. @martin-belanger has pointed out that libnvme already has the logic to do this kind of interface matching when opening connections, so I would assume that this already works. Or am I missing something? |
Additional remarks based on a recent SUSE bug report. My memory has deceived me, I thougt we had made more progress in the meantime. The The current state is:
IOW, for DHCP configured interfaces at least, we might as well ignore the Footnotes
|
Agree, this looks like a clean way.
Right, as the address might be absent in the system, resolving corresponding interface might fail. In my original case, I still had the address matched, just mixed up due to wrong HFI indexes.
So until TP8027 is ready for use, do we agree to go with resolving I still think this won't currently work with EDK2 due to mixed HFI indexes (and also timberland-sig/edk2#29), but this appears to be correct with Dell firmware from what I've seen so far. |
FYI, for the discovery code in #2315 I retained the original workaround for the time being. There are now three places with the fallback. |
Good to close? |
Nope, this has not been implemented yet. |
nvme-cli/nbft.c
Lines 162 to 190 in dcdad6f
I'm not sure this is 100% correct. The possibility of receiving different IP address between DHCP requests (UEFI vs. linux or simply different DHCP clients) is valid and should be covered.
However, consider the following scenario:
Setting proper
host_traddr
for connection attempts is crucial to indicate the source interface. Once omitted by the mentioned code snippet, connection might be established from a different interface, ignoring the desired HFI. In case of incorrect routing the second target may be silently reached from a different network interface than expected.This needs properly parsed HFI indexes first, see linux-nvme/libnvme#766
The text was updated successfully, but these errors were encountered: