xdp: implement convert_to_xdp_frame for MEM_TYPE_ZERO_COPY
authorBjörn Töpel <bjorn.topel@intel.com>
Tue, 28 Aug 2018 12:44:25 +0000 (14:44 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 29 Aug 2018 19:25:53 +0000 (12:25 -0700)
commitb0d1beeff2a97a0cf1965ea8f1d13b8973f22582
treefe62f9152f04a26affb09ddb56fdd253f3502e82
parent7d2c6cfc5411207f1094e7ca5e63e711dc76d1ff
xdp: implement convert_to_xdp_frame for MEM_TYPE_ZERO_COPY

This commit adds proper MEM_TYPE_ZERO_COPY support for
convert_to_xdp_frame. Converting a MEM_TYPE_ZERO_COPY xdp_buff to an
xdp_frame is done by transforming the MEM_TYPE_ZERO_COPY buffer into a
MEM_TYPE_PAGE_ORDER0 frame. This is costly, and in the future it might
make sense to implement a more sophisticated thread-safe alloc/free
scheme for MEM_TYPE_ZERO_COPY, so that no allocation and copy is
required in the fast-path.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/net/xdp.h
net/core/xdp.c