summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYichen Wang <yicwang@cisco.com>2019-06-20 17:06:28 -0700
committerYichen Wang <yicwang@cisco.com>2019-06-20 17:08:15 -0700
commitabe283a31d38c2c44824d720bf18b47c5443b97a (patch)
treefc89dbc0ff051894a8c712c76af411959c80c681
parent14ef61de6946048e98ce74c911435faf25395b8c (diff)
[NFVBENCH-137] NFVbench generates wrong L4 checksums for VxLAN traffic3.4.1
Change-Id: Id0197f1f2ae0022a6e94755ab0b9fbfc434d5b8b Signed-off-by: Yichen Wang <yicwang@cisco.com>
-rw-r--r--nfvbench/traffic_gen/trex_gen.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/nfvbench/traffic_gen/trex_gen.py b/nfvbench/traffic_gen/trex_gen.py
index eb6066c..989940a 100644
--- a/nfvbench/traffic_gen/trex_gen.py
+++ b/nfvbench/traffic_gen/trex_gen.py
@@ -349,11 +349,14 @@ class TRex(AbstractTrafficGenerator):
src_fv,
STLVmWrFlowVar(fv_name="ip_src", pkt_offset="IP:{}.src".format(encap_level)),
dst_fv,
- STLVmWrFlowVar(fv_name="ip_dst", pkt_offset="IP:{}.dst".format(encap_level)),
- STLVmFixChecksumHw(l3_offset="IP:{}".format(encap_level),
- l4_offset="UDP:{}".format(encap_level),
- l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP)
+ STLVmWrFlowVar(fv_name="ip_dst", pkt_offset="IP:{}.dst".format(encap_level))
])
+
+ for encap in range(int(encap_level), -1, -1):
+ # Fixing the checksums for all encap levels
+ vm_param.append(STLVmFixChecksumHw(l3_offset="IP:{}".format(encap),
+ l4_offset="UDP:{}".format(encap),
+ l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP))
pad = max(0, frame_size - len(pkt_base)) * 'x'
return STLPktBuilder(pkt=pkt_base / pad, vm=STLScVmRaw(vm_param))