From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F805A00C4; Sat, 5 Mar 2022 03:27:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0B5C40683; Sat, 5 Mar 2022 03:27:03 +0100 (CET) Received: from m12-18.163.com (m12-18.163.com [220.181.12.18]) by mails.dpdk.org (Postfix) with ESMTP id 3BEFB40042 for ; Sat, 5 Mar 2022 03:27:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=tqNjC T4Fbok8cb/vhOpeza/pHTOmDwifz6+Csx42F8o=; b=nljP4RS04ADr3KOIW0R2d werNSXiojkLzNlb0i/wFSoA1sGMmgE5El1aQk9d0thRDgAr0I6xE6x/lAYnmipKB xNfk14d0xi73tHqmJoZC43AZlDoLcW3l+ztxyw//V238yKdmRvGAVUxQpV9NK73G PFo3PsMu8Ou06KuI7UXdBU= Received: from DESKTOP-ONA2IA7.localdomain (unknown [211.138.116.222]) by smtp14 (Coremail) with SMTP id EsCowAA3meRkyiJi_iKyFg--.8366S4; Sat, 05 Mar 2022 10:26:54 +0800 (CST) From: Gaoxiang Liu To: chas3@att.com, humin29@huawei.com Cc: dev@dpdk.org, liugaoxiang@huawei.com, Gaoxiang Liu Subject: [PATCH v2] net/bonding: another fix to LACP mempool size Date: Sat, 5 Mar 2022 10:26:30 +0800 Message-Id: <20220305022630.153-1-gaoxiangliu0@163.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220304095613.1717-1-gaoxiangliu0@163.com> References: <20220304095613.1717-1-gaoxiangliu0@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: EsCowAA3meRkyiJi_iKyFg--.8366S4 X-Coremail-Antispam: 1Uf129KBjvJXoW7uw1rJF45ur4xCF4rCw47twb_yoW8ZrWrpr W7Wa13CF1DZFW2qa1xX3WfCrZ5u3WxXw17Kan5Zas3Z3yfAFn0kr17tryY9rW8GrWvyrsI yF45Z3sagF15CrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRl_McUUUUU= X-Originating-IP: [211.138.116.222] X-CM-SenderInfo: xjdr5xxdqjzxjxq6il2tof0z/1tbi6w+6OlXlzyNhAwAAsa X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The following log message may appear after a slave is idle(or nearly idle) for a few minutes:"PMD: Failed to allocate LACP packet from pool". And bond mode 4 negotiation may fail. Problem: All mbufs from a slave' private pool(used exclusively for transmitting LACPDUs) have been allocated and are still sitting in the device's tx descriptor ring and other cores' mempool caches. Solution: Ensure that each slave'tx (LACPDU) mempool owns more than n-tx-queues * n-tx-descriptor + fwd_core_num * per-core-mmempool-flush-threshold mbufs. Note that the LACP tx machine fuction is the only code that allocates from a slave's private pool. It runs in the context of the interrupt thread, and thus it has no mempool cache of its own. Signed-off-by: Gaoxiang Liu --- v2: * Fixed compile issues. --- drivers/net/bonding/rte_eth_bond_8023ad.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index ca50583d62..831c7dc6ab 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -1050,6 +1050,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint32_t total_tx_desc; struct bond_tx_queue *bd_tx_q; uint16_t q_id; + uint32_t cache_size; /* Given slave mus not be in active list */ RTE_ASSERT(find_slave_by_id(internals->active_slaves, @@ -1100,6 +1101,9 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, total_tx_desc += bd_tx_q->nb_tx_desc; } + cache_size = RTE_MEMPOOL_CACHE_MAX_SIZE >= 32 ? + 32 : RTE_MEMPOOL_CACHE_MAX_SIZE; + total_tx_desc = rte_lcore_count() * cache_size * 1.5; snprintf(mem_name, RTE_DIM(mem_name), "slave_port%u_pool", slave_id); port->mbuf_pool = rte_pktmbuf_pool_create(mem_name, total_tx_desc, RTE_MEMPOOL_CACHE_MAX_SIZE >= 32 ? -- 2.32.0