qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v9 08/10] hw/net: GMAC Rx Implementation


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v9 08/10] hw/net: GMAC Rx Implementation
Date: Mon, 8 Jan 2024 16:19:35 +0100
User-agent: Mozilla Thunderbird

Hi Nabih,

On 19/12/23 22:32, Nabih Estefan wrote:
From: Nabih Estefan Diaz <nabihestefan@google.com>

- Implementation of Receive function for packets
- Implementation for reading and writing from and to descriptors in
   memory for Rx

When RX starts, we need to flush the queued packets so that they
can be received by the GMAC device. Without this it won't work
with TAP NIC device.

When RX descriptor list is full, it returns a DMA_STATUS for software to handle 
it. But there's no way to indicate the software ha handled all RX descriptors 
and the whole pipeline stalls.

We do something similar to NPCM7XX EMC to handle this case.

1. Return packet size when RX descriptor is full, effectively dropping these 
packets in such a case.
2. When software clears RX descriptor full bit, continue receiving further 
packets by flushing QEMU packet queue.

Signed-off-by: Hao Wu <wuhaotsh@google.com>
Signed-off-by: Nabih Estefan <nabihestefan@google.com>
Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
---
  hw/net/npcm_gmac.c | 330 ++++++++++++++++++++++++++++++++++++++++++++-
  1 file changed, 328 insertions(+), 2 deletions(-)

diff --git a/hw/net/npcm_gmac.c b/hw/net/npcm_gmac.c
index 44c4ffaff4..fe7b0421ef 100644
--- a/hw/net/npcm_gmac.c
+++ b/hw/net/npcm_gmac.c
@@ -23,7 +23,11 @@
  #include "hw/registerfields.h"
  #include "hw/net/mii.h"
  #include "hw/net/npcm_gmac.h"
+#include "linux/if_ether.h"

This doesn't build on macOS:

[1116/1645] Compiling C object libcommon.fa.p/hw_net_npcm_gmac.c.o
../../hw/net/npcm_gmac.c:26:10: fatal error: 'linux/if_ether.h' file not found
#include "linux/if_ether.h"
         ^~~~~~~~~~~~~~~~~~
1 error generated.
FAILED: libcommon.fa.p/hw_net_npcm_gmac.c.o
ninja: build stopped: subcommand failed.

$ uname -o
Darwin

  #include "migration/vmstate.h"
+#include "net/checksum.h"
+#include "net/net.h"
+#include "qemu/cutils.h"
  #include "qemu/log.h"
  #include "qemu/units.h"
  #include "sysemu/dma.h"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]