In this patch series, we fix two bonding driver bugs and enhance testpmd so that bonding mode 4 (LACP) ports remain operational even when idle.
1. Problem: testpmd does not call bonding mode 4 (LACP) ports' tx burst function at least every 100 ms, as mandated. Solution: Enhance testpmd's packet forwarding loop to infrequently invoke the tx burst API for bonding ports in mode 4, to transmit LACPDUs to the partner in a timely manner. 2. Problem: Bonding driver (item 3 below) needs to know how many objects may become cached in a memory pool. Solution: Rename macros that calculate a mempool cache flush threshold, and move them from rte_mempool.c to rte_mempool.h. 3. Problem: With little or no tx traffic, LACP tx machine may run out of mbufs. Solution: When calculating the minimum number of mbufs required in a bonding mode 4 slave's private (tx LACPDU) pool, include the maximum number of mbufs that may be cached in the pool's per-core caches. 4. Problem: When configuring a bonding device, we don't properly propagate most of the settings from the master to the slaves. Solution: Fix slave_configure() to correctly pass configuration data to rte_eth_dev_configure() on behalf of the slaves. Notes for configuring and running testpmd: We specify four ethernet devices in the arguments, because testpmd expects an even number. We configure two devices to be slaves under one bonded device, one device to be the other side of the forwarding bridge, and we ignore the fourth eth dev. +-------------+ +-------+ +--------+ |client A |<==>|DPDK | | | |bonded device| |testpmd|<===>|client B| |with 2 slaves|<==>| | | | +-------------+ +-------+ +--------+ To reproduce the out of buffers problem (#3), apply patch 1/4, run testpmd (with example args and commands shown below), and run ping from client A, like this: "ping -i18 -c10 clientB". After about five minutes, one of the slaves will run out of LACPDU mbufs. Example testpmd args: ./testpmd -c 0x00000555 -n 2 \ --log-level 7 \ --pci-whitelist "01:00.0" \ --pci-whitelist "01:00.1" \ --pci-whitelist "05:00.0" \ --pci-whitelist "84:00.0" \ --master-lcore 0 -- \ --interactive --portmask=0xf --numa --socket-num=0 --auto-start \ --coremask=0x00000554 --rxd=512 --txd=256 \ --burst=32 --mbcache=64 \ --nb-cores=2 --rxq=1 --txq=1 Example testpmd commands to reconfigure into bonding mode 4: stop port stop all create bonded device 4 0 add bonding slave 2 4 add bonding slave 3 4 port start 0 port start 1 port start 4 set portlist 4,0 start Robert Sanford (4): testpmd: fix LACP ports to work with idle links mempool: make cache flush threshold macro public net/bonding: another fix to LACP mempool size net/bonding: fix configuration of LACP slaves app/test-pmd/cmdline.c | 9 +++++++ app/test-pmd/testpmd.c | 37 +++++++++++++++++++++++++++++ app/test-pmd/testpmd.h | 4 +++ drivers/net/bonding/rte_eth_bond_8023ad.c | 10 +++++-- drivers/net/bonding/rte_eth_bond_pmd.c | 28 +++++---------------- lib/librte_mempool/rte_mempool.c | 8 +---- lib/librte_mempool/rte_mempool.h | 7 +++++ 7 files changed, 73 insertions(+), 30 deletions(-)