linux/net
Herbert Xu d565b0a1a9 net: Add Generic Receive Offload infrastructure
This patch adds the top-level GRO (Generic Receive Offload) infrastructure.
This is pretty similar to LRO except that this is protocol-independent.
Instead of holding packets in an lro_mgr structure, they're now held in
napi_struct.

For drivers that intend to use this, they can set the NETIF_F_GRO bit and
call napi_gro_receive instead of netif_receive_skb or just call netif_rx.
The latter will call napi_receive_skb automatically.  When napi_gro_receive
is used, the driver must either call napi_complete/napi_rx_complete, or
call napi_gro_flush in softirq context if the driver uses the primitives
__napi_complete/__napi_rx_complete.

Protocols will set the gro_receive and gro_complete function pointers in
order to participate in this scheme.

In addition to the packet, gro_receive will get a list of currently held
packets.  Each packet in the list has a same_flow field which is non-zero
if it is a potential match for the new packet.  For each packet that may
match, they also have a flush field which is non-zero if the held packet
must not be merged with the new packet.

Once gro_receive has determined that the new skb matches a held packet,
the held packet may be processed immediately if the new skb cannot be
merged with it.  In this case gro_receive should return the pointer to
the existing skb in gro_list.  Otherwise the new skb should be merged into
the existing packet and NULL should be returned, unless the new skb makes
it impossible for any further merges to be made (e.g., FIN packet) where
the merged skb should be returned.

Whenever the skb is merged into an existing entry, the gro_receive
function should set NAPI_GRO_CB(skb)->same_flow.  Note that if an skb
merely matches an existing entry but can't be merged with it, then
this shouldn't be set.

If gro_receive finds it pointless to hold the new skb for future merging,
it should set NAPI_GRO_CB(skb)->flush.

Held packets will be flushed by napi_gro_flush which is called by
napi_complete and napi_rx_complete.

Currently held packets are stored in a singly liked list just like LRO.
The list is limited to a maximum of 8 entries.  In future, this may be
expanded to use a hash table to allow more flows to be held for merging.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-15 23:38:52 -08:00
..
9p net: remove redundant argument comments 2008-11-21 17:15:03 -08:00
802 hippi: convert driver to net_device_ops 2008-11-20 20:32:15 -08:00
8021q vlan: convert to net_device_ops 2008-11-19 22:42:41 -08:00
appletalk netdevice: safe convert to netdev_priv() #part-4 2008-11-12 23:39:10 -08:00
atm netdevice: Kill netdev->priv 2008-12-08 01:14:16 -08:00
ax25 ax25: join the return paths that free skb 2008-12-14 23:17:26 -08:00
bluetooth bt/rfcomm/tty: join error paths 2008-12-14 23:18:00 -08:00
bridge Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6 2008-11-28 02:19:15 -08:00
can can: merge error paths 2008-12-14 23:16:58 -08:00
core net: Add Generic Receive Offload infrastructure 2008-12-15 23:38:52 -08:00
dcb net: fix dcbnl_setnumtcs operation check 2008-12-15 01:06:23 -08:00
dccp dccp ccid-2: Phase out the use of boolean Ack Vector sysctl 2008-12-08 01:19:06 -08:00
decnet net: Make static 2008-12-10 15:18:31 -08:00
dsa net: Make static 2008-12-10 15:18:31 -08:00
econet netns: Use net_eq() to compare net-namespaces for optimization. 2008-07-19 22:34:43 -07:00
ethernet eth: Declare an optimized compare_ether_addr_64bits() function 2008-11-23 23:24:32 -08:00
ipv4 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-12-15 20:03:50 -08:00
ipv6 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-12-15 20:03:50 -08:00
ipx net: '&' redux 2008-11-03 18:21:05 -08:00
irda irda: merge exit paths 2008-12-14 23:18:30 -08:00
iucv iucv: Fix mismerge again. 2008-09-30 03:03:35 -07:00
key netns PF_KEY: per-netns /proc/pfkey 2008-11-25 17:59:00 -08:00
lapb [LAPB] net/lapb/lapb_iface.c: use LIST_HEAD instead of LIST_HEAD_INIT 2008-01-28 14:56:52 -08:00
llc net: remove redundant argument comments 2008-11-21 17:15:03 -08:00
mac80211 mac80211: misc cleanups 2008-12-12 14:45:27 -05:00
netfilter Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-12-15 20:03:50 -08:00
netlabel Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-12-15 20:03:50 -08:00
netlink netlink: allow empty nested attributes 2008-11-28 03:05:19 -08:00
netrom net: '&' redux 2008-11-03 18:21:05 -08:00
packet net: Make sure BHs are disabled in sock_prot_inuse_add() 2008-11-24 00:09:29 -08:00
phonet Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-12-15 20:03:50 -08:00
rfkill rfkill: strip pointless notifier chain 2008-12-12 14:45:25 -05:00
rose Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-11-26 23:48:40 -08:00
rxrpc net: Make static 2008-12-10 15:18:31 -08:00
sched Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-12-15 20:03:50 -08:00
sctp sctp: fix missing label when PROC_FS=n 2008-11-27 15:30:53 -08:00
sunrpc Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-12-15 20:03:50 -08:00
tipc tipc: trivial endian annotation in debug statement 2008-11-07 23:37:50 -08:00
unix Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-12-02 19:50:27 -08:00
wanrouter netdevice wanrouter: Convert directly reference of netdev->priv 2008-11-20 04:26:21 -08:00
wireless mac80211/cfg80211: check endianness in sparse runs 2008-12-12 14:01:35 -05:00
x25 net: '&' redux 2008-11-03 18:21:05 -08:00
xfrm xfrm: join error paths 2008-12-14 23:16:22 -08:00
Kconfig net/ieee80211 -> drivers/net/ipw2x00/libipw_* rename 2008-11-21 11:08:18 -05:00
Makefile DCB: fix kconfig option 2008-11-25 01:02:08 -08:00
TUNABLE
compat.c reintroduce accept4 2008-11-19 18:49:57 -08:00
nonet.c
socket.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-11-20 16:44:00 -08:00
sysctl_net.c missing bits of net-namespace / sysctl 2008-07-27 09:45:34 -07:00