From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F458CCF9F8 for ; Fri, 7 Nov 2025 09:04:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vHIO4-00025m-9j; Fri, 07 Nov 2025 04:04:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vHIO2-00025I-DR; Fri, 07 Nov 2025 04:04:02 -0500 Received: from m.syntacore.com ([178.249.69.228]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vHIO0-0007ld-O4; Fri, 07 Nov 2025 04:04:02 -0500 Received: from MRN-SC-KSMG-01.corp.syntacore.com (localhost [127.0.0.1]) by m.syntacore.com (Postfix) with ESMTP id 2068B1A0003; Fri, 7 Nov 2025 09:03:57 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 m.syntacore.com 2068B1A0003 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=syntacore.com; s=m; t=1762506237; bh=AK7xB5Y/yPhO4FGOBbeUDBXhCsU7iDNfgllIVaiAISs=; h=Message-ID:Subject:From:To:Date:Content-Type:MIME-Version:From; b=YhLEQ8bOUkRfJr+Bthjv7fPCnUfjSiVoPn8SlNIq2bPqH+OfyzZFhBuXLho2JMezu 98w4VZ99W2oFJIN7eRvdcVO279Ix21QAADDRdJbTwYElKvcdGFBfJkjaqBOB2oui0X /M6clDYgKX4o6M9YFEjhx5kr8zX+PRIBkmVy4fBom93pX5gC4XXKrqRW/36ZbquG/e oJmdZZpqOsMNRkMeq/0aNy9Rl17+We3ri93p33GVbM0tcSqkPlsmNhDcqeGyeJHOwI WDips0HxttvDZfYSKF7C9ZBCoROdOeJFUyDXvBJ+4WOr8V+zNVbbpjoDPxLhW+uuDi g7rLJQ0EodDlQ== Received: from S-SC-EXCH-01.corp.syntacore.com (exchange.syntacore.com [10.76.202.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by m.syntacore.com (Postfix) with ESMTPS; Fri, 7 Nov 2025 09:03:56 +0000 (UTC) Received: from [172.27.13.83] (172.27.13.83) by S-SC-EXCH-01.corp.syntacore.com (10.76.202.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Fri, 7 Nov 2025 12:03:54 +0300 Message-ID: Subject: Re: [PATCH] Revert "hw/net: Fix the transmission return size" From: Ilya Repko To: "Edgar E. Iglesias" , CC: Alistair Francis , Peter Maydell , Jason Wang , "open list:Xilinx Zynq" , "open list:All patches CC here" Date: Fri, 7 Nov 2025 12:03:23 +0300 In-Reply-To: References: <20251106094837.431976-1-i.repko@syntacore.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.1 (3.58.1-1.fc43) MIME-Version: 1.0 X-Originating-IP: [172.27.13.83] X-ClientProxiedBy: S-SC-EXCH-01.corp.syntacore.com (10.76.202.20) To S-SC-EXCH-01.corp.syntacore.com (10.76.202.20) X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.1.8310, bases: 2025/11/07 07:41:00 #27891535 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: NotDetected X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 5 Received-SPF: pass client-ip=178.249.69.228; envelope-from=i.repko@syntacore.com; helo=m.syntacore.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Hi, We encountered this issue with U-Boot driver. It implements a single RX buffer, which gets resubmitted to s2mm once the network stack is done handling a packet, so for a while the DMA engine has no buffers to store incoming packets into, and that's why we're seeing AXI DMA data push failures, which lead to packets duplicating and NetQueue growing indefinitely. Haven't really tested with Linux. What was the problem with the kernel driver? Ilya On Thu, 2025-11-06 at 20:16 +0100, Edgar E. Iglesias wrote: > On Thu, Nov 06, 2025 at 12:48:37PM +0300, Ilya Repko wrote: > > This reverts commit 3a6d374b754b4b345195ff6846eeaffedc96a7c5. > >=20 > > During axienet_eth_rx_notify(), s->rxpos is modified to indicate > > how much > > data was pushed to AXI DMA. eth_rx() would then return this value. > > If at 0, network subsystem would consider packet reception as > > failed > > and put the packet in a queue for later. > >=20 > > Before we attempt to push packet data to AXI DMA, the packet is > > stored > > in s->rxmem buffer. If an attempt to push data fails, we will > > reattempt > > to deliver it from s->rxmem buffer once s2mm stream gets a new > > descriptor. > > s->rxmem would not be overwritten by a subsequent eth_rx() call, > > because > > eth_can_rx() protects it in case it has any data at all. Leaving > > the packet > > in a NetQueue though effectively duplicates it. > >=20 > > Therefore, eth_rx() must indicate successful packet reception in > > case > > data push to AXI DMA fails. >=20 > Hi, >=20 > Adding Fea since we're reverting his patch, he may have some > insights. >=20 > What you describe sounds reasonable but I think we've seen issues > with > both your version (the original one) and Fea's version. >=20 > What machine are you running? Are you running Linux guests? >=20 > Cheers, > Edgar >=20 >=20 >=20 >=20 > >=20 > > Signed-off-by: Ilya Repko > > --- > > =C2=A0hw/net/xilinx_axienet.c | 2 +- > > =C2=A01 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c > > index 31e7708082..101b3f260a 100644 > > --- a/hw/net/xilinx_axienet.c > > +++ b/hw/net/xilinx_axienet.c > > @@ -867,7 +867,7 @@ static ssize_t eth_rx(NetClientState *nc, const > > uint8_t *buf, size_t size) > > =C2=A0=C2=A0=C2=A0=C2=A0 axienet_eth_rx_notify(s); > > =C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0 enet_update_irq(s); > > -=C2=A0=C2=A0=C2=A0 return s->rxpos; > > +=C2=A0=C2=A0=C2=A0 return size; > > =C2=A0} > > =C2=A0 > > =C2=A0static size_t > > --=20 > > 2.51.1 > >=20