Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965620AbbGVQeB (ORCPT ); Wed, 22 Jul 2015 12:34:01 -0400 Received: from mail-bn1on0111.outbound.protection.outlook.com ([157.56.110.111]:42337 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965435AbbGVQd6 (ORCPT ); Wed, 22 Jul 2015 12:33:58 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; From: Madalin Bucur To: CC: , , , , , , , , Madalin Bucur Subject: [PATCH 03/10] dpaa_eth: add configurable bpool thresholds Date: Wed, 22 Jul 2015 19:16:39 +0300 Message-ID: <1437581806-17420-3-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1437581806-17420-2-git-send-email-madalin.bucur@freescale.com> References: <1437581806-17420-1-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-2-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD028;1:fom1iV4II1BQV0WLroAeFqfxOKv+5D2NTQabnV0hq3p2qnPFI72M2iiRhV92s5pzxLklmEW1LSC1h+Vs1s8QF5lG66ezaP3SUhT3HFOmz1L7+YXiIUIorfR7k2iLQ0UJqFAQUD15hgyO+0aa/oGu6BQi32sv/SF9zlKbwSp3mRpSreBrkw1WKIBVNV6/YlqWrb2O73Ot7ZgWo6Yay+TgVMofEHxBN9jzZ6KYBky123TND9dn2qD1xRXfBdSaZw3h+JUg+FIUfbR+BlqfwNwJAy88xSihKkaryGDwIh+kDdbYj6hR+NfGflluXjWHcwecuJe0uANygOf+ts/Oz7YFPw== X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(105606002)(50986999)(53806999)(76176999)(77156002)(86362001)(62966003)(77096005)(106466001)(50226001)(19580395003)(104016003)(47776003)(575784001)(33646002)(87936001)(85426001)(46102003)(2950100001)(107886002)(5001960100002)(229853001)(50466002)(6806004)(2351001)(5003940100001)(48376002)(19580405001)(49486002)(43066003)(36756003)(189998001)(110136002)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BN3PR03MB1480;H:az84smr01.freescale.net;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1480;2:b9dcxAvPlGbGMxBo3WYcjmHLoRHu3QKUiwG1fepySKzSgv21HLCl48f4LEkJ6dzu;3:ItENQrlkb7yBEayqDKX8Wcm1PzaKml1yUu3TR1NgiDKzb58O+grXHfFVz+qJJZBcoy8iJcwsaxHyUdGLUjMxTvMFwikxe+jOqAGUnC0dv8jBj2L6ClQEIwfPKAVQuen74LH+NS8225dgWWNEvNugCtrBN/krvQl9rueTu/bKa1mEVJm6oWc0qXk+hVbPoTinsiMLUIrYZE1poNtVLY2LejDNvw6duHZXa8TOmCQhfLM=;25:XM2mk4BdeRra1WBffUJ9vl3qhoJc8sGwuXMh+irrZqv3+JTfJKYJuU+Xrbe7wjIa/VC6muaIWiTdmUwTT46ahNn4uND+7ik9xvMRXYZXGARL4Ut6JA7HIPkZ88WyXOQl0dK4691BvKGUHe9aRq6ElR0BGEn8g6qXzfi8poYuf8AT3vQysc8QRoLF4i/Pd4TkvndD6lvKX8mFzEsTDiQ8ZLS+vDgfxb8xqMxzALCiHTS1YMLrCetVMz1qFBAq3C+TFyCShyby2csQwL+dbbnAFA==;20:g5nt5hwYfdmKzHYTVPNZu8e2rhawxUypMGlEyZOHfjdRqWCI+gA9VWkEjr6GHHOPNbvW131X9aXSXkgy5T8l0q8QbhFDqYOPSeHLKs/8ay4jP7NqfYdxSYOeIHLVRuZqRJattpkC0n43BbLK40d7pNIxTl3NzylsTKpeCfzgZ4W4sEk/KAtw/+ptA4QBr8rnwM5OdAO5PXqY3H0Qf6KEvT+8gBF0nPmVKoNn4tQJ/NuJAa0GnbXQ06FEsH+asdawNNiiHaRxz8eL5UZKqcqyjhI82/SIRoJFLjyHE0vXPZEak9Ivfh4GqLXPRiDYiuZ+NHsGjz3CE9S+QzkVSDvOWrB9nyUObHeJKWJTTk/EkVU= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1480; BN3PR03MB1480: X-MS-Exchange-Organization-RulesExecuted 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:BN3PR03MB1480;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1480; X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1480;4:l+MrfJOBC+EEj6Vf8gzYQIXEKyttWXvi1xd/SqbfW+rffB17GlYidxa+CTjCzSoY2F4wvmPiLvjcYhSrSuNwTRk5kAwcFIafYOGbQndJofxOYtKRA2vuFCm4Fajlm7DvcUyfGJLUCGyLkZRzLOeSDp8Y4MxlR3g2CMDEFRahQKdNMNQtFbe2+Ouh3HhSEHG6R9NqbarCFA9bqWEkms/Qto8VSQixQ5JSVzpYy1lGlfCZI5HO/rnOqB7d07WmZofuGfDpSHna2LX0MfZ5hQ8HtUeVCwqA/roFo9jIkvdRZWA= X-Forefront-PRVS: 0645BEB7AA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN3PR03MB1480;23:bPwUBD4nSGDxp7O8M0ly+39Gq66VUyBK5U9Y06pJX?= =?us-ascii?Q?pgOiDrvWmCci3Ebarky8f8Rmr8RnHQJ0vmU7eEY6tZ/LqVDhbiC19WBDgOOM?= =?us-ascii?Q?05ZrMICeeXeWCmccMpG4J2sWS3Giwm1mHUyNmGG+rmmjssT4KpLcohm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gC7D1gmikbDRhw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1480;5:j5JMzafkRwArIfscQHutXW8pt/p8Xmk33nDW9MvcoVowkiEgLjYCHBzNlreRmjCcuvLFi/p/ToVyrZQVJunjlEUNIfohzq0A3OrkKMFCDukdUFG6Unyh7r1vrvzopRQAan4ED5k2Nt67IAwTU70KFQ==;24:ye61vLI8oZkuFqTzQPOeUBn9+s7TNiecf9Pz2C31jc4SSKGRcFCVULlvAObIWYu9urvN2NGZpspXRXwLOCZZ16pt2Xp2O+G30W/8V886Y1o=;20:XF+NTLYF/6U0mMRNulqj33blX05j6OjMFtgSts5TXJUjxxuJPDyGGjTNuGNoUFAtRDQtLKNWJ6dMmZ3NvBDLCw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2015 16:18:06.5328 (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.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1480 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 500d0e3..fc2071e 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -475,7 +475,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 08c1b01..fc6c5dc 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 b865d2a..d781219 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sg.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sg.c @@ -151,7 +151,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)) { @@ -162,10 +162,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/