pkt_gen: MoonGen incorrectly inserting VLAN tag 55/17355/2
authorbmichalo <bmichalo@redhat.com>
Thu, 21 Jul 2016 15:33:02 +0000 (11:33 -0400)
committerbmichalo <bmichalo@redhat.com>
Wed, 27 Jul 2016 14:24:53 +0000 (10:24 -0400)
MoonGen needs to take into account the VLAN tag 'enable'
control knob defined within the VSPERF traffic profile
and therefore only insert the VLAN tag when its 'True'.

JIRA: VSPERF-329

Change-Id: Idbeed2f7e6411f0c28aa56a2d3e71bd7a79d975a
Signed-off-by: bmichalo <bmichalo@redhat.com>
tools/pkt_gen/moongen/moongen.py

index 7af83f2..21dec9c 100644 (file)
@@ -138,8 +138,9 @@ class Moongen(ITrafficGenerator):
         out_file.write("dstIp = \"" + \
             str(traffic['l3']['dstip']) + "\",\n")
 
-        out_file.write("vlanId = " + \
-            str(traffic['vlan']['id']) + ",\n")
+        if traffic['vlan']['enabled']:
+            out_file.write("vlanId = " + \
+                str(traffic['vlan']['id']) + ",\n")
 
         out_file.write("searchRunTime = " + \
             str(duration) + ",\n")