]> git.baikalelectronics.ru Git - kernel.git/commit
b44: GFP_DMA skb should not escape from driver
authorEric Dumazet <dada1@cosmosbay.com>
Thu, 15 Jan 2009 23:29:35 +0000 (15:29 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Jan 2009 23:29:35 +0000 (15:29 -0800)
commitf153a8e8832dc3cd0e192b00c74c6c580cc989a8
treeb81ac812625a701e30157877a6f563c89002cb92
parentd11de8d620cb47eccabe41049fcc1220521c372f
b44: GFP_DMA skb should not escape from driver

b44 chip has some hardware limitations, that need GFP_DMA bounce
buffers in some situations.

In order to not deplete DMA zone, we should keep allocated GFP_DMA skb
only for driver use. At rx time, we copy such skb to newly allocated
skb, reusing existing copybreak infrastructure.

On machines with low amount of memory, all skb meet the hardware limitation,
so no copy is needed. We detect this situation using a new device flag, set
to one if one GFP_DMA skb was ever allocated by b44_alloc_rx_skb().

Previously allocated skb, even outside from DMA zone will then be recycled,
to have minimal impact on DMA zone use.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Tested-by: Ionut Leonte <ionut.leonte@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/b44.c
drivers/net/b44.h