Re: 2.6.7-rc2-mm2 udp multicast problem (sendto hangs)

From: Denis Vlasenko
Date: Wed Jun 23 2004 - 07:38:55 EST


On Wednesday 23 June 2004 15:00, Martin Zwickel wrote:
> On Wed, 23 Jun 2004 13:34:57 +0300
>
> Denis Vlasenko <vda@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> bubbled:
> > On Wednesday 23 June 2004 12:56, Martin Zwickel wrote:
> > > if I use MSG_DONTWAIT with sendto, I get temporarily unavailable
> > > resources (many!):
> > >
> > > sendto(sendfd): Resource temporarily unavailable
> > >
> > > but isn't udp supposed to not block?
> >
> > Think about what will happen if you will try to spew
> > udp packets continuously:
> >
> > while(1)
> > sendto(...);
> >
> > They will pile up in queue and eventually it will fill up.
> > Then kernel may either drop excess packets silently
> > or return you EAGAIN.
>
> Yes, but why does the kernel not send out the queue?(I don't know if the
> queue is empty or full when my sendto stops)
> Without MSG_DONTWAIT, sendto waits endlessly. But on what?

strace, gdb and/or (SysRq-T with ksymoops) will tell you.

> Normally the kernel should put the queued packets on the line and accept
> new ones, or did I misunderstand this?

Hm, yes. What does tcpdump tell you?

> My program sends out many udp packets, and sometimes it just stops until
> the kernel receives a network packet or I access the local network(with arp
> command).

arp does not access network. I think it just prints current arp cache.

> So if I run arp in an endless loop(while :; do arp; done), sendto runs
> smooth.
>
> For me it smells like a bug ;)

Possible. We need more details. Also CC network folks :)
--
vda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/