Skip to content

Commit 4c18740

Browse files
r-daileyLiliDeng
authored andcommitted
Updated EthtoolBSD get_device_enabled_features
1 parent 14bdcb8 commit 4c18740

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lisa/tools/ethtool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ def feature_from_device_info(self, device_feature_raw: str) -> List[str]:
10701070
class EthtoolFreebsd(Ethtool):
10711071
# options=8051b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,LRO,LINKSTATE>
10721072
_interface_features_pattern = re.compile(
1073-
r"options=.+<(?P<features>.*)>(.|\n)*ether"
1073+
r"options=.+<(?P<features>.*)>(?:.|\n)*ether"
10741074
)
10751075

10761076
_get_bsd_to_linux_features_map = {
@@ -1106,7 +1106,6 @@ def get_device_enabled_features(
11061106
self, interface: str, force_run: bool = False
11071107
) -> DeviceFeatures:
11081108
interface_info = self.node.tools[Ip].run(interface).stdout
1109-
11101109
# Example output:
11111110
# options=8051b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,LRO,LINKSTATE>
11121111
# The features are separated by comma and enclosed by "<>"
@@ -1116,7 +1115,8 @@ def get_device_enabled_features(
11161115

11171116
features = []
11181117
for feature in features_pattern:
1119-
features.append(self._get_bsd_to_linux_features_map[feature])
1118+
if feature in self._get_bsd_to_linux_features_map:
1119+
features.append(self._get_bsd_to_linux_features_map[feature])
11201120
device_features = DeviceFeatures(interface, features)
11211121

11221122
return device_features

0 commit comments

Comments
 (0)