want opinions on possible glitch in 2.4 network error reporting
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 8 lines · Chris Friesen
I've been looking around in the 2.4 networking stack, and I noticed that when the tulip (and no doubt many other) driver cannot put any more outgoing packets on the queue, it calls
netif_stop_queue(). Then, indev_queue_xmit()we check this flag by callingnetif_queue_stopped(). My concern is that if this flag is true, we return-ENETDOWN. Is this really the proper return code for this? If anything, the network is too active. It seems to me that it would make more sense to have some kind of congestion return code rather than claiming that the network is down.
The ENETDOWN path you're seeing only applies to queueless devices (like loopback or a tunnel device). These should only set the queued stopped flag when something is terrible wrong.
All real network devices have a queue and go through the qdisc.
Quoted 9 lines
I think it would make sense to return
-ENOBUFSin this case, as its already listed in thesendto()man page, and the description matches the error because the command could succeed if retried.I ran into a somewhat related issue on a 2.2.16 system, where I had an app that was calling
sendto()on 217000 packets/sec, even though the wire could only handle about 127000 packets/sec. I got no errors at all in sendto, even though over a third of the packets were not actually being sent.
The qdisc queue acts like an IP network and deletes unnecessary packets. There is no provision to block when it fills because that would have many sideeffects and complicate the stack a lot. There is an return code though that is passed up when the queue fills (NET_XMIT_DROP or NET_XMIT_CN), but it's currently only used by TCP but not passed to user space for UPD/RAW. It could be probably done with a special socket option if there is a clear need.
-Andi
Quoted 12 lines · Andi Kleen
Quoted 8 lines · Chris Friesen
I've been looking around in the 2.4 networking stack, and I noticed that when the tulip (and no doubt many other) driver cannot put any more outgoing packets on the queue, it calls
netif_stop_queue(). Then, indev_queue_xmit()we check this flag by callingnetif_queue_stopped(). My concern is that if this flag is true, we return-ENETDOWN. Is this really the proper return code for this? If anything, the network is too active. It seems to me that it would make more sense to have some kind of congestion return code rather than claiming that the network is down.
Quoted 5 lines
The ENETDOWN path you're seeing only applies to queueless devices (like loopback or a tunnel device). These should only set the queued stopped flag when something is terrible wrong.
All real network devices have a queue and go through the qdisc.
Okay, I must be missing something, so can you enlighten me? I can't figure out where the qdisc is attached to the ethernet device.
Chris
Signature · 4 lines
Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: [email protected]
Quoted 2 lines · Chris Friesen
Okay, I must be missing something, so can you enlighten me? I can't figure out where the qdisc is attached to the ethernet device.
net/core/dev.c:dev_open -> dev_activate.
-Andi