From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6AE436CE0B for ; Wed, 4 Mar 2026 13:40:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772631643; cv=none; b=M/V/KCLhzFukNCylgcUgoa5p0ifSbY64QiwOe19TBeBF9CXSsPIREopMVvqcHQ/kUBxAtjZfAApV/b3k71jenJcZ11rjC4myMaM96Tt+u7HUV8LqGLB1sOy8VdmQUqEFby/auSkYrYL0Ycpw7P5/l7U1BFKjCiebIBDOKnOcs68= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772631643; c=relaxed/simple; bh=M3L6PJl832x3WfzQnsuTQ35CN1Iuu4WS8z/YiFVWNIk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SFkQt5VjQf3V1bG/yCLT2Iz2xPVP9KysZnhwefPGGIbU4tMdI0Ba7s2ByYTTAhaFtdbX8hW1+3y507bf/TvdHfSEAPpkWqCS6nw3jRTlKt6vJy7yc06S1JOYWQrsFze/gDhAZwLEqi6BvfmL3G9wmZLR+P4zCOqvogl9O1MTD0E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Vn118Ggo; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Vn118Ggo" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 6EEB31A2109; Wed, 4 Mar 2026 13:40:38 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 3F0205FF5C; Wed, 4 Mar 2026 13:40:38 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7079E103695C1; Wed, 4 Mar 2026 14:40:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1772631637; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=qz60AARpWD1sB++xNj24Xpr0iuf312nxadvUtUC3rJg=; b=Vn118GgoGSZz1GylG+UdJIQGQ4df9EqLS2TKom3wzm9J74F5UctRwcQUc6ZygU0ej9PEPP zRpPr/azw25GCGk+cPfm6FQGPD6Ep3kJm0AgnURo/z5JiB7rQh7ctKPKZ2WypgQPiYRIFY /RIs4JFBFLrfoQEAYP+C3nIEmFqPMQVOXtHmQo7BDO8lvFXGd45faW6R4Y9cGSakKwbXof 64LIt+IAf1fzFYf47eKE3jPjelFX4mX+/90m3JZxS4qlwyZVX4x7NE+dBzyS0p3nGbgxIf qCM0AvVBvWwYig1baDtLTodWiRI+M+rObs90OpjvxI3vCvfFe0Rrne9Dboyjzw== Message-ID: <5826cc04-10c6-45f5-a39c-6fe56bc671dd@bootlin.com> Date: Wed, 4 Mar 2026 14:40:33 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net 2/3] amd-xgbe: prevent CRC errors during RX adaptation with AN disabled To: Raju Rangoju , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, pabeni@redhat.com, kuba@kernel.org, edumazet@google.com, davem@davemloft.net, andrew+netdev@lunn.ch, horms@kernel.org, Shyam-sundar.S-k@amd.com References: <20260304122305.812541-1-Raju.Rangoju@amd.com> <20260304122305.812541-3-Raju.Rangoju@amd.com> From: Maxime Chevallier Content-Language: en-US In-Reply-To: <20260304122305.812541-3-Raju.Rangoju@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 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 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