]> git.baikalelectronics.ru Git - kernel.git/commit
net/davinci: do not use all descriptors for tx packets
authorSascha Hauer <s.hauer@pengutronix.de>
Tue, 3 Jan 2012 05:27:47 +0000 (05:27 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Jan 2012 18:50:49 +0000 (13:50 -0500)
commit78e425e70556627feb01fa3c81dda21a081ad28b
treef9ea58e3a3f5c9bcff28e36feb9b444d78fb0e9c
parent4143745190cabaeb20acbf0491bf96db3975c8a3
net/davinci: do not use all descriptors for tx packets

The driver uses a shared pool for both rx and tx descriptors.
During open it queues fixed number of 128 descriptors for receive
packets. For each received packet it tries to queue another
descriptor. If this fails the descriptor is lost for rx.
The driver has no limitation on tx descriptors to use, so it
can happen during a nmap / ping -f attack that the driver
allocates all descriptors for tx and looses all rx descriptors.
The driver stops working then.
To fix this limit the number of tx descriptors used to half of
the descriptors available, the rx path uses the other half.

Tested on a custom board using nmap / ping -f to the board from
two different hosts.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/davinci_emac.c