Skip to content

Commit

Permalink
ntttcp: Add BSD support for sysctl settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sharsonia committed May 24, 2023
1 parent 4f5b62c commit 94076eb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lisa/tools/ntttcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
TransportProtocol,
create_perf_message,
)
from lisa.operating_system import CBLMariner
from lisa.operating_system import BSD, CBLMariner
from lisa.tools import Firewall, Gcc, Git, Make, Sed
from lisa.util import constants
from lisa.util.process import ExecutableResult, Process
Expand Down Expand Up @@ -119,6 +119,12 @@ class Ntttcp(Tool):
{"vm.max_map_count": "655300"},
{"net.ipv4.ip_local_port_range": "1024 65535"},
]
freebsd_sys_list_tcp = [
{"kern.pid_max": "99999"},
{"vm.kmem_size_max": "335544320"},
{"net.inet.ip.portrange.first": "10000"},
{"net.inet.ip.portrange.last": "65535"},
]
sys_list_udp = [
{"net.core.rmem_max": "67108864"},
{"net.core.rmem_default": "67108864"},
Expand All @@ -140,7 +146,10 @@ def can_install(self) -> bool:

def setup_system(self, udp_mode: bool = False, set_task_max: bool = True) -> None:
sysctl = self.node.tools[Sysctl]
sys_list = self.sys_list_tcp
if isinstance(self.node.os, BSD):
sys_list = self.freebsd_sys_list_tcp
else:
sys_list = self.sys_list_tcp
if udp_mode:
sys_list = self.sys_list_udp
for sys in sys_list:
Expand Down

0 comments on commit 94076eb

Please sign in to comment.