This repository has been archived by the owner on Jun 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iperf_veth_udp.py
73 lines (60 loc) · 2.28 KB
/
iperf_veth_udp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import lib.collection as collection
from collections import OrderedDict
class iperf_veth_udp(collection.Collection):
constants = {
'protocol': 'udp',
'topology': 'direct_veth',
'zerocopy': False,
}
variables = OrderedDict([
('parallelism', (1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 16)),
('iperf_name', ('iperf2', 'iperf3', 'iperf3m')),
('disable_offloading', (False, True)),
('packet_size', (65507, 32739, 1458, 36)),
('affinity', (False, True)),
])
def generation_skip_fn(self, settings):
if settings['iperf_name'] == 'iperf2' and (settings['zerocopy'] or settings['affinity']):
return True
if settings['iperf_name'] != 'iperf3m' and settings['packet_size'] == 32739:
return True
return False
x_axis = 'parallelism'
y_axes = ['throughput', 'packetput', 'cpu']
x_title = '# of parallel flows'
filters = {
'iperf3m': lambda r: r['iperf_name'] != 'iperf3m',
'smallpackets': lambda r: r['packet_size'] > 36,
'rightsize': lambda r: r['packet_size'] != 32739,
}
def analysis_row_label_fn(self, r):
zcpyaff_label_list = []
for name in ('zerocopy', 'affinity'):
if r[name]:
zcpyaff_label_list.append(name)
return "{iperf_name} {}offloading, pkt: {packet_size} {}".format('no ' if r['disable_offloading'] else '', ', '.join(zcpyaff_label_list), **r)
def analysis_grouping_fn(self, r):
iperf_names = list(self.variables['iperf_name'])
return (iperf_names.index(r['iperf_name']),)
def plot_style_fn(self, r, group_id):
color = 'black'
if r['affinity']:
color = 'red'
if r['zerocopy']:
color = 'blue'
if r['affinity'] and r['zerocopy']:
color = 'green'
marker = 's' # if r['packet_size'] == 65507
if r['packet_size'] == 32739:
marker = '^'
elif r['packet_size'] == 1458:
marker = 'o'
elif r['packet_size'] == 36:
marker = 'v'
return {
'linestyle': '--' if r['disable_offloading'] else '-',
'color': color,
'marker': marker,
}
if __name__ == '__main__':
iperf_veth_udp().parse_shell_arguments()