]> git.baikalelectronics.ru Git - kernel.git/commit
[NIU]: Fix potentially stuck TCP socket send queues.
authorDavid S. Miller <davem@davemloft.net>
Sat, 5 Jan 2008 07:54:06 +0000 (23:54 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jan 2008 07:29:56 +0000 (23:29 -0800)
commitc6048b133300c65e83424770f1d0a019a0d6152d
tree2f69bd73412f9a986c739e87326ebcc5cf4e68af
parentb3eb3657fcc1bd882a8eb1e274c0be797b4fd422
[NIU]: Fix potentially stuck TCP socket send queues.

It is possible for the TX ring to have packets sit in it for unbounded
amounts of time.

The only way to defer TX interrupts in the chip is to periodically set
"mark" bits, when processing of a TX descriptor with the mark bit set
is complete it triggers the interrupt for the TX queue's LDG.

A consequence of this kind of scheme is that if packet flow suddenly
stops, the remaining TX packets will just sit there.

If this happens, since those packets could be charged to TCP socket
send queues, such sockets could get stuck.

The simplest solution is to divorce the socket ownership of the packet
once the device takes the SKB, by using skb_orphan() in
niu_start_xmit().

In hindsight, it would have been much nicer if the chip provided two
interrupt sources for TX (like basically every other ethernet chip
does).  Namely, keep the "mark" bit, but also signal the LDG when the
TX queue becomes completely empty.  That way there is no need to have
a deadlock breaker like this.

Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/niu.c