Thread (35 messages) 35 messages, 7 authors, 2022-03-08
STALE1600d
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH v2 3/8] net/bonding: change mbuf pool and ring creation

From: Robert Sanford <hidden>
Date: 2021-12-21 19:58:24
Subsystem: bonding driver, networking drivers, the rest · Maintainers: Jay Vosburgh, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

- Turn off mbuf pool caching to avoid mbufs lingering in pool caches.
  At most, we transmit one LACPDU per second, per port.
  LACP tx_machine() performs the "get", and runs in the context of the
  interrupt thread (no default cache).
  PMD typically "puts" no more than one LACPDU per second, on average.
- Create rings with RING_F_EXACT_SZ flag, so that they are the desired
  size, and not one less than requested.

Signed-off-by: Robert Sanford <redacted>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 43231bc..9ed2a46 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -1101,9 +1101,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,
 	}
 
 	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 ?
-			32 : RTE_MEMPOOL_CACHE_MAX_SIZE,
+	port->mbuf_pool = rte_pktmbuf_pool_create(mem_name, total_tx_desc, 0,
 		0, element_size, socket_id);
 
 	/* Any memory allocation failure in initialization is critical because
@@ -1115,7 +1113,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,
 
 	snprintf(mem_name, RTE_DIM(mem_name), "slave_%u_rx", slave_id);
 	port->rx_ring = rte_ring_create(mem_name,
-			rte_align32pow2(BOND_MODE_8023AX_SLAVE_RX_PKTS), socket_id, 0);
+		BOND_MODE_8023AX_SLAVE_RX_PKTS, socket_id, RING_F_EXACT_SZ);
 
 	if (port->rx_ring == NULL) {
 		rte_panic("Slave %u: Failed to create rx ring '%s': %s\n", slave_id,
@@ -1125,7 +1123,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,
 	/* TX ring is at least one pkt longer to make room for marker packet. */
 	snprintf(mem_name, RTE_DIM(mem_name), "slave_%u_tx", slave_id);
 	port->tx_ring = rte_ring_create(mem_name,
-			rte_align32pow2(BOND_MODE_8023AX_SLAVE_TX_PKTS + 1), socket_id, 0);
+		BOND_MODE_8023AX_SLAVE_TX_PKTS + 1, socket_id, RING_F_EXACT_SZ);
 
 	if (port->tx_ring == NULL) {
 		rte_panic("Slave %u: Failed to create tx ring '%s': %s\n", slave_id,
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help