qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] net/tap.c: Possibly a way to stall tap input
@ 2013-08-01 17:15 Jan Kiszka
  2013-08-01 17:24 ` Jan Kiszka
  2013-08-02 11:46 ` Stefan Hajnoczi
  0 siblings, 2 replies; 9+ messages in thread
From: Jan Kiszka @ 2013-08-01 17:15 UTC (permalink / raw)
  To: qemu-devel, Stefan Hajnoczi

Hi all,

I'm tracking down a nasty stall of tap input over a custom 1.3.x QEMU
version. Under certain load, our tap backend stops reading from the char
device, and that even if we reset the guest. The frontend device
(pcnet32) is able to receive (can_receive would return > 0), but the
tap's fd is no longer registered with the iohandler list.

I was digging into the involved code and found something fishy:

net/tap.c:
static void tap_send(void *opaque)
{
    ...
        size = qemu_send_packet_async(&s->nc, buf, size,
                                      tap_send_completed);
        if (size == 0) {
            tap_read_poll(s, false);
        }

So, if tap_send is registered for the mainloop polling (ie. can_receive
returned true before starting to poll) but qemu_send_packet_async
returns 0 now as qemu_can_send_packet/can_receive happens to report
false in the meantime, we will disable read polling. If also write
polling is off, the fd will be completely removed from the iohandler
list. But even if write polling remains on, I wonder what should bring
read polling back?

We only have an unhandy reproduction scenario, so I wasn't able to
confirm this theory on the target yet (and will not be before Monday,
unfortunately). But any comments on this would be very welcome.

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux

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

end of thread, other threads:[~2013-08-05 11:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-01 17:15 [Qemu-devel] net/tap.c: Possibly a way to stall tap input Jan Kiszka
2013-08-01 17:24 ` Jan Kiszka
2013-08-02  7:33   ` Stefan Hajnoczi
2013-08-02  7:45     ` Jan Kiszka
2013-08-02 11:46 ` Stefan Hajnoczi
2013-08-02 12:45   ` Jan Kiszka
2013-08-02 16:49     ` Jan Kiszka
2013-08-02 19:41     ` Jan Kiszka
2013-08-05 11:38       ` Stefan Hajnoczi

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).