Skip to content

Commit 7bd80ed

Browse files
oleremPaolo Abeni
authored andcommitted
Documentation: net: add flow control guide and document ethtool API
Introduce a new document, flow_control.rst, to provide a comprehensive guide on Ethernet Flow Control in Linux. The guide explains how flow control works, how autonegotiation resolves pause capabilities, and how to configure it using ethtool and Netlink. In parallel, document the pause and pause-stat attributes in the ethtool.yaml netlink spec. This enables the ynl tool to generate kernel-doc comments for the corresponding enums in the UAPI header, making the C interface self-documenting. Finally, replace the legacy flow control section in phy.rst with a reference to the new document and add pointers in the relevant C source files. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://patch.msgid.link/20250924120241.724850-1-o.rempel@pengutronix.de Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent c5cb31c commit 7bd80ed

8 files changed

Lines changed: 453 additions & 15 deletions

File tree

Documentation/netlink/specs/ethtool.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,9 @@ attribute-sets:
864864

865865
-
866866
name: pause-stat
867+
doc: Statistics counters for link-wide PAUSE frames (IEEE 802.3 Annex 31B).
867868
attr-cnt-name: __ethtool-a-pause-stat-cnt
869+
enum-name: ethtool-a-pause-stat
868870
attributes:
869871
-
870872
name: unspec
@@ -875,13 +877,17 @@ attribute-sets:
875877
type: pad
876878
-
877879
name: tx-frames
880+
doc: Number of PAUSE frames transmitted.
878881
type: u64
879882
-
880883
name: rx-frames
884+
doc: Number of PAUSE frames received.
881885
type: u64
882886
-
883887
name: pause
888+
doc: Parameters for link-wide PAUSE (IEEE 802.3 Annex 31B).
884889
attr-cnt-name: __ethtool-a-pause-cnt
890+
enum-name: ethtool-a-pause
885891
attributes:
886892
-
887893
name: unspec
@@ -893,19 +899,40 @@ attribute-sets:
893899
nested-attributes: header
894900
-
895901
name: autoneg
902+
doc: |
903+
Acts as a mode selector for the driver.
904+
On GET: indicates the driver's behavior. If true, the driver will
905+
respect the negotiated outcome; if false, the driver will use a
906+
forced configuration.
907+
On SET: if true, the driver configures the PHY's advertisement based
908+
on the rx and tx attributes. If false, the driver forces the MAC
909+
into the state defined by the rx and tx attributes.
896910
type: u8
897911
-
898912
name: rx
913+
doc: |
914+
Enable receiving PAUSE frames (pausing local TX).
915+
On GET: reflects the currently preferred configuration state.
899916
type: u8
900917
-
901918
name: tx
919+
doc: |
920+
Enable transmitting PAUSE frames (pausing peer TX).
921+
On GET: reflects the currently preferred configuration state.
902922
type: u8
903923
-
904924
name: stats
925+
doc: |
926+
Contains the pause statistics counters. The source of these
927+
statistics is determined by stats-src.
905928
type: nest
906929
nested-attributes: pause-stat
907930
-
908931
name: stats-src
932+
doc: |
933+
Selects the source of the MAC statistics, values from
934+
enum ethtool_mac_stats_src. This allows requesting statistics
935+
from the individual components of the MAC Merge layer.
909936
type: u32
910937
-
911938
name: eee

0 commit comments

Comments
 (0)