hw/net: Fix the transmission return size
authorFea.Wang <fea.wang@sifive.com>
Thu, 13 Jun 2024 01:35:01 +0000 (09:35 +0800)
committerEdgar E. Iglesias <edgar.iglesias@amd.com>
Tue, 18 Jun 2024 12:52:05 +0000 (14:52 +0200)
Fix the transmission return size because not all bytes could be
transmitted successfully. So, return a successful length instead of a
constant value.

Signed-off-by: Fea.Wang <fea.wang@sifive.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Reviewed-by: Frank Chang <frank.chang@sifive.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
hw/net/xilinx_axienet.c

index 7d1fd37b4ac98cb9ad303e5c4a4363a2be4326b2..05d41bd548038500cf637648fd0ab814e8342e1f 100644 (file)
@@ -847,7 +847,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 size;
+    return s->rxpos;
 }
 
 static size_t