Skip to content

Commit ef161a7

Browse files
committed
Update c_vs_rust test results
1 parent 25baae2 commit ef161a7

8 files changed

Lines changed: 116 additions & 59 deletions

File tree

c_vs_rust/README.md

Lines changed: 94 additions & 46 deletions
Large diffs are not rendered by default.

c_vs_rust/charts/avg_latency.svg

Lines changed: 1 addition & 1 deletion
Loading

c_vs_rust/charts/jitter.svg

Lines changed: 1 addition & 1 deletion
Loading

c_vs_rust/charts/throughput_bps.svg

Lines changed: 1 addition & 1 deletion
Loading

c_vs_rust/charts/throughput_pps.svg

Lines changed: 1 addition & 1 deletion
Loading

c_vs_rust/charts/trex_rx_diff.svg

Lines changed: 1 addition & 0 deletions
Loading

c_vs_rust/l2fwd_trex_env.svg

Lines changed: 1 addition & 1 deletion
Loading

c_vs_rust/traffic_desc.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,33 @@ def create_stream(self, dir, port_id, flows, latency):
99
size = self.fsize - 4; # HW will add 4 bytes ethernet CRC
1010
# UDP packet
1111

12-
src_mac = "64:4c:36:11:05:a8"
13-
dst_mac = "64:4c:36:11:09:40"
14-
src_ip = "10.1.0.1"
15-
dst_ip = "10.2.0.1"
12+
dst_ip = "10.7.4.121"
13+
14+
dst_mac = "3c:fd:fe:eb:4a:c1"
15+
src_mac = "64:4c:36:11:04:e0"
16+
src_ip = "10.7.4.123"
1617

1718
base_pkt = Ether(src=src_mac, dst=dst_mac)/IP(src=src_ip, dst=dst_ip)/UDP()
1819
pad = max(0, size - len(base_pkt)) * 'x'
1920

2021
# vm
2122
vm = STLVM()
22-
vm.var(name="src_port", min_value=10000, max_value=11000, size=2, op="inc")
23-
vm.var(name="dst_port", min_value=10000, max_value=11000, size=2, op="inc")
23+
vm.var(name="src_port", min_value=10000, max_value=10000 + (flows - 1), size=2, op="inc")
24+
vm.var(name="dst_port", min_value=10000, max_value=10000 + (flows - 1), size=2, op="inc")
2425

2526
vm.write(fv_name="src_port", pkt_offset="UDP.sport")
2627
vm.write(fv_name="dst_port", pkt_offset="UDP.dport")
2728
vm.fix_chksum()
2829

29-
30+
vm.var(name='src', min_value=f"{'.'.join(src_ip.split('.')[:-1])}.1",
31+
max_value=f"{'.'.join(src_ip.split('.')[:-2])}.63.254", size=4,
32+
op='inc')
33+
vm.var(name='dst', min_value=f"{'.'.join(dst_ip.split('.')[:-1])}.1",
34+
max_value=f"{'.'.join(dst_ip.split('.')[:-2])}.63.254", size=4,
35+
op='inc')
36+
vm.write(fv_name='src', pkt_offset='IP.src')
37+
vm.write(fv_name='dst', pkt_offset='IP.dst')
38+
vm.fix_chksum()
3039

3140
pkt = STLPktBuilder(pkt=base_pkt/pad, vm=vm)
3241
if int(latency):
@@ -36,7 +45,6 @@ def create_stream(self, dir, port_id, flows, latency):
3645
else:
3746
return [STLStream(packet=pkt, mode=STLTXCont(pps=100), flow_stats=STLFlowStats(pg_id=self.pg_id + 10))]
3847

39-
4048
def get_streams(self, fsize=64, direction=0, pg_id=7, flows=1000, latency=0, **kwargs):
4149
self.fsize = fsize
4250
self.pg_id = pg_id + kwargs['port_id']

0 commit comments

Comments
 (0)