The HyperNews Linux KHG Discussion Pages

Question: Question on alloc_skb()

Forum: Network Buffers And Memory Management
Keywords: network interface
Date: Mon, 31 Mar 1997 18:16:47 GMT
From: 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


Messages

1. Disagree: Re: Question on alloc_skb() by Erik Petersen