RE: skbuff headroom guarantee in the driver?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



How many bytes must be added for your application?  I have a driver that
needs to insert 6 bytes before sending to the ethernet hardware, and after
increasing net_device::hard_header_len by 6 I have not seen it rallocate
packets due to insufficient headroom.  I have only tested it with a simple
FTP session; I don't know how often it would have to reallocate in a
situation where packets received from other interfaces had to be
transmitted.

> -----Original Message-----
> From: Venu Vadapalli [mailto:bvadapal@hotmail.com] 
> Sent: Wednesday, May 14, 2003 9:20 PM
> To: linux-net@vger.kernel.org
> Subject: RE: skbuff headroom guarantee in the driver?
> 
> 
> The driver needs to have guaranteed space between the head 
> and data of 
> skbuff (prepend MAC header), so it could stuff some 
> information and send it 
> the MAC hardware. On the Rx side, the driver allocates the 
> skbuff, so it can 
> allocate the required headroom to receive similar information 
> from the MAC 
> hardware, without any problem. I'm afraid, the control buffer 
> of skb doesn't 
> help in this situation.
> 
> -----Original Message-----
> From: Jed Carlson [mailto:jcarlson@katalix.com]
> Sent: Wednesday, May 14, 2003 3:44 PM
> To: linux-net@vger.kernel.org
> Subject: Re: skbuff headroom guarantee in the driver?
> 
> 
> Have you considered whether you can use skb->cb[]? This can 
> be used as a
> scratch area to pass information with the skb. But be aware that its
> contents isn't guaranteed to be preserved as the skb passes 
> through the
> kernel since it may be used by other kernel subsystems. Take 
> a look at how
> it's used by the TCP code via the macro TCP_SKB_CB().
> 
> -Jed
> 
> >Is there a way to guarantee headroom for the Tx packets to be used in
> >the Mac driver. Increasing the hard_header_len doesn't seem to be the
> >way to go because in the TCP processing skbuffs are allocated with
> >MAX_HEADER_LEN and it doesn't seem appropriate to bank on this
> >macro. If I want to pass some extra information (say, some descriptor
> >realted) to the MAC by prepending the packet, what is the best way to
> >do it? I guess, one could argue that it is no longer a true ethernet
> >header and hence a new header should be introduced. However, 
> the extra
> >information is not any mutated mac header but is some descriptor
> >information that needs to be passed with packet for performance
> >reasons. Needless to say, I'm hoping to avoid using 
> skb_realloc_header
> >in the driver.
> 
> 
> -
> : send the line "unsubscribe 
> linux-net" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> _________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE*  
> http://join.msn.com/?page=features/junkmail
> 
> -
> : send the line "unsubscribe 
> linux-net" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux