Skip to content

Commit

Permalink
Dpdk: fix device_id -> device_info
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgov committed Oct 30, 2024
1 parent cb68343 commit f798f14
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions microsoft/testsuites/dpdk/dpdkutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,15 +1139,14 @@ def get_node_nic_short_name(node: Node) -> str:
devices = node.tools[Lspci].get_devices_by_type(DEVICE_TYPE_SRIOV)
if node.nics.is_mana_device_present():
return NIC_SHORT_NAMES[NicType.MANA]
for nic_name in [NicType.CX3, NicType.CX4, NicType.CX5]:
if any([str(nic_name) in x.device_id for x in devices]):
short_names = map(lambda x: x.value, [NicType.CX3, NicType.CX4, NicType.CX5])
for nic_name in short_names:
if any([str(nic_name) in x.device_info for x in devices]):
return NIC_SHORT_NAMES[nic_name]
# We assert much earlier to enforce that SRIOV is enabled,
# so we should never hit this unless someone is testing a new platform.
# Instead of asserting, just log that the short name was not found.
known_nic_types = ",".join(
map(str, [NicType.CX3, NicType.CX4, NicType.CX5, NicType.MANA])
)
known_nic_types = ",".join(short_names)
found_nic_types = ",".join(map(str, [x.device_id for x in devices]))
node.log.debug(
"Unknown NIC hardware was detected during DPDK test case. "
Expand Down

0 comments on commit f798f14

Please sign in to comment.