Thread (7 messages) 7 messages, 4 authors, 23d ago

RE: Ethtool : PRBS feature

From: Das, Shubham <hidden>
Date: 2026-07-01 17:10:56

Possibly related (same subject, not in this thread)

Sorry, but i could not implement that, in a sensible way, given its current
specification.

I suppose i could simply flip the first `inject-error-count` bits, and make the rest of
the stream perfect? I could also wait until the stop command is received, and
then flip that many bits before i stop the stream? But none of these seem
sensible.

Please make this specification have sufficient details, or references to 802.3, that
you could give it to another engineer and get back a reasonable implementation,
without having to answer any questions.
Andrew,

IEEE has clear documentation of the PRBS Receiver block and the BER counter as an output.
Before performing the actual BER validation, it is a usual industry practice to introduce errors
to guarantee that the checker is functional and accurately identifying them.

Similarly, in DATA mode, error injection is used to verify the FEC block
by ensuring that injected errors are detected and corrected as expected.

Updated description.

+        name: inject-error-count
+        type: u32
+        doc: |
+          Request the PHY to inject exactly this many bit errors into the
+          currently active test data stream.
+
+          This is a diagnostic tool used to validate that the far-end PRBS
+          checker or FEC decoder is functioning correctly. For example,
+          after enabling a PRBS pattern and confirming ber-lock-status is
+          locked, injecting N errors should cause ber-error-count to
+          increment by exactly N on the receiving port, confirming the
+          checker is actively detecting bit errors. Similarly, in normal
+          data mode with FEC enabled, injecting errors verifies that the
+          FEC block detects errors as expected.
quoted
+      name: phy-test-act
+      doc: |
+        Configure PHY test parameters. Each attribute is optional and only
+        specified attributes are applied. TX/RX patterns are set on the
+        local port. BERT and error injection operate on the receiver port.
Error injection operates on the receive port? That is not what i expected. I should
go read 802.3, and understand how this is used.
Thanks for the correction, it is in transmit direction, Updated description.

+      name: phy-test-act
+      doc: |
+        Configure PHY test parameters. Each attribute is optional and only
+        specified attributes are applied. TX/RX patterns are set on the
+        local port. BERT operates on the receiver port, while errors
+        are injected through the PRBS/DATA transmission port. 
+        When bert-action is stats, a reply with BERT counters is returned.
+        Typical workflow:
+          ethtool --phy-test eth1 tx-pattern prbs7  (TX side)
+          ethtool --phy-test eth2 rx-pattern prbs7  (RX side)
+          ethtool --phy-test eth2 bert start        (start BERT on RX)
+          ethtool --phy-test eth2 bert stats        (read counters)
+          ethtool --phy-test eth2 bert stop         (stop BERT)

- Shubham D

-----Original Message-----
From: Andrew Lunn <andrew@lunn.ch>
Sent: 29 June 2026 22:27
To: Das, Shubham <redacted>
Cc: Alexander Duyck <redacted>; Lee Trager <redacted>;
Maxime Chevallier [off-list ref]; netdev@vger.kernel.org;
mkubecek@suse.cz; D H, Siddaraju [off-list ref]; Chintalapalle,
Balaji [off-list ref]; Lindberg, Magnus
[off-list ref]; niklas.damberg@ericsson.com
Subject: Re: Ethtool : PRBS feature
quoted
+        name: inject-error-count
+        type: u32
+        doc: |
+          Number of errors to inject. Each invocation injects the specified
+          number of bit errors into the data stream.
Sorry, but i could not implement that, in a sensible way, given its current
specification.

I suppose i could simply flip the first `inject-error-count` bits, and make the rest of
the stream perfect? I could also wait until the stop command is received, and
then flip that many bits before i stop the stream? But none of these seem
sensible.

Please make this specification have sufficient details, or references to 802.3, that
you could give it to another engineer and get back a reasonable implementation,
without having to answer any questions.
quoted
+      name: phy-test-act
+      doc: |
+        Configure PHY test parameters. Each attribute is optional and only
+        specified attributes are applied. TX/RX patterns are set on the
+        local port. BERT and error injection operate on the receiver port.
Error injection operates on the receive port? That is not what i expected. I should
go read 802.3, and understand how this is used.

	Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help