Skip to contentSkip to conversation

spapr_llan: fix device reenabling

PATCH Applied Alexey Kardashevskiy 2 participants 2 messages May 3, 2013 – May 6, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spapr_llan: fix device reenabling

Normally, the "tap" device is polled by QEMU if a guest NIC can receive packets. If a guest NIC is stopped during transfer (rmmod or ifdown), it may still have packets in a queue which have to be send to the guest before QEMU enables polling of a "tap" interface via tap_update_fd_handler().

However the spapr_llan device was missing the qemu_flush_queued_packets() call so the tap_send_completed() callback was never called and therefore "tap" interface polling was not enabled ever.

The patch fixes this problem.

---
 hw/net/spapr_llan.c |    2 ++
 1 file changed, 2 insertions(+)
hw/net/spapr_llan.c +2 -0
index cca3d1a..46f7d5f 100644
@@ -336,6 +336,8 @@ static target_ulong h_register_logical_lan(PowerPCCPU *cpu,
     spapr_vio_dma_set(sdev, VLAN_BD_ADDR(rec_queue), 0, VLAN_BD_LEN(rec_queue));
 
     dev->isopen = 1;
+    qemu_flush_queued_packets(qemu_get_queue(dev->nic));
+
     return H_SUCCESS;
 }
 
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 6 lines · Alexey Kardashevskiy

Normally, the "tap" device is polled by QEMU if a guest NIC can receive packets. If a guest NIC is stopped during transfer (rmmod or ifdown), it may still have packets in a queue which have to be send to the guest before QEMU enables polling of a "tap" interface via tap_update_fd_handler().

Quoted 7 lines

However the spapr_llan device was missing the qemu_flush_queued_packets() call so the tap_send_completed() callback was never called and therefore "tap" interface polling was not enabled ever.

The patch fixes this problem.

Thanks, applied to ppc-next.

Alex

Quoted 17 lines
---
  hw/net/spapr_llan.c |    2 ++
  1 file changed, 2 insertions(+)
hw/net/spapr_llan.c +2 -0
index cca3d1a..46f7d5f 100644
@@ -336,6 +336,8 @@ static target_ulong h_register_logical_lan(PowerPCCPU *cpu,
      spapr_vio_dma_set(sdev, VLAN_BD_ADDR(rec_queue), 0, VLAN_BD_LEN(rec_queue));
 
      dev->isopen = 1;
+    qemu_flush_queued_packets(qemu_get_queue(dev->nic));
+
      return H_SUCCESS;
  }