NFVBENCH-105 ARP not working with NFVbench 2.0 93/64393/1 2.0.2
authorahothan <ahothan@cisco.com>
Thu, 1 Nov 2018 15:17:49 +0000 (08:17 -0700)
committerahothan <ahothan@cisco.com>
Thu, 1 Nov 2018 15:17:49 +0000 (08:17 -0700)
Fix type in arp record field.
Remove unneeded code.

Change-Id: I7a77f66c5e1c357907f4fd113f864708a351f152
Signed-off-by: ahothan <ahothan@cisco.com>
docs/development/design/ndrpdr.rst
docs/development/design/versioning.rst
docs/testing/developer/devguide/index.rst
docs/testing/user/configguide/configguide.rst
nfvbench/traffic_client.py
nfvbench/traffic_gen/trex.py

index e34e8ba..dd769c0 100644 (file)
@@ -79,5 +79,5 @@ consideration:
 - actual Tx rate is always <= requested Tx rate
 - the measured drop rate should always be relative to the actual Tx rate
 - if the actual Tx rate is < requested Tx rate and the measured drop rate is already within threshold
 - actual Tx rate is always <= requested Tx rate
 - the measured drop rate should always be relative to the actual Tx rate
 - if the actual Tx rate is < requested Tx rate and the measured drop rate is already within threshold
- (<NDR/PDR threshold) then the binary search must stop with proper warning because the actual NDR/PDR
- might probably be higher than the reported values
 (<NDR/PDR threshold) then the binary search must stop with proper warning because the actual NDR/PDR
 might probably be higher than the reported values
index 870ed86..8103534 100644 (file)
@@ -8,15 +8,9 @@ Versioning
 ==========
 
 NFVbench uses semver compatible git tags such as "1.0.0". These tags are also called project tags and applied at important commits on the master branch exclusively.
 ==========
 
 NFVbench uses semver compatible git tags such as "1.0.0". These tags are also called project tags and applied at important commits on the master branch exclusively.
-Rules for the version numbers follow the semver 2.0 specification (http://semver.org).
+Rules for the version numbers follow the semver 2.0 specification (https://semver.org).
 These git tags are applied indepently of the OPNFV release tags which are applied only on the stable release branches (e.g. "opnfv-5.0.0").
 
 In general it is recommeneded to always have a project git version tag associated to any OPNFV release tag content obtained from a sync from master.
 
 NFVbench Docker containers will be versioned based on the OPNF release tags or based on NFVbench project tags.
 These git tags are applied indepently of the OPNFV release tags which are applied only on the stable release branches (e.g. "opnfv-5.0.0").
 
 In general it is recommeneded to always have a project git version tag associated to any OPNFV release tag content obtained from a sync from master.
 
 NFVbench Docker containers will be versioned based on the OPNF release tags or based on NFVbench project tags.
-
-
-
-
-
-
index e69de29..e219889 100644 (file)
@@ -0,0 +1,8 @@
+.. _nfvbench-releasenotes:
+
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+
+***************
+Developer Guide
+***************
index e69de29..f790d21 100644 (file)
@@ -0,0 +1,8 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International
+.. License.
+.. http://creativecommons.org/licenses/by/4.0
+.. (c) Cisco Systems, Inc
+
+*******************
+Configuration Guide
+*******************
index 810f7dd..34d93cf 100755 (executable)
@@ -463,7 +463,6 @@ class TrafficClient(object):
 
     def setup(self):
         """Set up the traffic client."""
 
     def setup(self):
         """Set up the traffic client."""
-        self.gen.set_mode()
         self.gen.clear_stats()
 
     def get_version(self):
         self.gen.clear_stats()
 
     def get_version(self):
index 2f271aa..5701297 100644 (file)
@@ -11,6 +11,7 @@
 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 #    License for the specific language governing permissions and limitations
 #    under the License.
 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 #    License for the specific language governing permissions and limitations
 #    under the License.
+"""Driver module for TRex traffic generator."""
 
 import os
 import random
 
 import os
 import random
@@ -19,7 +20,6 @@ import traceback
 
 from itertools import count
 from nfvbench.log import LOG
 
 from itertools import count
 from nfvbench.log import LOG
-from nfvbench.specs import ChainType
 from nfvbench.traffic_server import TRexTrafficServer
 from nfvbench.utils import cast_integer
 from nfvbench.utils import timeout
 from nfvbench.traffic_server import TRexTrafficServer
 from nfvbench.utils import cast_integer
 from nfvbench.utils import timeout
@@ -61,6 +61,7 @@ class TRex(AbstractTrafficGenerator):
     LATENCY_PG_ID_MASK = 0x0100
 
     def __init__(self, traffic_client):
     LATENCY_PG_ID_MASK = 0x0100
 
     def __init__(self, traffic_client):
+        """Trex driver."""
         AbstractTrafficGenerator.__init__(self, traffic_client)
         self.client = None
         self.id = count()
         AbstractTrafficGenerator.__init__(self, traffic_client)
         self.client = None
         self.id = count()
@@ -417,32 +418,6 @@ class TRex(AbstractTrafficGenerator):
                                             (self.port_info[0]['speed'],
                                              self.port_info[1]['speed']))
 
                                             (self.port_info[0]['speed'],
                                              self.port_info[1]['speed']))
 
-    def set_mode(self):
-        if self.config.service_chain == ChainType.EXT and not self.config.no_arp:
-            self.__set_l3_mode()
-        else:
-            self.__set_l2_mode()
-
-    def __set_l3_mode(self):
-        self.client.set_service_mode(ports=self.port_handle, enabled=True)
-        for port, device in zip(self.port_handle, self.generator_config.devices):
-            try:
-                self.client.set_l3_mode(port=port,
-                                        src_ipv4=device.tg_gateway_ip,
-                                        dst_ipv4=device.dst.gateway_ip,
-                                        vlan=device.vlan_tag if device.vlan_tagging else None)
-            except STLError:
-                # TRex tries to resolve ARP already, doesn't have to be successful yet
-                continue
-        self.client.set_service_mode(ports=self.port_handle, enabled=False)
-
-    def __set_l2_mode(self):
-        self.client.set_service_mode(ports=self.port_handle, enabled=True)
-        for port, device in zip(self.port_handle, self.generator_config.devices):
-            for cfg in device.get_stream_configs():
-                self.client.set_l2_mode(port=port, dst_mac=cfg['mac_dst'])
-        self.client.set_service_mode(ports=self.port_handle, enabled=False)
-
     def __start_server(self):
         server = TRexTrafficServer()
         server.run_server(self.generator_config)
     def __start_server(self):
         server = TRexTrafficServer()
         server.run_server(self.generator_config)
@@ -470,8 +445,9 @@ class TRex(AbstractTrafficGenerator):
                 STLServiceARP(ctx,
                               src_ip=cfg['ip_src_tg_gw'],
                               dst_ip=cfg['mac_discovery_gw'],
                 STLServiceARP(ctx,
                               src_ip=cfg['ip_src_tg_gw'],
                               dst_ip=cfg['mac_discovery_gw'],
-                              vlan=device.vlan_tag if device.vlan_tagging else None)
-                for cfg in stream_configs()
+                              # will be None if no vlan tagging
+                              vlan=cfg['vlan_tag'])
+                for cfg in stream_configs
             ]
 
             for attempt in range(self.config.generic_retry_count):
             ]
 
             for attempt in range(self.config.generic_retry_count):
@@ -485,11 +461,12 @@ class TRex(AbstractTrafficGenerator):
                 for chain_id, mac in enumerate(dst_macs):
                     if not mac:
                         arp_record = arps[chain_id].get_record()
                 for chain_id, mac in enumerate(dst_macs):
                     if not mac:
                         arp_record = arps[chain_id].get_record()
-                        if arp_record.dest_mac:
+                        if arp_record.dst_mac:
                             dst_macs[chain_id] = arp_record.dst_mac
                             dst_macs_count += 1
                             dst_macs[chain_id] = arp_record.dst_mac
                             dst_macs_count += 1
-                            LOG.info('   ARP: port=%d chain=%d IP=%s -> MAC=%s',
+                            LOG.info('   ARP: port=%d chain=%d src IP=%s dst IP=%s -> MAC=%s',
                                      port, chain_id,
                                      port, chain_id,
+                                     arp_record.src_ip,
                                      arp_record.dst_ip, arp_record.dst_mac)
                         else:
                             unresolved.append(arp_record.dst_ip)
                                      arp_record.dst_ip, arp_record.dst_mac)
                         else:
                             unresolved.append(arp_record.dst_ip)