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 0D076A00C3; Thu, 16 Dec 2021 10:00:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 527AF40696; Thu, 16 Dec 2021 09:59:59 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id CDADE40143 for ; Thu, 16 Dec 2021 09:59:57 +0100 (CET) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4JF5f04WpZzbjMs; Thu, 16 Dec 2021 16:59:36 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.20; Thu, 16 Dec 2021 16:59:55 +0800 Subject: Re: [PATCH 3/7] net/bonding: change mbuf pool and ring allocation To: Robert Sanford , CC: References: <1639592401-56845-1-git-send-email-rsanford@akamai.com> <1639592401-56845-4-git-send-email-rsanford@akamai.com> From: "Min Hu (Connor)" Message-ID: <3eb682a7-74db-5bc6-cbd0-7dbbc4177abd@huawei.com> Date: Thu, 16 Dec 2021 16:59:55 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <1639592401-56845-4-git-send-email-rsanford@akamai.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected 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 Hi, Robert, ÔÚ 2021/12/16 2:19, Robert Sanford дµÀ: > - Turn off mbuf pool caching to avoid mbufs lingering in pool caches. > At most, we transmit one LACPDU per second, per port. Could you be more detailed, why does mbuf pool caching is not needed? > - Fix calculation of ring sizes, taking into account that a ring of > size N holds up to N-1 items. Same to that, why should resvere another items ? > By the way, I found the comment for BOND_MODE_8023AX_SLAVE_RX_PKTS is is wrong, could you fix it in this patch? > 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, >