Skip to content

Commit

Permalink
Expand support for backend ethernet
Browse files Browse the repository at this point in the history
IBManager will continue to be used for a new ethernet-backend offering from AzureHPC. While the key name remains the same (IPoIB_data), the interfaces will be of the format ethXX. Removing the check that skips anything that isn't ibXX. We are not at the risk of proceeding for any other nics since the IPoIB_data will only have the backend RDMA ones, and despite reading from the system for the loop, we match it against the array parsed from the IPoIB_data KVP. IB interfaces have padded virtual macs, non-IB interfaces won't. Adding if-else to only do the padded-octet check for IB. Everything else will use the standard 6-octet pattern.
  • Loading branch information
Anam9 authored Jun 19, 2024
1 parent bf45d50 commit 0e163ba
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions azurelinuxagent/pa/rdma/rdma.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,6 @@ def update_iboip_interfaces(self, mac_ip_array):
count = 0

for nic in nics:
# look for IBoIP interface of format ibXXX
if not re.match(r"ib\w+", nic):
continue

mac_addr = None
with open(os.path.join(net_dir, nic, "address")) as address_file:
mac_addr = address_file.read()
Expand All @@ -382,7 +378,11 @@ def update_iboip_interfaces(self, mac_ip_array):

mac_addr = mac_addr.upper()

match = re.match(r".+(\w\w):(\w\w):(\w\w):\w\w:\w\w:(\w\w):(\w\w):(\w\w)\n", mac_addr)
# if this is an IB interface, match IB-specific regex
if re.match(r"ib\w+", nic):
match = re.match(r".+(\w\w):(\w\w):(\w\w):\w\w:\w\w:(\w\w):(\w\w):(\w\w)\n", mac_addr)
else:
match = re.match(r"^(\w\w):(\w\w):(\w\w):(\w\w):(\w\w):(\w\w)$", mac_addr)
if not match:
logger.error("RDMA: failed to parse address for device {0} address {1}".format(nic, mac_addr))
continue
Expand Down

0 comments on commit 0e163ba

Please sign in to comment.