qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "hw/net: Fix the transmission return size"
@ 2025-11-06  9:48 Ilya Repko
  2025-11-06 19:16 ` Edgar E. Iglesias
  0 siblings, 1 reply; 4+ messages in thread
From: Ilya Repko @ 2025-11-06  9:48 UTC (permalink / raw)
  To: Edgar E. Iglesias, Alistair Francis, Peter Maydell, Jason Wang
  Cc: open list:Xilinx Zynq, open list:All patches CC here

This reverts commit 3a6d374b754b4b345195ff6846eeaffedc96a7c5.

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.

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.

Therefore, eth_rx() must indicate successful packet reception in case
data push to AXI DMA fails.

Signed-off-by: Ilya Repko <i.repko@syntacore.com>
---
 hw/net/xilinx_axienet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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)
     axienet_eth_rx_notify(s);
 
     enet_update_irq(s);
-    return s->rxpos;
+    return size;
 }
 
 static size_t
-- 
2.51.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] Revert "hw/net: Fix the transmission return size"
@ 2025-11-05 19:55 Ilya Repko
  0 siblings, 0 replies; 4+ messages in thread
From: Ilya Repko @ 2025-11-05 19:55 UTC (permalink / raw)
  Cc: Ilya Repko, Edgar E. Iglesias, Alistair Francis, Peter Maydell,
	Jason Wang, open list:Xilinx Zynq, open list:All patches CC here

This reverts commit 3a6d374b754b4b345195ff6846eeaffedc96a7c5.

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.

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.

Therefore, eth_rx() must indicate successful packet reception in case
data push to AXI DMA fails.

Signed-off-by: Ilya Repko <i.repko@syntacore.com>
---
 hw/net/xilinx_axienet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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)
     axienet_eth_rx_notify(s);
 
     enet_update_irq(s);
-    return s->rxpos;
+    return size;
 }
 
 static size_t
-- 
2.51.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-11-07  9:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06  9:48 [PATCH] Revert "hw/net: Fix the transmission return size" Ilya Repko
2025-11-06 19:16 ` Edgar E. Iglesias
2025-11-07  9:03   ` Ilya Repko
  -- strict thread matches above, loose matches on Subject: below --
2025-11-05 19:55 Ilya Repko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).