DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/bonding: another fix to LACP mempool size
@ 2022-03-04  9:56 Gaoxiang Liu
  2022-03-05  2:26 ` [PATCH v2] " Gaoxiang Liu
  0 siblings, 1 reply; 20+ messages in thread
From: Gaoxiang Liu @ 2022-03-04  9:56 UTC (permalink / raw)
  To: chas3, humin29; +Cc: dev, liugaoxiang, Gaoxiang Liu

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 <liugaoxiang@huawei.com>
---
 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..f896195447 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_SIZ;
+	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


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-04-12 19:04 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-04  9:56 [PATCH] net/bonding: another fix to LACP mempool size Gaoxiang Liu
2022-03-05  2:26 ` [PATCH v2] " Gaoxiang Liu
2022-03-05  7:09   ` [PATCH v3] " Gaoxiang Liu
2022-03-08  1:17     ` Min Hu (Connor)
2022-03-08 14:24     ` [PATCH v4] " Gaoxiang Liu
2022-03-09  0:32       ` Min Hu (Connor)
2022-03-09  1:25       ` Stephen Hemminger
2022-03-09  2:53         ` Min Hu (Connor)
2022-03-25 12:02           ` Gaoxiang Liu
2022-03-09  1:26       ` Stephen Hemminger
2022-03-25 12:10       ` [PATCH v5] " Gaoxiang Liu
2022-03-25 13:01         ` Gaoxiang Liu
2022-03-25 13:13           ` Morten Brørup
2022-03-26 12:57             ` Wang, Haiyue
2022-03-25 13:34           ` [PATCH v6] " Gaoxiang Liu
2022-03-25 14:04             ` Morten Brørup
2022-03-28 15:16             ` [PATCH v7] " Gaoxiang Liu
2022-04-29 14:20               ` Ferruh Yigit
2022-05-01  7:02                 ` Matan Azrad
2024-04-12 19:04               ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).