The MAC sends a pause frame only when its buffer-manager port asks for one,
and the driver leaves flow control off on every physical BM port, so a link
that negotiates TX pause never sends one. Set the BM port's flow control
from tx_pause in mac_link_up, as qca-ssdk does in
adpt_hppe_port_txfc_status_set().
While any port, class or the CPU port carries a shaper, no BM port asks
for pause: a port that pauses moves the shaper's queue into the device on
the other end, where SQM cannot reach it. With a 165 Mbit/s upload shaper
and a Windows client, ping under load rose by 64 to 92 ms with pause and
by 2 ms without.
On IPQ8074, with TX pause on lan2 and UDP from a lan2 host to a 100 Mbit/s
lan3 link, the sender receives every pause frame the router sends and is
throttled to the egress rate without drops; with BM flow control off no
pause frame is sent and the egress queue drops.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>