Skip to content

Commit

Permalink
Updated EthtoolBSD get_device_enabled_features
Browse files Browse the repository at this point in the history
  • Loading branch information
r-dailey authored and LiliDeng committed Aug 17, 2024
1 parent 14bdcb8 commit 4c18740
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lisa/tools/ethtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ def feature_from_device_info(self, device_feature_raw: str) -> List[str]:
class EthtoolFreebsd(Ethtool):
# options=8051b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,LRO,LINKSTATE>
_interface_features_pattern = re.compile(
r"options=.+<(?P<features>.*)>(.|\n)*ether"
r"options=.+<(?P<features>.*)>(?:.|\n)*ether"
)

_get_bsd_to_linux_features_map = {
Expand Down Expand Up @@ -1106,7 +1106,6 @@ def get_device_enabled_features(
self, interface: str, force_run: bool = False
) -> DeviceFeatures:
interface_info = self.node.tools[Ip].run(interface).stdout

# Example output:
# options=8051b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,LRO,LINKSTATE>
# The features are separated by comma and enclosed by "<>"
Expand All @@ -1116,7 +1115,8 @@ def get_device_enabled_features(

features = []
for feature in features_pattern:
features.append(self._get_bsd_to_linux_features_map[feature])
if feature in self._get_bsd_to_linux_features_map:
features.append(self._get_bsd_to_linux_features_map[feature])
device_features = DeviceFeatures(interface, features)

return device_features

0 comments on commit 4c18740

Please sign in to comment.