Fix address detection for NVMeoF RDMA when NICs are bridged #17482
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.
Problem
When RDMA NICs (e.g.,
enp8s14,enp8s20) are bridge members,rdma -j linkreturns the physical interface names, but IP addresses are configured on the bridge interface (e.g.,br0). The current code only queries the physical interface names, resulting in no available addresses in the dropdown.Note: RDMA functionality works correctly when NICs are bridged - the RDMA stack operates below the bridge layer.

About the
relationships=FalsechangeI noticed the original code (line 366) accesses
i['alias_interface'].get('int_interface')when querying network aliases:This relies on the default
relationships=Truebehavior to automatically join the relatednetwork_interfacestable. While this probably works fine in most cases, I encountered aKeyError: 'int_interface'when testing in my environment (specifically when enabling RDMA or configuring ports).I'm not entirely familiar with how the datastore relationship joins are structured throughout the codebase, but it seems the joined data structure might not always include the expected fields, or there could be edge cases where the join doesn't behave as expected.
My approach was to:
alias_interface_id(which is always present as it's the actual foreign key column)This way we're working with explicit fields that are guaranteed to exist in the database schema rather than depending on how the ORM constructs the joined result.
However, I'm open to suggestions if there's a better or more idiomatic way to handle this in the middlewared codebase. If the original approach should work and I'm hitting an edge case, I'm happy to investigate further or adjust the implementation.
Testing
Tested with Mellanox ConnectX NICs as bridge members: