]> 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)
commit0d18360944bb89e2d5413d8c4b9b61f7a6b30514
tree36a9a4546163a3c5b9a9ab3daa3b6bbe34af55aa
parent39fb1dd071ec3bd8006d5768e36fb8b940b45e0a
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