Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423303AbbD2O5A (ORCPT ); Wed, 29 Apr 2015 10:57:00 -0400 Received: from mail-by2on0148.outbound.protection.outlook.com ([207.46.100.148]:45696 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1423253AbbD2O4y (ORCPT ); Wed, 29 Apr 2015 10:56:54 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; From: Madalin Bucur To: , CC: , Madalin Bucur Subject: [RFC,v3 03/10] dpaa_eth: add configurable bpool thresholds Date: Wed, 29 Apr 2015 17:56:38 +0300 Message-ID: <1430319405-31280-2-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1430319405-31280-1-git-send-email-madalin.bucur@freescale.com> References: <1430319405-31280-1-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(189002)(199003)(33646002)(6806004)(49486002)(77096005)(46102003)(87936001)(77156002)(47776003)(2950100001)(53806999)(62966003)(50226001)(5001960100001)(50986999)(19580395003)(50466002)(86362001)(575784001)(229853001)(106466001)(5001770100001)(104016003)(43066003)(36756003)(76176999)(48376002)(19580405001)(105606002)(85426001)(142933001)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB550;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB550; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BLUPR03MB550;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB550; X-Forefront-PRVS: 05610E64EE X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2015 14:56:51.6609 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB550 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4092 Lines: 101 Allow the user to tweak the refill threshold and the total number of buffers in the buffer pool. The provided values are for one CPU. Signed-off-by: Madalin Bucur --- drivers/net/ethernet/freescale/dpaa/Kconfig | 18 ++++++++++++++++++ drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +- drivers/net/ethernet/freescale/dpaa/dpaa_eth.h | 3 --- drivers/net/ethernet/freescale/dpaa/dpaa_eth_sg.c | 6 +++--- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/Kconfig b/drivers/net/ethernet/freescale/dpaa/Kconfig index 1f3a203..9e6a39f 100644 --- a/drivers/net/ethernet/freescale/dpaa/Kconfig +++ b/drivers/net/ethernet/freescale/dpaa/Kconfig @@ -11,6 +11,24 @@ menuconfig FSL_DPAA_ETH if FSL_DPAA_ETH +config FSL_DPAA_ETH_MAX_BUF_COUNT + int "Maximum number of buffers in private bpool" + range 64 2048 + default "128" + ---help--- + The maximum number of buffers to be by default allocated in the DPAA-Ethernet private port's + buffer pool. One needn't normally modify this, as it has probably been tuned for performance + already. This cannot be lower than DPAA_ETH_REFILL_THRESHOLD. + +config FSL_DPAA_ETH_REFILL_THRESHOLD + int "Private bpool refill threshold" + range 32 FSL_DPAA_ETH_MAX_BUF_COUNT + default "80" + ---help--- + The DPAA-Ethernet driver will start replenishing buffer pools whose count + falls below this threshold. This must be related to DPAA_ETH_MAX_BUF_COUNT. One needn't normally + modify this value unless one has very specific performance reasons. + config FSL_DPAA_CS_THRESHOLD_1G hex "Egress congestion threshold on 1G ports" range 0x1000 0x10000000 diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 80c3651..2340e71 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -476,7 +476,7 @@ dpa_priv_bp_probe(struct device *dev) return ERR_PTR(-ENOMEM); dpa_bp->percpu_count = devm_alloc_percpu(dev, *dpa_bp->percpu_count); - dpa_bp->target_count = FSL_DPAA_ETH_MAX_BUF_COUNT; + dpa_bp->target_count = CONFIG_FSL_DPAA_ETH_MAX_BUF_COUNT; dpa_bp->seed_cb = dpa_bp_priv_seed; dpa_bp->free_buf_cb = _dpa_bp_free_pf; diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h index 3d286a1..7656c85 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h @@ -126,9 +126,6 @@ struct dpa_buffer_layout_s { #define DPAA_ETH_RX_QUEUES 128 -#define FSL_DPAA_ETH_MAX_BUF_COUNT 128 -#define FSL_DPAA_ETH_REFILL_THRESHOLD 80 - /* More detailed FQ types - used for fine-grained WQ assignments */ enum dpa_fq_type { FQ_TYPE_RX_DEFAULT = 1, /* Rx Default FQs */ diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sg.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sg.c index 1c0bdf0..baa767e 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sg.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sg.c @@ -152,7 +152,7 @@ int dpaa_eth_refill_bpools(struct dpa_bp *dpa_bp, int *countptr) int count = *countptr; int new_bufs; - if (unlikely(count < FSL_DPAA_ETH_REFILL_THRESHOLD)) { + if (unlikely(count < CONFIG_FSL_DPAA_ETH_REFILL_THRESHOLD)) { do { new_bufs = _dpa_bp_add_8_bufs(dpa_bp); if (unlikely(!new_bufs)) { @@ -163,10 +163,10 @@ int dpaa_eth_refill_bpools(struct dpa_bp *dpa_bp, int *countptr) break; } count += new_bufs; - } while (count < FSL_DPAA_ETH_MAX_BUF_COUNT); + } while (count < CONFIG_FSL_DPAA_ETH_MAX_BUF_COUNT); *countptr = count; - if (unlikely(count < FSL_DPAA_ETH_MAX_BUF_COUNT)) + if (unlikely(count < CONFIG_FSL_DPAA_ETH_MAX_BUF_COUNT)) return -ENOMEM; } -- 1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/