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 56B72A034C; Tue, 21 Dec 2021 20:58:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D0F841147; Tue, 21 Dec 2021 20:58:09 +0100 (CET) Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) by mails.dpdk.org (Postfix) with ESMTP id 3A0DB406A2 for ; Tue, 21 Dec 2021 20:58:06 +0100 (CET) Received: by mail-qt1-f177.google.com with SMTP id a1so13896655qtx.11 for ; Tue, 21 Dec 2021 11:58:06 -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=//DyR/b5J0MzHHvenuvPZsKSZMid4AwTriLPC1Lsw04=; b=HkxRD/42bEn0AtqBsrPVsLbZiVDPwke/llum+wrNGTmNU9goY9BnUoQsJwplsqGxjG G91CFP2PJXIRVNM09gYktjCTvU7zE+uonKXxBEsUE3FAjncXBCK+OZxneB6oEpt/3nF/ 1Pk+qRIb2JqcQ1RcchcH9C1ClWM3wVSqOYtrh3ABRWzE11HGoGX/Sc8bnsRNZ2AiILFZ bcNqgm9Rw4M/pzvJlbchZOKcHp0hpLrG5/GuUVcHNLWTsPyVOdjNFi5CRYAUfsqDAbeq e8Z3V8BRBw0BSPgPz/MLvmur/YLOjK2NNQWBHe4JZ6wa/t/It6aJykPYKxXNQlBxwqf8 r8TQ== 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=//DyR/b5J0MzHHvenuvPZsKSZMid4AwTriLPC1Lsw04=; b=MgZocUSv184BLfZSjr7fpa23xa4PzHqRAlZvNXZE86hn2B9CFfl0uXC3k/wy9oqJQB i5jO8a30DlST5siEAnT/lhfXMFED7y+xrmrjsVATDF+g68K3hUXv7zcLwP/GYVWQJp0P jRXd8EcKju0PuzKK0Hw5EjD8VBvXvKhzx/iu4UJoz6mM0fjKmviaKQgiNFnBKAmfiJks wAZfKwi3sRTaf6pQtEGiivg9TUsoTHLO0quyiAgvGwj/M00SD1PP7IpT1aNNqWTnQ91t qtt4XokBB9IR9P+/VsZYKVVCrZBm7EIc+4DWHkX9ExsXNKgo562mtCjr+/0dEVS6oG1X gRkQ== X-Gm-Message-State: AOAM532gJg5H6qiss28jVBPk9mLrnEtiuphQ9eBFIxwh3qPX35gU/cjI HnQFlM7TGTnex717+9o5VspcQ2RlntioUQ== X-Google-Smtp-Source: ABdhPJxmI6Ev464DhjBLMd6EuHKIYOqdB6TyVsSggnfrEKMXog0ZejlR9NiSh/mFHGrTBf7BZQ6neQ== X-Received: by 2002:a05:622a:50d:: with SMTP id l13mr3721677qtx.75.1640116685625; Tue, 21 Dec 2021 11:58:05 -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 h3sm14684401qko.78.2021.12.21.11.58.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Dec 2021 11:58:05 -0800 (PST) From: Robert Sanford X-Google-Original-From: Robert Sanford To: dev@dpdk.org Cc: chas3@att.com, humin29@huawei.com, bruce.richardson@intel.com Subject: [PATCH v2 3/8] net/bonding: change mbuf pool and ring creation Date: Tue, 21 Dec 2021 14:57:25 -0500 Message-Id: <1640116650-3475-4-git-send-email-rsanford@akamai.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1640116650-3475-1-git-send-email-rsanford@akamai.com> References: <1639592401-56845-2-git-send-email-rsanford@akamai.com> <1640116650-3475-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. 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 --- 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