aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pkt_gen
diff options
context:
space:
mode:
authorChristian Trautman <ctrautma@redhat.com>2017-09-25 17:22:38 -0400
committerChristian Trautman <ctrautma@redhat.com>2017-09-25 17:22:38 -0400
commit5d08ffdf317d31361a528bf1b6d33cd4d0007600 (patch)
tree49bb5ca1e3de78dc198d5192107f32649eacbd8a /tools/pkt_gen
parent0549aa1f1a694899fec3b16b44230b5c60d2fa29 (diff)
trex_prom: Add promiscuous option for trex for SRIOV tests
Adds option to enable promiscuous mode for Trex traffic generator to allow for SR-IOV tests to work correctly. Trex by default only accepts packets based on destination MAC address matching what is configured on server in /etc/trex-cfg.yaml. This removes that limitation since SR-IOV tests require mac addresses to be modified in the generated packets to correctly route packets to the relevant VFs. JIRA: VSPERF-531 Change-Id: I19b64f364c8a1b656994c82c96f47a68b92486d8 Signed-off-by: Christian Trautman <ctrautma@redhat.com>
Diffstat (limited to 'tools/pkt_gen')
-rw-r--r--tools/pkt_gen/trex/trex.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/pkt_gen/trex/trex.py b/tools/pkt_gen/trex/trex.py
index 7cdeec9c..7b554ecb 100644
--- a/tools/pkt_gen/trex/trex.py
+++ b/tools/pkt_gen/trex/trex.py
@@ -201,6 +201,10 @@ class Trex(ITrafficGenerator):
my_ports = [0, 1]
self._stlclient.reset(my_ports)
ports_info = self._stlclient.get_port_info(my_ports)
+ # for SR-IOV
+ if settings.getValue('TRAFFICGEN_TREX_PROMISCUOUS'):
+ self._stlclient.set_port_attr(my_ports, promiscuous=True)
+
packet_1, packet_2 = Trex.create_packets(traffic, ports_info)
stream_1, stream_2, stream_1_lat, stream_2_lat = Trex.create_streams(packet_1, packet_2, traffic)
self._stlclient.add_streams(stream_1, ports=[0])