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 6AD96A00C3; Wed, 15 Dec 2021 19:20:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC9B841158; Wed, 15 Dec 2021 19:20:29 +0100 (CET) Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) by mails.dpdk.org (Postfix) with ESMTP id ABB3341147 for ; Wed, 15 Dec 2021 19:20:27 +0100 (CET) Received: by mail-qk1-f174.google.com with SMTP id m192so20928666qke.2 for ; Wed, 15 Dec 2021 10:20:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pXc71Yjkb1Baq56SEiQnuVV78bH0xh2zlKx/DgaqBRE=; b=YUjrKEtVgeMmNuuXvFkqjyqzP3aC++WJQ3Wqvfjp6FZToqDY3nSnWZMNFB7Gdi7FNz 0GJfJEn1VqPx7KASzCMZnr1cM2GpA534HhNvcwtNLbFuKJswrv38raD34HuQPd3qPSbD 4CXOEb5Nwm8VLXqAVYqN5f5Hb+cKOfr/1Pw6LbxvLEpZOgccKNSlSuA50+frU2e7gOvs OE8O5QmogIHf9jHqC1bJBCfX5rSkyi20y8MoUg5tGOe06WcgFUb1RrAdOBmGqfdcL4Vb P8943O3m7XYURiyq+PCujJlmhxKlUGqfwwz5VBk9hVug7VHrdaJiwBjeFkHj1Ypmb7Pq Ou1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pXc71Yjkb1Baq56SEiQnuVV78bH0xh2zlKx/DgaqBRE=; b=iRo/uoCfvahB08IO3qvMG3UqC39ue9e94wBx00TXsp8ruMKYP6+lDpEmlRWu8boXnV a7pbmvSDLUEsijusJhzGg8Ek3qOgj6AOttxWsvI0GE1BkL7eAWC5/xI5e5It1ZNTv6Qi dfOUItmqCvl/bmq51rE7MjmtVIaozqLXO2wegix4fm593AmmQzMDyl7kbD8p5mkfRVer C+m6fHYbOZPgWNftJlsjiU7fQc0KH2kHDx4r0uryTrgxHz1PBGHfh3IaYD0AElDGBk7j BfVB0Kd2C3sCUfCNrXc/s0gIkrYFd38sf9dL+9COmhew2RZ2LBWKAfCPsqgHOT4G1ZA8 FiKQ== X-Gm-Message-State: AOAM531pS2qqM9RudQ6WefN9Y5XxNhQPapNB0kSMRYsOvdf3C3oOoRZy ZTtokD/XDsh99NyirOus5+cnyOnVwgA= X-Google-Smtp-Source: ABdhPJy+PTdZ5798lNcUqxqHYpc/jHJxdH7rdDO+oUl25BrMVoTLf/CKl3SpOYWpyimSxmwrI1kW3Q== X-Received: by 2002:a37:de09:: with SMTP id h9mr9559969qkj.764.1639592427018; Wed, 15 Dec 2021 10:20:27 -0800 (PST) Received: from ubuntu.localdomain (99-153-167-175.lightspeed.ftldfl.sbcglobal.net. [99.153.167.175]) by smtp.gmail.com with ESMTPSA id 8sm2075978qtz.28.2021.12.15.10.20.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Dec 2021 10:20:26 -0800 (PST) From: Robert Sanford X-Google-Original-From: Robert Sanford To: dev@dpdk.org Cc: chas3@att.com, humin29@huawei.com Subject: [PATCH 3/7] net/bonding: change mbuf pool and ring allocation Date: Wed, 15 Dec 2021 13:19:57 -0500 Message-Id: <1639592401-56845-4-git-send-email-rsanford@akamai.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1639592401-56845-1-git-send-email-rsanford@akamai.com> References: <1639592401-56845-1-git-send-email-rsanford@akamai.com> 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 - Turn off mbuf pool caching to avoid mbufs lingering in pool caches. At most, we transmit one LACPDU per second, per port. - Fix calculation of ring sizes, taking into account that a ring of size N holds up to N-1 items. Signed-off-by: Robert Sanford --- drivers/net/bonding/rte_eth_bond_8023ad.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 43231bc..83d3938 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 @@ -1113,19 +1111,23 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, slave_id, mem_name, rte_strerror(rte_errno)); } + /* Add one extra because ring reserves one. */ 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); + rte_align32pow2(BOND_MODE_8023AX_SLAVE_RX_PKTS + 1), + socket_id, 0); if (port->rx_ring == NULL) { rte_panic("Slave %u: Failed to create rx ring '%s': %s\n", slave_id, mem_name, rte_strerror(rte_errno)); } - /* TX ring is at least one pkt longer to make room for marker packet. */ + /* TX ring is at least one pkt longer to make room for marker packet. + * Add one extra because ring reserves one. */ 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); + rte_align32pow2(BOND_MODE_8023AX_SLAVE_TX_PKTS + 2), + socket_id, 0); if (port->tx_ring == NULL) { rte_panic("Slave %u: Failed to create tx ring '%s': %s\n", slave_id, -- 2.7.4