Re: [PATCH net 2/3] amd-xgbe: prevent CRC errors during RX adaptation with AN disabled
From: Maxime Chevallier
Date: Wed Mar 04 2026 - 08:46:55 EST
Hi Raju,
On 04/03/2026 13:23, Raju Rangoju wrote:
> When operating in 10GBASE-KR mode with auto-negotiation disabled and RX
> adaptation enabled, CRC errors can occur during the RX adaptation
> process. This happens because the driver continues transmitting and
> receiving packets while adaptation is in progress.
>
> Fix this by stopping TX/RX immediately when the link goes down and RX
> adaptation needs to be re-triggered, and only re-enabling TX/RX after
> adaptation completes and the link is confirmed up. Introduce a flag to
> track whether TX/RX was disabled for adaptation so it can be restored
> correctly.
>
> This prevents packets from being transmitted or received during the RX
> adaptation window and avoids CRC errors from corrupted frames.
>
> Fixes: 4f3b20bfbb75 ("amd-xgbe: add support for rx-adaptation")
> Signed-off-by: Raju Rangoju <Raju.Rangoju@xxxxxxx>
Small nit on my side :
[...]
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h
> index 4333d269ee84..75c021b38a28 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe.h
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe.h
> @@ -1266,6 +1266,10 @@ struct xgbe_prv_data {
> bool en_rx_adap;
> int rx_adapt_retries;
> bool rx_adapt_done;
> + /* Flag to track if data path (TX/RX) was stopped for RX adaptation.
> + * This prevents packet corruption during the adaptation window.
> + */
> + unsigned int rx_adapt_data_path_stopped;
This is only ever set as true/false, maybe make it a bool ?
> bool mode_set;
> bool sph;
> };
Maxime