i40e: add AF_XDP zero-copy Rx support
authorBjörn Töpel <bjorn.topel@intel.com>
Tue, 28 Aug 2018 12:44:32 +0000 (14:44 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 29 Aug 2018 19:25:53 +0000 (12:25 -0700)
commit0a714186d3c0f7c563a03537f98716457c1f5ae0
tree88e7c8fa045cce01f5b5c4b7aa69ca0ed090aa87
parent20a739dbef28fb3c17de2789a3d7847efec6a3ff
i40e: add AF_XDP zero-copy Rx support

This patch adds zero-copy Rx support for AF_XDP sockets. Instead of
allocating buffers of type MEM_TYPE_PAGE_SHARED, the Rx frames are
allocated as MEM_TYPE_ZERO_COPY when AF_XDP is enabled for a certain
queue.

All AF_XDP specific functions are added to a new file, i40e_xsk.c.

Note that when AF_XDP zero-copy is enabled, the XDP action XDP_PASS
will allocate a new buffer and copy the zero-copy frame prior passing
it to the kernel stack.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
drivers/net/ethernet/intel/i40e/Makefile
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40e/i40e_txrx.h
drivers/net/ethernet/intel/i40e/i40e_xsk.c [new file with mode: 0644]
drivers/net/ethernet/intel/i40e/i40e_xsk.h [new file with mode: 0644]