[PATCH] rtl8193: switch to use qemu_receive_packet() for loopback

Alexander Bulekov posted 1 patch 4 years, 11 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210226184753.230037-1-alxndr@bu.edu
Maintainers: Jason Wang <jasowang@redhat.com>
hw/net/rtl8139.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] rtl8193: switch to use qemu_receive_packet() for loopback
Posted by Alexander Bulekov 4 years, 11 months ago
This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.

Buglink: https://bugs.launchpad.net/qemu/+bug/1910826
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
---

Although it's not a nc->info->receive() call, maybe this can also go in
this series?

-Alex

 hw/net/rtl8139.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 4675ac878e..90b4fc63ce 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -1795,7 +1795,7 @@ static void rtl8139_transfer_frame(RTL8139State *s, uint8_t *buf, int size,
         }
 
         DPRINTF("+++ transmit loopback mode\n");
-        rtl8139_do_receive(qemu_get_queue(s->nic), buf, size, do_interrupt);
+        qemu_receive_packet(qemu_get_queue(s->nic), buf, size);
 
         if (iov) {
             g_free(buf2);
-- 
2.28.0


Re: [PATCH] rtl8193: switch to use qemu_receive_packet() for loopback
Posted by Jason Wang 4 years, 11 months ago
On 2021/2/27 2:47 上午, Alexander Bulekov wrote:
> This patch switches to use qemu_receive_packet() which can detect
> reentrancy and return early.
>
> Buglink: https://bugs.launchpad.net/qemu/+bug/1910826
> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
> ---
>
> Although it's not a nc->info->receive() call, maybe this can also go in
> this series?
>
> -Alex


Yes, I will add this in this series.

Thanks


>
>   hw/net/rtl8139.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
> index 4675ac878e..90b4fc63ce 100644
> --- a/hw/net/rtl8139.c
> +++ b/hw/net/rtl8139.c
> @@ -1795,7 +1795,7 @@ static void rtl8139_transfer_frame(RTL8139State *s, uint8_t *buf, int size,
>           }
>   
>           DPRINTF("+++ transmit loopback mode\n");
> -        rtl8139_do_receive(qemu_get_queue(s->nic), buf, size, do_interrupt);
> +        qemu_receive_packet(qemu_get_queue(s->nic), buf, size);
>   
>           if (iov) {
>               g_free(buf2);