summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/testing/user/userguide/advanced.rst1
-rwxr-xr-xnfvbench/cfg.default.yaml5
-rw-r--r--nfvbench/chain_runner.py3
-rw-r--r--nfvbench/chaining.py8
-rw-r--r--nfvbench/nfvbench.py6
-rwxr-xr-xnfvbenchvm/dib/build-image.sh2
-rw-r--r--nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local14
7 files changed, 33 insertions, 6 deletions
diff --git a/docs/testing/user/userguide/advanced.rst b/docs/testing/user/userguide/advanced.rst
index b36f01e..5424a05 100644
--- a/docs/testing/user/userguide/advanced.rst
+++ b/docs/testing/user/userguide/advanced.rst
@@ -292,6 +292,7 @@ MAC Addresses
NFVbench will dicover the MAC addresses to use for generated frames using:
- either OpenStack discovery (find the MAC of an existing VM) in the case of PVP and PVVP service chains
- or using dynamic ARP discovery (find MAC from IP) in the case of external chains.
+- In case of L3 chain with SDN-GW or router between traffic generator and loop VM ARP is needed to discover SDN-GW mac addresses, use ``--loop-vm-arp`` flag or ``loop_vm_arp: true`` in config file.
Status and Cleanup of NFVbench Resources
----------------------------------------
diff --git a/nfvbench/cfg.default.yaml b/nfvbench/cfg.default.yaml
index d3a3fb9..2abc8dc 100755
--- a/nfvbench/cfg.default.yaml
+++ b/nfvbench/cfg.default.yaml
@@ -610,6 +610,11 @@ vlans: []
# (see mac_addrs_left and mac_addrs_right)
no_arp: false
+# Loop VM (VPP forwarder) can use ARP to discover next hop mac address
+# False (default): do not send ARP but use static config devices macs instead (TRex gratuitous ARP are not interpreted by VPP)
+# True: ARP requests are sent to find out next hop MAC addresses (for instance SDN-GW)
+loop_vm_arp: false
+
# Traffic Profiles
# You can add here more profiles as needed
# `l2frame_size` can be specified in any none zero integer value to represent the size in bytes
diff --git a/nfvbench/chain_runner.py b/nfvbench/chain_runner.py
index 418d667..bb35426 100644
--- a/nfvbench/chain_runner.py
+++ b/nfvbench/chain_runner.py
@@ -105,7 +105,8 @@ class ChainRunner(object):
if not self.config.no_traffic:
# ARP is needed for EXT chain or VxLAN overlay unless disabled explicitly
if (self.config.service_chain == ChainType.EXT or
- self.config.vxlan or self.config.l3_router) and not self.config.no_arp:
+ self.config.vxlan or self.config.l3_router or self.config.loop_vm_arp)\
+ and not self.config.no_arp:
self.traffic_client.ensure_arp_successful()
self.traffic_client.ensure_end_to_end()
diff --git a/nfvbench/chaining.py b/nfvbench/chaining.py
index a8d6295..71693be 100644
--- a/nfvbench/chaining.py
+++ b/nfvbench/chaining.py
@@ -456,8 +456,12 @@ class ChainVnf(object):
else:
tg_gateway1_ip = devices[LEFT].tg_gateway_ip_addrs
tg_gateway2_ip = devices[RIGHT].tg_gateway_ip_addrs
- tg_mac1 = remote_mac_pair[0]
- tg_mac2 = remote_mac_pair[1]
+ if not config.loop_vm_arp:
+ tg_mac1 = remote_mac_pair[0]
+ tg_mac2 = remote_mac_pair[1]
+ else:
+ tg_mac1 = ""
+ tg_mac2 = ""
g1cidr = devices[LEFT].get_gw_ip(
self.chain.chain_id) + self.__get_network_mask(
diff --git a/nfvbench/nfvbench.py b/nfvbench/nfvbench.py
index eb86dea..168c545 100644
--- a/nfvbench/nfvbench.py
+++ b/nfvbench/nfvbench.py
@@ -343,6 +343,12 @@ def _parse_opts_from_cli():
help='Do not use ARP to find MAC addresses, '
'instead use values in config file')
+ parser.add_argument('--loop-vm-arp', dest='loop_vm_arp',
+ default=None,
+ action='store_true',
+ help='Use ARP to find MAC addresses '
+ 'instead of using values from TRex ports (VPP forwarder only)')
+
parser.add_argument('--no-vswitch-access', dest='no_vswitch_access',
default=None,
action='store_true',
diff --git a/nfvbenchvm/dib/build-image.sh b/nfvbenchvm/dib/build-image.sh
index 09ccf6a..87c1169 100755
--- a/nfvbenchvm/dib/build-image.sh
+++ b/nfvbenchvm/dib/build-image.sh
@@ -30,7 +30,7 @@ set -e
gs_url=artifacts.opnfv.org/nfvbench/images
# image version number
-__version__=0.11
+__version__=0.12
image_name=nfvbenchvm_centos-$__version__
# if image exists skip building
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local b/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local
index 64557d4..d69cd0e 100644
--- a/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local
@@ -211,12 +211,22 @@ if [ $PCI_ADDRESS_1 ] && [ $PCI_ADDRESS_2 ]; then
INTFS=`vppctl show int | grep Ethernet | xargs`
INTF_1=`echo $INTFS | awk '{ print $1 }'`
INTF_2=`echo $INTFS | awk '{ print $4 }'`
+ if [ -z "${TG_MAC1}" ]; then
+ # vm.conf does not support lines commented with #, so
+ # we need to remove the line to set the static ARP entry.
+ sed -i "/{{TG_MAC1}}/d" /etc/vpp/vm.conf
+ else
+ sed -i "s/{{TG_MAC1}}/${TG_MAC1}/g" /etc/vpp/vm.conf
+ fi
+ if [ -z "${TG_MAC2}" ]; then
+ sed -i "/{{TG_MAC2}}/d" /etc/vpp/vm.conf
+ else
+ sed -i "s/{{TG_MAC2}}/${TG_MAC2}/g" /etc/vpp/vm.conf
+ fi
sed -i "s/{{INTF_1}}/${INTF_1//\//\/}/g" /etc/vpp/vm.conf
sed -i "s/{{INTF_2}}/${INTF_2//\//\/}/g" /etc/vpp/vm.conf
sed -i "s/{{VNF_GATEWAY1_CIDR}}/${VNF_GATEWAY1_CIDR//\//\/}/g" /etc/vpp/vm.conf
sed -i "s/{{VNF_GATEWAY2_CIDR}}/${VNF_GATEWAY2_CIDR//\//\/}/g" /etc/vpp/vm.conf
- sed -i "s/{{TG_MAC1}}/${TG_MAC1}/g" /etc/vpp/vm.conf
- sed -i "s/{{TG_MAC2}}/${TG_MAC2}/g" /etc/vpp/vm.conf
sed -i "s/{{TG_NET1}}/${TG_NET1//\//\/}/g" /etc/vpp/vm.conf
sed -i "s/{{TG_NET2}}/${TG_NET2//\//\/}/g" /etc/vpp/vm.conf
sed -i "s/{{TG_GATEWAY1_IP}}/${TG_GATEWAY1_IP}/g" /etc/vpp/vm.conf