From ae838f98fa020d0ad0aa37ab58e02456889c3375 Mon Sep 17 00:00:00 2001 From: fmenguy Date: Wed, 22 Jan 2020 16:00:48 +0100 Subject: NFVBENCH-157 Add possibility to not use the ARP static configuration for VPP loop VM Change-Id: Ifd3f183345e21c7866e9e9898c7bbda601793b2c Signed-off-by: fmenguy --- nfvbench/cfg.default.yaml | 5 +++++ nfvbench/chain_runner.py | 3 ++- nfvbench/chaining.py | 8 ++++++-- nfvbench/nfvbench.py | 6 ++++++ 4 files changed, 19 insertions(+), 3 deletions(-) (limited to 'nfvbench') 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', -- cgit 1.2.3-korg