History log of /vpp/test/test_bond.py
Revision Date Author Comments
# 7285103a 29-May-2020 Matthew Smith <mgsmith@netgate.com>

bonding: Revert adjust link state

This reverts commit 9121c415a91904be50071ec55143d9c89b2f1b91.

Reason for revert: causes deadlock with multiple worker threads

Type: fix

Change-Id: Icf3d6d343d99d887abacbaa03acbf04d4628514e
Signed-off-by: Matthew Smith <mgsmith@netgate.com>

# 9121c415 18-May-2020 Matthew Smith <mgsmith@netgate.com>

bonding: adjust link state based on active slaves

Type: improvement

Bond link state is being maintained inconsistently. It is initially set to
up. If the bond interface admin state is set to down, the link state is
set to down. If the bond interface admin state is set to up, the link
state is only set to up if there are active slave interfaces at that point.
If slaves become active at some later time, it does not get updated. Its
next chance to be updated is the next time the bond interface is set to
admin up.

To address this, do not set the link state to up after creating a bond.
Adjust the link state as slave interfaces are attached or detached
based on whether the bond is getting its first active slave or losing
its last one.

Unit test added to verify correct maintenance of link state.

Change-Id: I31f17321f7f0e727e1ab1e01713423af6566dad9
Signed-off-by: Matthew Smith <mgsmith@netgate.com>

# 72e31bc2 04-Feb-2020 Vladimir Isaev <visaev@netgate.com>

stats: fix state counter removal

Avoid using vec_del1() for directory vector to keep indexes valid all
the time.

There are state counters for each slave in LACP bond mode which can be
dynamically created and removed. Vector index is used to access these
counters. But also vec_del1() is used to remove counter from vector.
This function changes the index of the last element, so after this we
are unable to access ex-last element using old index.

As a result it is not possible to add-del-add two interfaces to the LACP

DBGvpp# create bond mode lacp
DBGvpp# create packet-generator interface pg1
DBGvpp# create packet-generator interface pg2
DBGvpp# bond add BondEthernet0 pg1
DBGvpp# bond add BondEthernet0 pg2
DBGvpp# bond del pg1
DBGvpp# bond del pg2
DBGvpp# bond add BondEthernet0 pg1
DBGvpp# bond add BondEthernet0 pg2
bond add: /if/lacp/1/3/partner-state is already register

Type: fix

Signed-off-by: Vladimir Isaev <visaev@netgate.com>
Change-Id: I2c86e13905eefdef6233369cd4ab5c1b53d123bd

# cbe25aab 30-Sep-2019 Neale Ranns <nranns@cisco.com>

ip: Protocol Independent IP Neighbors

Type: feature

- ip-neighbour: generic neighbour handling; APIs, DBs, event handling,
- arp: ARP protocol implementation
- ip6-nd; IPv6 neighbor discovery implementation; separate ND,
- ip6-link; manage link-local addresses
- l2-arp-term; events separated from IP neighbours, since they are not
the same.

vnet retains just enough education to perform ND/ARP packet
arp and ip6-nd to be moved to plugins soon.

Change-Id: I88dedd0006b299344f4c7024a0aa5baa6b9a8bbe
Signed-off-by: Neale Ranns <nranns@cisco.com>

# efd7bc2b 11-Nov-2019 Neale Ranns <nranns@cisco.com>

tests: Remove the unrequired VPP IP address/prefix class wrappers

Type: refactor

Change-Id: I204f3f8eebc5f5d5a377e91262f91c615fd00168
Signed-off-by: Neale Ranns <nranns@cisco.com>

# ead1e536 31-Oct-2019 Renato Botelho do Couto <renato@netgate.com>

misc: Fix python scripts shebang line

Type: fix

Since CentOS 8, RPM build script doesn't accept '#!/usr/bin/env python'
as a valid shebang line. It requires scripts to explicitly chose
between python2 or python3.

Change all to use python3 as suggested by Paul Vinciguerra.

Depends-On: https://gerrit.fd.io/r/23170

Signed-off-by: Renato Botelho do Couto <renato@netgate.com>
Change-Id: Ie72af9f60fd0609e07f05b70f8d96e738b2754d1

# f6dee6c8 21-Oct-2019 Ole Troan <ot@cisco.com>

bonding: tests support python3

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I6cedb43af4437fdabce75f4a845629c5c2f96f6a

# a1876b84 20-Aug-2019 Steven Luong <sluong@cisco.com>

bonding: add weight support for active-backup mode

Not all interfaces have the same characteristics within the bonding group.
For active-backup mode, we should do our best to select the slave that
performs the best as the primary slave. We already did that by preferring
the slave that is local numa. Sometimes, this is not enough. For example,
when all are local numas, the selection is arbitrary. Some slave interfaces
may have higher speed or better qos than the others. But this is hard to

One rule does not fit all. So we let the operator to optionally specify the
weight for each slave interface. Our primary slave selection rule is now
1. biggest weight
2. is local numa
3. current primary slave (to avoid churn)
4. lowest sw_if_index (for deterministic behavior)

This selection rule only applies to active-backup mode which only one slave
is used for forwarding traffic until it becomes unreachable. At that time,
the next "best" slave candidate is automatically promoted. The slaves are
sorted according to the preference rule when they are up. So there is no need
to find the next best candidate when the primary slave goes down.

Another good thing about this rule is when the down slave comes back up, it
is selected as the primary slave again unless there is indeed a "better"
slave than this down slave that were added during that period.

To set the weight for the slave interface, do this after the interface is

set interface bond <interface-name> weight <value>

Type: feature

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I59ced6d20ce1dec532e667dbe1afd1b4243e04f9

# 053204ab 18-Mar-2019 Jakub Grajciar <jgrajcia@cisco.com>

api: Cleanup APIs interface.api

Use of consistent API types for interface.api

Type: fix

Change-Id: I88206d7d0907cffd564031f73c9a996df2e5e21a
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>

# 751e3f38 26-Jun-2019 Zhiyong Yang <zhiyong.yang@intel.com>

bonding: add support for numa-only in lacp mode

If numa-only is set, Only slaves on local numa node
transmit pkts if have at least one, otherwise the bond
interface works as usual.

CLI change:
create bond mode lacp [load-balance { l2 | l23 | l34 } {numa-only}]
[hw-addr <mac-address>] [id <if-id>]

The new member "u8 numa_only;" is also added to bond_create_if_args_t.

Type: feature

Change-Id: Icdccedafb0738d8c9d4a5acce909ce562428c071
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>

# 90cf21b5 13-Mar-2019 Paul Vinciguerra <pvinci@vinciconsulting.com>

Tests: Refactor tearDown show command logging, add lifecycle markers.

This change adds a consistent interface for adding test-specific show commands to

It also adds log markers for the execution of setUp[Class], tearDown[Class]
in the logs.

Change-Id: I7d42e396e594a59e866a7d55dac0af25548e657a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>

# 7f9b7f9f 13-Mar-2019 Paul Vinciguerra <pvinci@vinciconsulting.com>

Tests Cleanup: Fix missing calls to setUpClass/tearDownClass.

Continuation/Part 2 of https://gerrit.fd.io/r/#/c/17092/

Change-Id: Id0122d84eaf2c05d29e5be63a594d5e528ee7c9a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>

# 3b0d7e42 15-Mar-2019 Ole Trøan <otroan@employees.org>

Revert "API: Cleanup APIs interface.api"

This reverts commit e63325e3ca03c847963863446345e6c80a2c0cfd.

Allow time for CSIT to accommodate.

Change-Id: I59435e4ab5e05e36a2796c3bf44889b5d4823cc2
Signed-off-by: ot@cisco.com

# e63325e3 01-Mar-2019 Jakub Grajciar <jgrajcia@cisco.com>

API: Cleanup APIs interface.api

Use of consistent API types for interface.api

Change-Id: Ieb54cebb4ac96b432a3f0b41596718aa2f34885b
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>

# 9a6dafd5 06-Mar-2019 Paul Vinciguerra <pvinci@vinciconsulting.com>

Tests: use self.assertNotIn().

Many tests use self.assertEqual(error.find("failed"), -1)
Use self.assertNotIn("failed", error) to provide more meaningful errors such as
AssertionError: 'Failed' not found in '' instead of 0 != -1.

Change-Id: I670acdc977b788b2cedf94cfeafc12097781463f
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>

# 9a475373 05-Mar-2019 Ole Troan <ot@cisco.com>

test framework: vpp_papi_provider.py - further cleanup

Part of further cleanups of this file.
Removed most wrappers that don't have conflicting signature with
message API.

Change-Id: I6acd93d20291feb7731eb35ab2eb8c9f22f4632c
Signed-off-by: Ole Troan <ot@cisco.com>

# 8006c6aa 16-Dec-2018 Ole Troan <ot@cisco.com>

PAPI: Add MACAddress object wrapper for vl_api_mac_address_t

Change the definition of vl_api_mac_address_t to an aliased type.

Change-Id: I1434f316d0fad6a099592f39bceeb8faeaf1d134
Signed-off-by: Ole Troan <ot@cisco.com>

# 7f99183a 06-Dec-2018 Ole Troan <ot@cisco.com>

Test framework: StringIO fixes for Python3

Add 2/3 support to binarytomac and mactobinary and move to vpp_mac.py

Change-Id: I3dc7e4a24486aee22140c781aae7e44e58935877
Signed-off-by: Ole Troan <ot@cisco.com>

# 0d88301a 11-May-2018 Steven <sluong@cisco.com>

bond: performance harvesting

- hash is great. But it is a bit too slow for the DP. Use direct array indexing
to quickly retrieve the slave interface.
- the algorithm used by flow hash is great. But it is a bit too slow for the DP.
Use l2_hash_hash() extracted from lb_hash.h which ECMP is using. It makes use
of intrinsic crc32 instruction set.
- shortcut modulo arithmetic when the operand is 2**x (where x up to 4) to
avoid division instruction.
- special case for link count == 1 in bond_tx_fn()
- use clib_mem_unaligned to access data for the packet to avoid alignment error
- Fix some typos for packet tracing.

Change-Id: I8eae3ad497061c5473aa675ba894ee0211120d25
Signed-off-by: Steven <sluong@cisco.com>

# 9cd2d7a5 20-Dec-2017 Steven <sluong@cisco.com>

bond: Add bonding driver and LACP protocol

Add bonding driver to support creation of bond interface which composes of
multiple slave interfaces. The slave interfaces could be physical interfaces,
or just any virtual interfaces. For example, memif interfaces.

The syntax to create a bond interface is
create bond mode <lacp | xor | acitve-backup | broadcast | round-robin>

To enslave an interface to the bond interface,
enslave interface TenGigabitEthernet6/0/0 to BondEthernet0

Please see src/plugins/lacp/lacp_doc.md for more examples and additional

LACP is a control plane protocol which manages and monitors the status of
the slave interfaces. The protocol is part of 802.3ad standard. This patch
implements LACPv1. LACPv2 is not supported.
To enable LACP on the bond interface, specify "mode lacp" when the bond
interface is created. The syntax to enslave a slave interface is the same as
other bonding modes.

Change-Id: I06581d3b87635972f9f0e1ec50b67560fc13e26c
Signed-off-by: Steven <sluong@cisco.com>