From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by dpdk.org (Postfix) with ESMTP id 3566729CA for ; Mon, 1 Aug 2016 22:44:52 +0200 (CEST) Received: by mail-qk0-f194.google.com with SMTP id x189so4593134qkd.0 for ; Mon, 01 Aug 2016 13:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=5CmjfR+qu/HT/R1eISo+ALuYG6b1dG1hLyPQH8Rpqrs=; b=ourJ1sy9njXeeBV5zIfJsyIIn8SMLpdalkr41vq80Pp3aghDR1GQq4pqLoB2PxHfQJ AZ5+RY08CtrsyNHRKYgOst7zdMmSYElvqWXZfrJ8Mq2REDhVVNLigrT5PboMJ0krvgFL XuimKHxzxtjBvRLPqeEIcctEmmWsX/0+IpmYYKk4EGoZo2AELo+Bn/7221X6nBKYO4+U /KfAbbNrjNVJYgpDsBjw/0eQqQMOOZunK0LrC3YVRa1dLi7RQdD+6kI6Vy/9s3K9anLQ EAVKpnFjkJmBVVH411u7c8zCkDfF8N2NGnss2xzuDny2KPFRhQCmNaFCk7WkJrZByjTM 1URQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5CmjfR+qu/HT/R1eISo+ALuYG6b1dG1hLyPQH8Rpqrs=; b=FhQ/6fITvYwRh2qtNDSvphNQ/TOSKL4ooQc1KD4LjbrPB8Mxb6ZMqV1x0K4vam3fM2 dSiNv6a8cVtZsuuDuo0PotnARewbk67n60J5UWLnil8m3a962idOE543H2hGMidcnR86 Q4/cjpqKcC7y1yxI6IV/mJ4mnWhqq5pM+sfaefdOlfoUqNFABnMEstvW1sZOSYEDvon3 8LAwN8e8/lWLI9liZycOREvshOg/pkIHexCXTfnsQfMJudlkmuR4O/xIFh9XImJjmXwb 3V6skwk8QxuG7PpSWZjy3dUo6XrDujDeYEkApR0c7hM5BIY6P3uj7Zl+67qhoE0Yluaz lH8Q== X-Gm-Message-State: AEkoout2gnvkYAYKc5syWc4lTY4OjFPOP66vHBKgSz0JEHSjIedcqaedaoLnp4rwZEiLXg== X-Received: by 10.55.105.5 with SMTP id e5mr71681646qkc.61.1470084291516; Mon, 01 Aug 2016 13:44:51 -0700 (PDT) Received: from localhost.localdomain ([23.79.237.14]) by smtp.gmail.com with ESMTPSA id i65sm18534359qtb.18.2016.08.01.13.44.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Aug 2016 13:44:51 -0700 (PDT) From: Robert Sanford X-Google-Original-From: Robert Sanford To: dev@dpdk.org Cc: declan.doherty@intel.com, pablo.de.lara.guarch@intel.com, olivier.matz@6wind.com Date: Mon, 1 Aug 2016 16:42:52 -0400 Message-Id: <1470084176-79932-1-git-send-email-rsanford@akamai.com> X-Mailer: git-send-email 1.7.1 Subject: [dpdk-dev] [PATCH 0/4] net/bonding: bonding and LACP fixes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 20:44:52 -0000 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(-)