From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.227 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796274721; b=lTQU9rmUnShtw8YFizqd8uJnFvbl1qMWjz/3aylAmEpUdKoojcSRFKmd0YVDoZf3gVcn 4PuJByAeITA0Z12ZtcdTIgZdoP3bW0yoH4OgfUKaxqNqAadA23pEQX0YmjSDrTs7LUsyx 85rf7wNyOLTto//47YRViOYju4Of2Rizyozt9LPVZtYb3IFMw/yzfEtl+KTLWTcGZEoOU 7t4JvsU+/Pps757uAgfRZIL6+dKYOxgwAuobA2VaVf3GCAQC0cuziGl+0QOdlMuEN0fUz x9aawkBKYMvs///q5vQ5Kh6w4yiT3CWbxorm+RsFuX5Sl1feGaxbm6xEJVI3DvQTHqw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796274721; h=DMARC-Filter:Received:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:X-Relaying-Domain: X-CFilter-Loop:Received:DKIM-Signature:X-Forwarded-Encrypted: X-Received:X-Received:Received:Message-ID:Date:MIME-Version: User-Agent:Subject:To:Cc:References:Content-Language:From:Autocrypt: In-Reply-To:Content-Type:Content-Transfer-Encoding: X-DetectorID-Processed; bh=OYrM39W7bCNhSb1I2095w/W9YRn1a6QB4uEedHMNaag=; b=4RNMy3PGkurbdinI2k3zdAb0ToS5xL9eu23EQkFcrj8IoNHymfbCkSDL8rRfSlC8Hz09 VznvfKqC1jCT4lWhcA+9+HP4ojpBqt+Fk2WYBisIJrMRcJSouwZJE/tE8PR0JYdA8Ex36 6eFKiops2qFve9HZaC3NVFatPObfl3EvnN5KHBFGttKFIGAzHjUv+el3693/ygHcxS3q0 Ivq4JDO3qArQxp42pZxnT+JaUVwMK2nrSIuGEHtI2ZG4TD4CaKJ6ivhaJsFGRrIw7FyKa VMcdyswaCDPNOAQRaVRT85N/2hfA3ubHasYHfS3pdSlcjmV3hqFiup2dlbYi1uxpf4A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=Fauagh6B; arc=none smtp.remote-ip=209.85.214.227 Received: from mail-pl1-f227.google.com (mail-pl1-f227.google.com [209.85.214.227]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9B0A606A322 for ; Thu, 3 Dec 2026 05:12:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E9B0A606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=Fauagh6B Received: by mail-pl1-f227.google.com with SMTP id d9443c01a7336-2f04e3bf46dso104560505ad.2 for ; Wed, 02 Dec 2026 21:12:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796274720; x=1796879520; h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=OYrM39W7bCNhSb1I2095w/W9YRn1a6QB4uEedHMNaag=; b=1ZcuWs2MC0Lezuod1KijkhV11ywv2mm1xXBvAuWsgP0KcaPFBjzJjKd5L6RJqITJgt LkEsAK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Y5MIwEPwTKgbP8SvjIEX6iVblSPIHRxvc4ttdvRcJUvjfaTTGW8IXcPWJKztp GSmDx0IPMvD0N+ZpUH+N50q/Nagvo50oF7ZoUtSHNzaMY= X-Received: by 2002:a17:90b:3b52:b0:3b3:b9e4:e3f5 with SMTP id 98e67ed59e1d1-3b41c92a524mr41660303a91.30.1796274720098; Wed, 02 Dec 2026 21:12:00 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-123.dlp.protect.broadcom.com. [144.49.247.123]) by smtp-relay.gmail.com with ESMTPS id 98e67ed59e1d1-3b5c7bbd83csm979676a91.6.2026.12.02.21.11.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Dec 2026 21:12:00 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-386ad819860so12886252eec.0 for ; Wed, 02 Dec 2026 21:11:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1796274718; x=1796879518; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=OYrM39W7bCNhSb1I2095w/W9YRn1a6QB4uEedHMNaag=; b=Fauagh6BwmyGmOnbhVQr0mPjDEsSYqBKI8vt0CVZboENvYwMj98tOCRx+m936LLQk+ hAp1gHYOwThgIfRXlIN2cZH3rad3yD2jJ4xUNrMhlYuPe+iThvs2EYB5lxbqoXlhYO/1 G9vlntpjZ2hJXbCRbQ8BW0R1Th/NlHaXeVL2c= X-Forwarded-Encrypted: i=1; AL+hErEh6UKk8vipJz3CQDVuC3c4POBsqAWALDB6bWeJQVH38DW6pjcwYwxYSgWCg0/ferhkeR216vo=@vger.kernel.org X-Received: by 2002:a05:693c:80ce:b0:36a:12c1:3adb with SMTP id 5a478bee46e88-3856f254a24mr43760709eec.20.1796274718369; Wed, 02 Dec 2026 21:11:58 -0800 (PST) X-Received: by 2002:a05:693c:80ce:b0:36a:12c1:3adb with SMTP id 5a478bee46e88-3856f254a24mr43760681eec.20.1796274717742; Wed, 02 Dec 2026 21:11:57 -0800 (PST) Received: from [192.168.10.3] (ip70-187-214-22.oc.oc.cox.net. [70.187.214.22]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386b9bdafb5sm91152125eec.9.2026.12.02.21.11.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 21:11:57 -0800 (PST) Message-ID: <3e8ff762-c936-4197-980d-bb6f98816cf9@broadcom.com> Date: Wed, 2 Dec 2026 21:11:56 -0800 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net] net: dsa: bcm_sf2: raise BCM4908 egress queue flow control thresholds To: Kordian Chmielewski , netdev@vger.kernel.org Cc: Florian Fainelli , Jonas Gorski , Andrew Lunn , Vladimir Oltean , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni References: <20261202095725.157121-1-kudzo51@gmail.com> Content-Language: en-US From: Florian Fainelli Autocrypt: addr=florian.fainelli@broadcom.com; keydata= xsBNBFPAG8ABCAC3EO02urEwipgbUNJ1r6oI2Vr/+uE389lSEShN2PmL3MVnzhViSAtrYxeT M0Txqn1tOWoIc4QUl6Ggqf5KP6FoRkCrgMMTnUAINsINYXK+3OLe7HjP10h2jDRX4Ajs4Ghs JrZOBru6rH0YrgAhr6O5gG7NE1jhly+EsOa2MpwOiXO4DE/YKZGuVe6Bh87WqmILs9KvnNrQ PcycQnYKTVpqE95d4M824M5cuRB6D1GrYovCsjA9uxo22kPdOoQRAu5g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g8IN0qXxzLQsmz6tbgLMEHYBGx80bBF8AkdThd6SLhreCN7Uh IR/5NXGqotAZao2xlDpJLuOMQtoH9WVNuuxQQZHVd8if+yp6yRJ5DAmIUt5CCPcAEQEAAcLB gQQYAQIBKwUCU8AbwgUbDAAAAMBdIAQZAQgABgUCU8AbwQAKCRCTYAaomC8PVQ0VCACWk3n+ obFABEp5Rg6Qvspi9kWXcwCcfZV41OIYWhXMoc57ssjCand5noZi8bKg0bxw4qsg+9cNgZ3P N/DFWcNKcAT3Z2/4fTnJqdJS//YcEhlr8uGs+ZWFcqAPbteFCM4dGDRruo69IrHfyyQGx16s CcFlrN8vD066RKevFepb/ml7eYEdN5SRALyEdQMKeCSf3mectdoECEqdF/MWpfWIYQ1hEfdm C2Kztm+h3Nkt9ZQLqc3wsPJZmbD9T0c9Rphfypgw/SfTf2/CHoYVkKqwUIzI59itl5Lze+R5 wDByhWHx2Ud2R7SudmT9XK1e0x7W7a5z11Q6vrzuED5nQvkhAAoJEIExtcQpvGagugcIAJd5 EYe6KM6Y6RvI6TvHp+QgbU5dxvjqSiSvam0Ms3QrLidCtantcGT2Wz/2PlbZqkoJxMQc40rb fXa4xQSvJYj0GWpadrDJUvUu3LEsunDCxdWrmbmwGRKqZraV2oG7YEddmDqOe0Xm/NxeSobc MIlnaE6V0U8f5zNHB7Y46yJjjYT/Ds1TJo3pvwevDWPvv6rdBeV07D9s43frUS6xYd1uFxHC 7dZYWJjZmyUf5evr1W1gCgwLXG0PEi9n3qmz1lelQ8lSocmvxBKtMbX/OKhAfuP/iIwnTsww 95A2SaPiQZA51NywV8OFgsN0ITl2PlZ4Tp9hHERDe6nQCsNI/Us= In-Reply-To: <20261202095725.157121-1-kudzo51@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e On 12/2/2026 1:57 AM, Kordian Chmielewski wrote: > bcm_sf2_port_setup() writes a pause threshold of 32 pages to > CORE_TXQ_THD_PAUSE_QN_PORT(port). On the BCM4908 switch these registers > of flow control page 0x0B hold per egress queue thresholds that all ports > share, so the write for each user port lands on the queue with the same > number. On a TP-Link Archer AX6000 v1, whose user ports are 0-3 and 7, > the switch reads back 32 pages for queues 0-3 and 7, and queue 0 carries > the traffic to the CPU. The frames that the CPU sends are accounted in > another set of thresholds, page 0x0D, which the driver does not touch > (pause thresholds of 199-255 pages there). > > The switch runs in TX based flow control mode (PAUSE_DROP_CTRL, page > 0x0A register 0x1C, reads 0x0fd9), and the WAN port, whose link came up > with flow control off, loses frames at ingress once their egress queue > is over its pause threshold. Measured on that router with iperf3, with > the thresholds changed at run time: > > - a 2.5G host on the WAN port sending to the router, 4 TCP streams for > 15 s: queue 0 peaked at 40 pages and the router received 1386 Mbit/s. > With the thresholds below, queue 0 peaked at 802 pages and the router > received 1877 and 1876 Mbit/s in two runs, with about as many TCP > retransmissions as before (15016 and 14177, against 16921). With only > queue 0 changed, pause levels of 199 and 400 pages gave 1824 to 1871 > Mbit/s and levels from 700 to 1000 pages all gave 1875 to 1877 Mbit/s, > while a hysteresis far below the pause level multiplied the > retransmissions (35474 at 1000/500 pages, 10164 at 1000/968). > > - a Wi-Fi client sending through the router to a host on a 1G LAN port, > 4 TCP streams for 15 s: with page 0x0D at its defaults, the busiest > queues of that port peaked within 5 pages of their page 0x0D pause > thresholds and the host received 377 and 540 Mbit/s in two runs. With > page 0x0D at 800 pages, those queues went up to 804 pages and the host > received 668 to 725 Mbit/s in four runs. > > The router ran OpenWrt with Linux 6.12 and changes that are not in > mainline: for the WAN port, the 2.5G PHY behind it and the SerDes > between them, for the Wi-Fi chip, and for bcm4908_enet, among them > earlier versions of most of its fixes now in net. Not sure if we need this paragraph in the commit message, it does and will respond to Sashiko I presume? > > On BCM4908, skip the 32-page write and program both pages: every egress > queue pauses at 800 pages and all queues together at 1300, below the > total drop thresholds of 1423-1527 pages, and each resumes 32 pages > lower. The drop thresholds keep their defaults. > > Fixes: 73b7a6047971 ("net: dsa: bcm_sf2: support BCM4908's integrated switch") > Signed-off-by: Kordian Chmielewski Reviewed-by: Florian Fainelli > --- > Tested again on an Archer AX6000 v1 with OpenWrt, Linux 6.18.55 and > this version of the patch, with a device tree that has no WAN port and > no Wi-Fi yet, so the runs above could not be repeated: after boot the > switch reads back 800/768 pages for every queue and 1300/1268 for the > totals on both pages, with the drop thresholds at their defaults, and > TCP between the router and a host on a 1G LAN port ran at 941 Mbit/s in > both directions. This is broadly correct, just a few minor nits in case Sashiko has something to say and requires you to resubmit: - ideally we should read the amount of pages from the mmu mem sel strap (128KB = 512 pages, 384KB = 1536 pages) but IIRC 4908 is always going to be strapped for 384KB - the total ranges differ from the spec, which lists the defaults to 0x5C7 but the commit says 1479, probably another 409 specific difference -- Florian