aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/vnf_generic/vnf/tg_trex.py
AgeCommit message (Collapse)AuthorFilesLines
2017-12-14NSB TRex: convert DPDK port number to logical TRex port numberRoss Brattain1-5/+27
when we create TRex config we sort based on PCI bus address and create a logical port ordering. We need to save this port ordering and re-use it everywhere. redirect vnfd_helper.port_num() to resource_helper.port_num() to use the logical mapping Change-Id: Ibff628556d5e11e686e15716a66a3210758c4ff0 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> (cherry picked from commit ce52059f5f78912eeff2d97235c1028c218bf960)
2017-10-19NSB: fix trex config to use dpdk port numberRoss Brattain1-11/+14
From some reason Heat/Neutron is now creating interfaces such that xe0 and xe1 are swapped. xe0 fa:16:3e:38:c7:66 0000:00:05.0 xe1 fa:16:3e:2f:f3:e2 0000:00:03.0 this causes the DPDK port numbering to be swapped. xe0 is DPDK port 1 because it has higher PCI address xe1 is DPDK port 0 because it has lower PCI address. The VNF is configured correctly because it uses DPDK port numbers, whereas TRex was using interface list ordering. Modify trex_cfg.yaml to use DPDK port ordering. This also requires running generate_cfg() after setup() in instantiate() +------------------------------------+-------------------+------------------------------+--------+ | Name | MAC Address | Fixed IP Addresses | Status | +------------------------------------+-------------------+------------------------------+--------+ | vnf_0.yardstick-af5ccb47-xe0-port | fa:16:3e:66:a5:e4 | ip_address='10.1.0.7', | ACTIVE | | vnf_0.yardstick-af5ccb47-mgmt-port | fa:16:3e:fa:98:fe | ip_address='10.0.1.10', | ACTIVE | | tg_0.yardstick-af5ccb47-xe1-port | fa:16:3e:2f:f3:e2 | ip_address='10.1.1.9', | ACTIVE | | vnf_0.yardstick-af5ccb47-xe1-port | fa:16:3e:f3:1d:f5 | ip_address='10.1.1.4', | ACTIVE | | | fa:16:3e:e3:8c:65 | ip_address='10.0.1.1', | ACTIVE | | | fa:16:3e:ff:d1:b7 | ip_address='11.191.14.110', | N/A | | tg_0.yardstick-af5ccb47-xe0-port | fa:16:3e:38:c7:66 | ip_address='10.1.0.8', | ACTIVE | | | fa:16:3e:ff:53:5f | ip_address='11.191.14.101', | DOWN | | | fa:16:3e:23:5d:2c | ip_address='10.0.1.2', | ACTIVE | | tg_0.yardstick-af5ccb47-mgmt-port | fa:16:3e:7a:df:4e | ip_address='10.0.1.5', | ACTIVE | | | fa:16:3e:22:65:36 | ip_address='11.191.14.109', | N/A | +------------------------------------+-------------------+------------------------------+--------+ /sys/devices/pci0000:00/0000:00:03.0/virtio0/net/ens3/address:fa:16:3e:2f:f3:e2 /sys/devices/pci0000:00/0000:00:05.0/virtio2/net/ens5/address:fa:16:3e:38:c7:66 Change-Id: Iaef2c7d9a5af7f45bd805a8ad6ee545ce0495cb1 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> (cherry picked from commit 7ed018cddf88ac1c5a92f71fa5e421e66d259bc0)
2017-10-03Enable multi-port perf in trex as TGDeepak S1-6/+18
set TRex -c option for threads per port based on hardware number of queues. We can't auto-detect number of queues and we can't use more than one thread per core on systems with single-queue interfaces, so move the option to the config file options: tg_0: queues_per_port: 2 also enable trex debug by removing >/dev/null redirection options: tg_0: trex_server_debug: true Change-Id: I46da187849282bf28f4ef5b333e1ae890e202768 Signed-off-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-09-05Add fixes for heat deployed UDP_Replay and TRexMartin Banszel1-4/+15
- Added a PROTOCOL_MAP to map the protocol names to codes -- the scapy requires the code, it fails if the proto is set e.g. to 'udp' - ip addresses must be str, not unicode -- explicit conversion to str added - removed unittest for setup_vnf_environment in test_tg_trex.py as it is the same function as already tested in test_sample_vnf.py - traffic_profile refactored -- code repetition decreased, unittest adapted Known issues: - there is a an attempt to stop already stopped trex. It fires an exception that stop command is issued on the disconnected client. Change-Id: I87e9029630f48b30e8f5b4f9d88ab3b25fd65f03 Signed-off-by: Martin Banszel <martinx.banszel@intel.com>
2017-08-08NSB updateDeepak S1-235/+110
Refactored main NSB VNF classes accroding to class diagram https://wiki.opnfv.org/display/yardstick/NSB+class+diagram All the SampleVNFs have been separated and placed under the SampleVNF class. Added AutoConnectSSH to automatically create SSH conneciton on demand. Added VnfdHelper class to wrap the VNFD dictionary in prepartion for class-based modeling. Extracted DpdkVnfSetupEnvHelper for DPDK based VNF setup. Extracted Stats and other client config to ResourceHelper Had to replace dict_key_flatten with deepgetitem due to Python 2.7 Jinja2 infinite recursion. Change-Id: Ia8840e9c44cdbdf39aab6b02e6d2176b31937dc9 Signed-off-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-04-11standardize ssh authRoss Brattain1-10/+5
we need to be following defautl paramiko rules, first use pkey, then key_filenames (autodetecting ~/.ssh/ keys), then password We have too much boilerplate redudant code everywhere, we need to standardize on a factory function that takes a node dict. Using Python3 ChainMap we can layer overrides and defaults. VNF descriptors have to default key_filename, password to Python None. The only way to do this is to omit key values if the variable is not defined, this way the dict will not have the value and it will default to Python None Add python2 chainmap backport Updated unittest mocking to use ssh.SSH.from_node Change-Id: I80b0cb606e593b33e317c9e5e8ed0b74da591514 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-03-09Bug Fix: force the network to attacht to trex to start the trafficDeepak S1-0/+2
Change-Id: I73744a9e0f1830688a171f3f28044926b13f8a43 Signed-off-by: Deepak S <deepak.s@linux.intel.com>
2017-01-19Adding trex trafficgen example.Deepak S1-0/+278
This patch uses trex trafficgen example to define dynamic traffic profiles and how it can be mapped to real world traffic. JIRA: YARDSTICK-492 Change-Id: Ica24957ebf43315a8d81adabd4745c27d3c7c36a Signed-off-by: Deepak S <deepak.s@linux.intel.com>