]> git.baikalelectronics.ru Git - kernel.git/commit
skbuff: skb supports zero-copy buffers
authorShirley Ma <mashirle@us.ibm.com>
Wed, 6 Jul 2011 12:22:12 +0000 (12:22 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Jul 2011 11:41:13 +0000 (04:41 -0700)
commit4a5ab3f21e61929565253a65fb795c30e9e13c9b
tree36a9a4546163a3c5b9a9ab3daa3b6bbe34af55aa
parent0de63d24b783525dd40b4acf4084d3f7dce788b8
skbuff: skb supports zero-copy buffers

This patch adds userspace buffers support in skb shared info. A new
struct skb_ubuf_info is needed to maintain the userspace buffers
argument and index, a callback is used to notify userspace to release
the buffers once lower device has done DMA (Last reference to that skb
has gone).

If there is any userspace apps to reference these userspace buffers,
then these userspaces buffers will be copied into kernel. This way we
can prevent userspace apps from holding these userspace buffers too long.

Use destructor_arg to point to the userspace buffer info; a new tx flags
SKBTX_DEV_ZEROCOPY is added for zero-copy buffer check.

Signed-off-by: Shirley Ma <xma@...ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
net/core/skbuff.c