trex_prom: Add promiscuous option for trex for SRIOV tests 61/43061/1
authorChristian Trautman <ctrautma@redhat.com>
Mon, 25 Sep 2017 21:22:38 +0000 (17:22 -0400)
committerChristian Trautman <ctrautma@redhat.com>
Mon, 25 Sep 2017 21:22:38 +0000 (17:22 -0400)
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>
conf/03_traffic.conf
conf/10_custom.conf
docs/testing/user/configguide/trafficgen.rst
tools/pkt_gen/trex/trex.py

index 5f6d791..419ca70 100644 (file)
@@ -441,6 +441,8 @@ TRAFFICGEN_TREX_LATENCY_PPS = 1000
 # Example 10 Gbps: TRAFFICGEN_TREXINE_SPEED_GBPS = '10'
 # Today only 10 Gbps is supported
 TRAFFICGEN_TREX_LINE_SPEED_GBPS = '10'
+# FOR SR-IOV tests to work with T-Rex enable Promiscuous mode
+TRAFFICGEN_TREX_PROMISCUOUS=False
 PATHS['trafficgen'] = {
     'trex': {
         'type' : 'src',
index 6011e6a..9dc605e 100644 (file)
@@ -136,6 +136,8 @@ TRAFFICGEN_TREX_LATENCY_PPS = 1000
 # Example 10 Gbps: TRAFFICGEN_TREXINE_SPEED_GBPS = '10'
 # Today only 10 Gbps is supported
 TRAFFICGEN_TREX_LINE_SPEED_GBPS = '10'
+# FOR SR-IOV tests to work with T-Rex enable Promiscuous mode
+TRAFFICGEN_TREX_PROMISCUOUS=False
 
 # TREX Configuration and Connection Info-- END
 ####################################################
index 7c14c55..2d2b9a9 100644 (file)
@@ -821,3 +821,15 @@ Default value of this parameter is defined in conf/03_traffic.conf as follows:
 .. code-block:: console
 
     TRAFFICGEN_TREX_RFC2544_TPUT_THRESHOLD = ''
+
+SR-IOV
+~~~~~~
+T-Rex by default only accepts packets on the receive side if the destination mac matches the
+MAC address specificed in the /etc/trex-cfg.yaml on the server side. For SR-IOV this creates
+challenges with modifying the MAC address in the traffic profile to correctly flow packets
+through specified VFs. To remove this limitation enable promiscuous mode on T-Rex to allow
+all packets regardless of the destination mac to be accepted.
+
+.. code-block:: console
+
+    TRAFFICGEN_TREX_PROMISCUOUS=True
index 7cdeec9..7b554ec 100644 (file)
@@ -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])