From: Thadeu Lima de Souza Cascardo Date: Mon, 24 May 2010 05:21:31 +0000 (-0400) Subject: Socket buffers and other network related information. X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fkernel%2Fslides%2F.git;a=commitdiff_plain;h=ca9630fd6c5da2f223f2086318e6aac0ac00f22a Socket buffers and other network related information. --- diff --git a/15net/net b/15net/net new file mode 100644 index 0000000..88907c9 --- /dev/null +++ b/15net/net @@ -0,0 +1,45 @@ +%Network Subsystem +%Thadeu Cascardo + +# Socket Buffers + +* include linux/skbuff.h +* struct sk\\_buff + - struct net\\_device *dev +* alloc\\_skb(len, gfp) +* dev\\_alloc\\_skb(len) - uses ATOMIC, reserves PAD +* netdev\\_alloc\\_skb(netdev, len) - uses ATOMIC, since 2.6.18 + +# Diagram + +* head - start of allocated buffer +* end - end of allocated buffer +* data - start of data, giving space after headroom +* tail - end of used space +* headroom - space between head and data +* tailroom - space between tail and end + +# Socket Buffers operations + +* skb\\_put(skb, len) - adds data to end of skb +* skb\\_push(skb, len) - adds data to start of skb +* skb\\_pull(skb, len) - allocates headroom +* skb\\_headroom and skb\\_tailroom +* skb\\_reserve - only allowed for empty buffer, reserves headroom +* skb\\_orphan - release it from its socket holder + + +# Changes in net device + +* Use netdev\\_priv, no priv anymore +* struct net\\_device\\_ops introduced in 2.6.29, with compatibility provided + for drivers +* Compatibility removed in 2.6.31 +* netdev\\_tx\\_t: NETDEV\\_TX\\_OK, NETDEV\\_TX\\_BUSY, NETDEV\\_TX\\_LOCKED + +# Other recent changes + +* Some members moved to netdev\\_queue to increase cache-line usage +* GRO/GSO +* Multi-queue support +* RPS - Packet Steering