iperf: adds the option to define the packet length for udp.

Added the feature to configure the packet length in udp iperf. Added a modifier to select the length value.
The default value is configured to 1460.

Change-Id: Ic886faa82b7cb25f2bce685eb80910623e4ff686
This commit is contained in:
AlaiaL 2021-05-10 16:10:14 +02:00 committed by Alejandro Leal Conejos
parent 24a405f3e2
commit e9d7f5f9b6
2 changed files with 8 additions and 0 deletions

View File

@ -32,6 +32,7 @@ def on_register_schemas():
config_schema = {
'time': schema.DURATION,
'protocol': 'iperf3_protocol',
'packet_length' : schema.UINT,
}
schema.register_config_schema('iperf3cli', config_schema)
@ -271,6 +272,10 @@ class IPerf3Client(log.Origin):
popen_args += ('--bidir',)
if proto == IPerf3Client.PROTO_UDP:
popen_args += ('-u', '-b', str(bitrate))
# Add the buffer length.
if values.get('packet_length'):
packet_length = str(values.get('packet_length'))
popen_args += ('-l', packet_length)
if tos is not None:
popen_args += ('-S', str(tos))

View File

@ -0,0 +1,3 @@
config:
iperf3cli:
packet_length: ${param1}