Re: [PATCH net-next v3 3/3] Documentation: net: add flow control guide and document ethtool API
From: Oleksij Rempel
Date: Fri Aug 22 2025 - 08:15:12 EST
On Fri, Aug 22, 2025 at 02:35:19PM +0300, Vladimir Oltean wrote:
...
> > +
> > +* **Who uses it**: Any full-duplex link, from 10 Mbit/s to multi-gigabit speeds.
> > +
> > +The MAC (Media Access Controller)
> > +---------------------------------
> > +The MAC is the hardware component that actually sends and receives PAUSE
> > +frames. Its capabilities define the upper limit of what the driver can support.
> > +For link-wide PAUSE, MACs can vary in their support for symmetric (both
> > +directions) or asymmetric (independent TX/RX) flow control.
> > +
> > +For PFC, the MAC must be capable of generating and interpreting the
> > +priority-based PAUSE frames and managing separate pause states for each
> > +traffic class.
> > +
> > +Many MACs also implement automatic PAUSE frame transmission based on the fill
> > +level of their internal RX FIFO. This is typically configured with two
> > +thresholds:
> > +
> > +* **FLOW_ON (High Water Mark)**: When the RX FIFO usage reaches this
> > + threshold, the MAC automatically transmits a PAUSE frame to stop the sender.
> > +
> > +* **FLOW_OFF (Low Water Mark)**: When the RX FIFO usage drops below this
> > + threshold, the MAC transmits a PAUSE frame with a quanta of zero to tell
> > + the sender it can resume transmission.
> > +
> > +The optimal values for these thresholds depend on the link's round-trip-time
> > +(RTT) and the peer's internal processing latency. The high water mark must be
> > +set low enough so that the MAC's RX FIFO does not overflow while waiting for
> > +the peer to react to the PAUSE frame. The driver is responsible for configuring
> > +sensible defaults according to the IEEE specification. User tuning should only
> > +be necessary in special cases, such as on links with unusually long cable
> > +lengths (e.g., long-haul fiber).
>
> How would user tuning be achieved?
Do you mean how such tuning could be exposed to user space (e.g. via
ethtool/sysfs), or rather whether it makes sense to provide a user
interface for this at all, since drivers normally set safe defaults?
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |