Netdev List
 help / color / mirror / Atom feed
From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Kordian Chmielewski <kudzo51@gmail.com>, netdev@vger.kernel.org
Cc: "Florian Fainelli" <f.fainelli@gmail.com>,
	"Jonas Gorski" <jonas.gorski@gmail.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	"David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>
Subject: Re: [PATCH net] net: dsa: bcm_sf2: raise BCM4908 egress queue flow control thresholds
Date: Wed, 2 Dec 2026 21:11:56 -0800	[thread overview]
Message-ID: <3e8ff762-c936-4197-980d-bb6f98816cf9@broadcom.com> (raw)
In-Reply-To: <20261202095725.157121-1-kudzo51@gmail.com>



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 <kudzo51@gmail.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>

> ---
> 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


      reply	other threads:[~2026-12-03  5:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  9:57 [PATCH net] net: dsa: bcm_sf2: raise BCM4908 egress queue flow control thresholds Kordian Chmielewski
2026-12-03  5:11 ` Florian Fainelli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e8ff762-c936-4197-980d-bb6f98816cf9@broadcom.com \
    --to=florian.fainelli@broadcom.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=jonas.gorski@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kudzo51@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=rafal@milecki.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox