-*** Keywords ***
-| Get Max Rate And Jumbo
-| | [Documentation]
-| | ... | Argument framesize can be either integer in case of a single packet
-| | ... | in stream, or IMIX string defining mix of packets.
-| | ... | For jumbo frames detection, the maximal packet size is relevant.
-| | ... | For maximal transmit rate, the average packet size is relevant.
-| | ... | In both cases, encapsulation overhead (if any) has effect.
-| | ... | The maximal rate is computed from line limit bandwidth,
-| | ... | but NICs also have an independent limit in packet rate.
-| | ... | For some NICs, the limit is not reachable (bps limit is stricter),
-| | ... | in those cases None is used (meaning no limiting).
-| | ...
-| | ... | This keyword returns computed maximal unidirectional transmit rate
-| | ... | and jumbo boolean (some suites need that).
-| | ...
-| | ... | *Arguments:*
-| | ... | - bps_limit - Line rate limit in bps. Type: integer
-| | ... | - framesize - Framesize in bytes or IMIX. Type: integer or string
-| | ... | - overhead - Overhead in bytes. Default: 0. Type: integer
-| | ... | - pps_limit - NIC limit rate value in pps. Type: integer or None
-| | ...
-| | ... | *Returns:*
-| | ... | - 2-tuple, consisting of:
-| | ... | - Calculated unidirectional maximal transmit rate.
-| | ... | Type: integer or float
-| | ... | - Jumbo boolean, true if jumbo packet support has to be enabled.
-| | ... | Type: boolean
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Get Max Rate And Jumbo | \${10000000} \| IMIX_v4_1 \
-| | ... | \| overhead=\${40} \| pps_limit=\${18750000} \|
-| | ...
-| | [Arguments] | ${bps_limit} | ${framesize}
-| | ... | ${overhead}=${0} | ${pps_limit}=${None}
-| | ...
-| | ${avg_size} = | Set Variable If | '${framesize}' == 'IMIX_v4_1'
-| | ... | ${353.83333} | ${framesize}
-| | ${max_size} = | Set Variable If | '${framesize}' == 'IMIX_v4_1'
-| | ... | ${1518} | ${framesize}
-| | # swo := size_with_overhead
-| | ${avg_swo} = | Evaluate | ${avg_size} + ${overhead}
-| | ${max_swo} = | Evaluate | ${max_size} + ${overhead}
-| | ${jumbo} = | Set Variable If | ${max_swo} < 1522
-| | ... | ${False} | ${True}
-| | # For testing None see: https://groups.google.com/\
-| | # forum/#!topic/robotframework-users/XntFz0ocD9E
-| | ${limit_set} = | Set Variable | ${pps_limit != None}
-| | ${rate} = | Evaluate | (${bps_limit}/((${avg_swo}+20)*8)).__trunc__()
-| | ${max_rate} = | Set Variable If | ${limit_set} and ${rate} > ${pps_limit}
-| | ... | ${pps_limit} | ${rate}
-| | Return From Keyword | ${max_rate} | ${jumbo}
-
-| Get Max Rate And Jumbo And Handle Multi Seg
-| | [Documentation]
-| | ... | This keyword adds correct multi seg configuration,
-| | ... | then returns the result of Get Max Rate And Jumbo keyword.
-| | ...
-| | ... | See Documentation of Get Max Rate And Jumbo for more details.
-| | ...
-| | ... | *Arguments:*
-| | ... | - bps_limit - Line rate limit in bps. Type: integer
-| | ... | - framesize - Framesize in bytes. Type: integer or string
-| | ... | - overhead - Overhead in bytes. Default: 0. Type: integer
-| | ... | - pps_limit - NIC limit rate value in pps. Type: integer or None
-| | ...
-| | ... | *Returns:*
-| | ... | - 2-tuple, consisting of:
-| | ... | - Calculated unidirectional maximal transmit rate.
-| | ... | Type: integer or float
-| | ... | - Jumbo boolean, true if jumbo packet support has to be enabled.
-| | ... | Type: boolean
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Get Max Rate And Jumbo And Handle Multi Seg | \${10000000} \
-| | ... | \| IMIX_v4_1 \| overhead=\${40} \| pps_limit=\${18750000} \|
-| | ...
-| | [Arguments] | ${bps_limit} | ${framesize}
-| | ... | ${overhead}=${0} | ${pps_limit}=${None}
-| | ...
-| | ${max_rate} | ${jumbo} = | Get Max Rate And Jumbo
-| | ... | ${bps_limit} | ${framesize} | ${overhead} | ${pps_limit}
-| | Run Keyword If | not ${jumbo} | Add no multi seg to all DUTs
-| | Return From Keyword | ${max_rate} | ${jumbo}
-
-| Calculate pps
-| | [Documentation]
-| | ... | Calculate pps for given rate and L2 frame size,
-| | ... | additional 20B are added to L2 frame size as padding.
-| | ...
-| | ... | FIXME: Migrate callers to Get Max Rate And Jumbo
-| | ...
-| | ... | *Arguments*
-| | ... | - bps - Rate in bps. Type: integer
-| | ... | - framesize - L2 frame size in Bytes. Type: integer
-| | ...
-| | ... | *Return*
-| | ... | - Calculated pps. Type: integer
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Calculate pps \| 10000000000 \| 64 \|
-| | ...
-| | [Arguments] | ${bps} | ${framesize}
-| | ...
-| | ${framesize}= | Get Frame Size | ${framesize}
-| | ${ret}= | Evaluate | (${bps}/((${framesize}+20)*8)).__trunc__()
-| | Return From Keyword | ${ret}
-
-| Get Frame Size
-| | [Documentation]
-| | ... | Framesize can be either integer in case of a single packet
-| | ... | in stream, or set of packets in case of IMIX type or simmilar.
-| | ... | This keyword returns average framesize.
-| | ...
-| | ... | FIXME: Migrate callers to Get Max Rate And Jumbo
-| | ...
-| | ... | *Arguments:*
-| | ... | - framesize - Framesize. Type: integer or string
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Get Frame Size \| IMIX_v4_1 \|
-| | ...
-| | [Arguments] | ${framesize}
-| | ...
-| | Return From Keyword If | '${framesize}' == 'IMIX_v4_1' | ${353.83333}
-| | Return From Keyword | ${framesize}
-
-| Find NDR using linear search and pps
-| | [Documentation]
-| | ... | Find throughput by using RFC2544 linear search with non drop rate.
-| | ...
-| | ... | *Arguments:*
-| | ... | - framesize - L2 Frame Size [B]. Type: integer
-| | ... | - start_rate - Initial start rate [pps]. Type: float
-| | ... | - step_rate - Step of linear search [pps]. Type: float
-| | ... | - topology_type - Topology type. Type: string
-| | ... | - min_rate - Lower limit of search [pps]. Type: float
-| | ... | - max_rate - Upper limit of search [pps]. Type: float
-| | ...
-| | ... | *Return:*
-| | ... | - No value returned
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Find NDR using linear search and pps \| 64 \| 5000000 \
-| | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \|
-| | ...
-| | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
-| | ... | ${topology_type} | ${min_rate} | ${max_rate}
-| | ...
-| | ${duration}= | Set Variable | ${perf_trial_duration}
-| | Set Duration | ${duration}
-| | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
-| | Set Search Linear Step | ${step_rate}
-| | Set Search Frame Size | ${framesize}
-| | Set Search Rate Type pps
-| | Linear Search | ${start_rate} | ${topology_type}
-| | ${rate_per_stream} | ${lat}= | Verify Search Result
-| | ${tmp}= | Create List | 100%NDR | ${lat}
-| | ${latency}= | Create List | ${tmp}
-| | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
-| | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
-| | ... | ${framesize} | ${topology_type}
-| | ${tmp}= | Create List | 50%NDR | ${lat_50p}
-| | Append To List | ${latency} | ${tmp}
-| | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
-| | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
-| | ... | ${framesize} | ${topology_type}
-| | ${tmp}= | Create List | 10%NDR | ${lat_10p}
-| | Append To List | ${latency} | ${tmp}
-| | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
-| | ... | ${latency}
-| | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
-| | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
-
-| Find PDR using linear search and pps
-| | [Documentation]
-| | ... | Find throughput by using RFC2544 linear search with partial drop rate
-| | ... | with PDR threshold and type specified by parameter.
-| | ...
-| | ... | *Arguments:*
-| | ... | - framesize - L2 Frame Size [B]. Type: integer
-| | ... | - start_rate - Initial start rate [pps]. Type: float
-| | ... | - step_rate - Step of linear search [pps]. Type: float
-| | ... | - topology_type - Topology type. Type: string
-| | ... | - min_rate - Lower limit of search [pps]. Type: float
-| | ... | - max_rate - Upper limit of search [pps]. Type: float
-| | ... | - loss_acceptance - Accepted loss during search. Type: float
-| | ... | - loss_acceptance_type - Percentage or frames. Type: string
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Find PDR using linear search and pps \| 64 \| 5000000 \
-| | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 0.5 \| percentage \|
-| | ...
-| | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
-| | ... | ${topology_type} | ${min_rate} | ${max_rate}
-| | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
-| | ...
-| | ${duration}= | Set Variable | ${perf_trial_duration}
-| | Set Duration | ${duration}
-| | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
-| | Set Search Linear Step | ${step_rate}
-| | Set Search Frame Size | ${framesize}
-| | Set Search Rate Type pps
-| | Set Loss Acceptance | ${loss_acceptance}
-| | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
-| | ... | Set Loss Acceptance Type Percentage
-| | Linear Search | ${start_rate} | ${topology_type}
-| | ${rate_per_stream} | ${lat}= | Verify Search Result
-| | ${tmp}= | Create List | 100%PDR | ${lat}
-| | ${latency}= | Create List | ${tmp}
-| | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
-| | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
-| | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
-| | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
-| | ... | ${loss_acceptance_type} | fail_on_loss=${False}
-
-| Find NDR using binary search and pps
-| | [Documentation]
-| | ... | Find throughput by using RFC2544 binary search with non drop rate.
-| | ...
-| | ... | *Arguments:*
-| | ... | - framesize - L2 Frame Size [B]. Type: integer
-| | ... | - binary_min - Lower boundary of search [pps]. Type: float
-| | ... | - binary_max - Upper boundary of search [pps]. Type: float
-| | ... | - topology_type - Topology type. Type: string
-| | ... | - min_rate - Lower limit of search [pps]. Type: float
-| | ... | - max_rate - Upper limit of search [pps]. Type: float
-| | ... | - threshold - Threshold to stop search [pps]. Type: integer
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Find NDR using binary search and pps \| 64 \| 6000000 \
-| | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \|
-| | ...
-| | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
-| | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
-| | ...
-| | ${duration}= | Set Variable | ${perf_trial_duration}
-| | Set Duration | ${duration}
-| | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
-| | Set Search Frame Size | ${framesize}
-| | Set Search Rate Type pps
-| | Set Binary Convergence Threshold | ${threshold}
-| | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
-| | ${rate_per_stream} | ${lat}= | Verify Search Result
-| | ${tmp}= | Create List | 100%NDR | ${lat}
-| | ${latency}= | Create List | ${tmp}
-| | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
-| | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
-| | ... | ${framesize} | ${topology_type}
-| | ${tmp}= | Create List | 50%NDR | ${lat_50p}
-| | Append To List | ${latency} | ${tmp}
-| | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
-| | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
-| | ... | ${framesize} | ${topology_type}
-| | ${tmp}= | Create List | 10%NDR | ${lat_10p}
-| | Append To List | ${latency} | ${tmp}
-| | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
-| | ... | ${latency}
-| | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
-| | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
-
-| Find PDR using binary search and pps
-| | [Documentation]
-| | ... | Find throughput by using RFC2544 binary search with partial drop rate
-| | ... | with PDR threshold and type specified by parameter.
-| | ...
-| | ... | *Arguments:*
-| | ... | - framesize - L2 Frame Size [B]. Type: integer
-| | ... | - binary_min - Lower boundary of search [pps]. Type: float
-| | ... | - binary_max - Upper boundary of search [pps]. Type: float
-| | ... | - topology_type - Topology type. Type: string
-| | ... | - min_rate - Lower limit of search [pps]. Type: float
-| | ... | - max_rate - Upper limit of search [pps]. Type: float
-| | ... | - threshold - Threshold to stop search [pps]. Type: integer
-| | ... | - loss_acceptance - Accepted loss during search. Type: float
-| | ... | - loss_acceptance_type - Percentage or frames. Type: string
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Find PDR using binary search and pps \| 64 \| 6000000 \
-| | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \| 0.5 \
-| | ... | \| percentage \|
-| | ...
-| | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
-| | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
-| | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
-| | ...
-| | ${duration}= | Set Variable | ${perf_trial_duration}
-| | Set Duration | ${duration}
-| | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
-| | Set Search Frame Size | ${framesize}
-| | Set Search Rate Type pps
-| | Set Loss Acceptance | ${loss_acceptance}
-| | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
-| | ... | Set Loss Acceptance Type Percentage
-| | Set Binary Convergence Threshold | ${threshold}
-| | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
-| | ${rate_per_stream} | ${lat}= | Verify Search Result
-| | ${tmp}= | Create List | 100%PDR | ${lat}
-| | ${latency}= | Create List | ${tmp}
-| | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
-| | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
-| | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
-| | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
-| | ... | ${loss_acceptance_type} | fail_on_loss=${False}
-
-| Find NDR using combined search and pps
-| | [Documentation]
-| | ... | Find throughput by using RFC2544 combined search (linear+binary) with
-| | ... | non drop rate.
-| | ...
-| | ... | *Arguments:*
-| | ... | - framesize - L2 Frame Size [B]. Type: integer
-| | ... | - start_rate - Initial start rate [pps]. Type: float
-| | ... | - step_rate - Step of linear search [pps]. Type: float
-| | ... | - topology_type - Topology type. Type: string
-| | ... | - min_rate - Lower limit of search [pps]. Type: float
-| | ... | - max_rate - Upper limit of search [pps]. Type: float
-| | ... | - threshold - Threshold to stop search [pps]. Type: integer
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Find NDR using combined search and pps \| 64 \| 5000000 \
-| | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \|
-| | ...
-| | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
-| | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
-| | ...
-| | ${duration}= | Set Variable | ${perf_trial_duration}
-| | Set Duration | ${duration}
-| | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
-| | Set Search Linear Step | ${step_rate}
-| | Set Search Frame Size | ${framesize}
-| | Set Search Rate Type pps
-| | Set Binary Convergence Threshold | ${threshold}
-| | Combined Search | ${start_rate} | ${topology_type}
-| | ${rate_per_stream} | ${lat}= | Verify Search Result
-| | ${tmp}= | Create List | 100%NDR | ${lat}
-| | ${latency}= | Create List | ${tmp}
-| | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
-| | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
-| | ... | ${framesize} | ${topology_type}
-| | ${tmp}= | Create List | 50%NDR | ${lat_50p}
-| | Append To List | ${latency} | ${tmp}
-| | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
-| | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
-| | ... | ${framesize} | ${topology_type}
-| | ${tmp}= | Create List | 10%NDR | ${lat_10p}
-| | Append To List | ${latency} | ${tmp}
-| | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
-| | ... | ${latency}
-| | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
-| | ... | ${framesize} | ${topology_type}
-| | ... | fail_on_loss=${False}
-
-| Find PDR using combined search and pps
-| | [Documentation]
-| | ... | Find throughput by using RFC2544 combined search (linear+binary) with
-| | ... | partial drop rate with PDR threshold and type specified by parameter.
-| | ...
-| | ... | *Arguments:*
-| | ... | - framesize - L2 Frame Size [B]. Type: integer
-| | ... | - start_rate - Initial start rate [pps]. Type: float
-| | ... | - step_rate - Step of linear search [pps]. Type: float
-| | ... | - topology_type - Topology type. Type: string
-| | ... | - min_rate - Lower limit of search [pps]. Type: float
-| | ... | - max_rate - Upper limit of search [pps]. Type: float
-| | ... | - threshold - Threshold to stop search [pps]. Type: integer
-| | ... | - loss_acceptance - Accepted loss during search. Type: float
-| | ... | - loss_acceptance_type - Percentage or frames. Type: string
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Find PDR using combined search and pps \| 64 \| 5000000 \
-| | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \| 0.5 \
-| | ... | \| percentage \|
-| | ...
-| | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
-| | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
-| | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
-| | ...
-| | ${duration}= | Set Variable | ${perf_trial_duration}
-| | Set Duration | ${duration}
-| | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
-| | Set Search Linear Step | ${step_rate}
-| | Set Search Frame Size | ${framesize}
-| | Set Search Rate Type pps
-| | Set Loss Acceptance | ${loss_acceptance}
-| | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
-| | ... | Set Loss Acceptance Type Percentage
-| | Set Binary Convergence Threshold | ${threshold}
-| | Combined Search | ${start_rate} | ${topology_type}
-| | ${rate_per_stream} | ${lat}= | Verify Search Result
-| | ${tmp}= | Create List | 100%PDR | ${lat}
-| | ${latency}= | Create List | ${tmp}
-| | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
-| | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
-| | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
-| | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
-| | ... | ${loss_acceptance_type} | fail_on_loss=${False}