HyperNews Linux KHG 讨论页面

Question: 关于 alloc_skb() 的问题

论坛: 网络缓冲区和内存管理
关键词: 网络接口
日期: 1997年3月31日,星期一,18:16:47 GMT
发件人: Joern Wohlrab <unknown>

Hi, 
  As I read in that introduction a network device driver
has to alloc a sk_buff in it's ISR and this has to happen
atomically, isn't it? Well my experiences are that unfortunately
it often happens that alloc_skb returns NULL. So my idea was
I alloc a few sk_buff's (with GFP_KERNEL flag) in the device
drivers open function. The device driver would organize these 
sk_buff's as ring. Else the device driver must forbid the 
higher layer to free the sk_buff's. Is this possible just 
by setting the lock flag inside sk_buff?
The only problem with this scheme is when the user process
doesn't read frequently from the socket the device driver
overrides unread sk_buff data again and the packet order would
be destroyed. But let's assume we don't care. So is this plan
possible at all?
  Thank you very much.
--
Joern Wohlrab


消息

1. Disagree: 回复:关于 alloc_skb() 的问题 作者:Erik Petersen