Re: [PATCH net-next] Documentation: networking: Add a test plan for ethtool pause validation

From: Andrew Lunn

Date: Tue May 26 2026 - 23:13:53 EST


> + These are used to allow the PHY do know what Pause settings the MAC supports, in

s/do/to/

> +Similarly, the link partner can advertise its capabilities through the same
> +bits. These parameters are exchanged through the negotiation process, but can
> +also be enforced locally by disabling **pause autoneg**, thus ignoring the
> +link partner's capabilities.
> +
> +The local resolution of the pause configuration after receiving the link-partner
> +abilities is done according to the following table, from 802.3 Annex 28B.3 :
> +
> ++-------------+--------------+--------------------------+
> +|Local device | Link partner | Pause settings resolution|
> ++------+------+-------+------+-----------+--------------+
> +|Pause | Asym | Pause | Asym | RX | TX |
> ++======+======+=======+======+===========+==============+
> +| 0 | 0 | Any | Any | No | No |
> ++------+------+-------+------+-----------+--------------+
> +| 0 | 1 | 0 | Any | No | No |
> ++------+------+-------+------+-----------+--------------+
> +| 0 | 1 | 1 | 0 | No | No |
> ++------+------+-------+------+-----------+--------------+
> +| 0 | 1 | 1 | 1 | No | Yes |
> ++------+------+-------+------+-----------+--------------+
> +| 1 | 0 | 0 | Any | No | No |
> ++------+------+-------+------+-----------+--------------+
> +| 1 | Any | 1 | Any | Yes | Yes |
> ++------+------+-------+------+-----------+--------------+
> +| 1 | 1 | 0 | 0 | No | No |
> ++------+------+-------+------+-----------+--------------+
> +| 1 | 1 | 0 | 1 | Yes | No |
> ++------+------+-------+------+-----------+--------------+
> +
> +The currently configured and advertised settings can be queried with ::
> +
> + ethtool <iface>
> +
> + Settings for eth0:
> + ...
> + Supported pause frame use: Symmetric Receive-only
> + ...
> + Advertised pause frame use: Symmetric Receive-only
> + ...
> + Link partner advertised pause frame use: Symmetric Receive-only

> +A : Standalone driver testing
> +=============================
> +
> +Requirements : The interface under test must be connected to a link-partner whose
> +interface is admin-up. We don't require the link-partner to be configured in any
> +other specific manner for these tests.
> +
> +A.1 : Sanity Checks
> +~~~~~~~~~~~~~~~~~~~
> +
> +Pause autoneg is set to off::
> +
> + ethtool -A <iface> autoneg off
> +
> +The 'supported' fields retrieved using the ETHTOOL_MSG_LINKMODES_GET includes
> +a "Pause" bit and an "Asym" bit.
> +
> +The ETHTOOL_MSG_PAUSE_GET command returns the currently configured pause modes
> +in the "tx" and "rx" attributes.
> +
> +These parameters must validate against the following truth table :
> +
> + +--------------+-----------------+
> + | linkmodes | pauseparam |
> + +-------+------+--------+--------+
> + | Pause | Asym | rx | tx |
> + +=======+======+========+========+
> + | 0 | 0 | 0 | 0 |
> + +-------+------+--------+--------+
> + | 0 | 1 | 0 | 0 or 1 |
> + +-------+------+--------+--------+
> + | 1 | 0 | rx == tx |
> + +-------+------+--------+--------+
> + | 1 | 1 | 0 or 1 | 0 or 1 |
> + +-------+------+--------+--------+

I think we need more sanity checks here, in order to know if the tests
that follow can be run.

If ETHTOOL_MSG_PAUSE_GET returns -EOPNOTSUPP, it is not a test error,
but all the following tests using forced pause should be skipped,
since it indicates forced pause is not supported.

When pause autoneg is on, and LP values are not reported, we probably
want a warning. I don't think we can say it is an error to report
local values but not LP values. There is probably firmware
implementations which don't make it available to user space. But we
should discourage such behaviour with a warning. And some of the tests
which follow will need to be skipped.

I would suggest looking through the tests and making a list of things
which must be implemented in order to actually perform the test. If
something is missing and returns -EOPNOTSUPP, we need to skip the
test.


> +
> +Test scenario
> +-------------
> +
> +Following the reported value from::
> +
> + ethtool <iface>
> + Settings for <iface>:
> + ...
> + Supported pause frame use: <value>
> +
> +Iterate over all the 4 combinations of rx and tx pause parameters::
> +
> + ethtool -A <iface> autoneg off rx <rx_val> tx <tx_val>
> +
> +The settings must be accepted or rejected, according to the above truth table.

-EOPNOTSUPP should also be consider a pass. Other codes should be a
fail.

Sorry, out of time now, i will continue later.

Andrew