From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Dangaard Brouer Subject: [net-next PATCH RFC 0/8] page_pool DMA handling and allow to recycles frames via SKB Date: Fri, 07 Dec 2018 00:25:26 +0100 Message-ID: <154413868810.21735.572808840657728172.stgit@firesoul> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: Toke =?utf-8?q?H=C3=B8iland-J=C3=B8rgensen?= , ard.biesheuvel@linaro.org, Jason Wang , ilias.apalodimas@linaro.org, =?utf-8?b?QmrDtnJu?= =?utf-8?b?VMO2cGVs?= , w@1wt.eu, Saeed Mahameed , mykyta.iziumtsev@gmail.com, Daniel Borkmann , Alexei Starovoitov , Tariq Toukan To: netdev@vger.kernel.org, "David S. Miller" , Jesper Dangaard Brouer Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44480 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbeLFXZi (ORCPT ); Thu, 6 Dec 2018 18:25:38 -0500 Sender: netdev-owner@vger.kernel.org List-ID: This RFC patchset shows the plans for allowing page_pool to handle and maintain DMA map/unmap of the pages it serves to the driver. For this to work a return hook in the network core is introduced, which also involves extending sk_buff with the necessary information. The overall purpose is to simplify drivers, by providing a page allocation API that does recycling, such that each driver doesn't have to reinvent its own recycling scheme. Using page_pool in a driver does not require implementing XDP support, but it makes it trivially easy to do so. The recycles code leverage the XDP recycle APIs. The Marvell mvneta driver was used in this patchset to demonstrate how to use the API, and tested on the EspressoBIN board. We also have patches enabling XDP for this driver, but they are not part of this patchset as we want review of the general idea of the page_pool return SKB hook. A driver using page_pool and XDP redirecting into CPUMAP or veth, will also take advantage of the new SKB return hook, this is currently only mlx5. The longer term plans involves allowing other types of allocators to use this return hook. Particularly allowing zero-copy AF_XDP frames to travel further into the netstack, if userspace page have been restricted to read-only. --- Ilias Apalodimas (4): page_pool: add helper functions for DMA net: mvneta: use page pool API for sw buffer manager net: core: add recycle capabilities on skbs via page_pool API net: mvneta: remove copybreak, prefetch and use build_skb Jesper Dangaard Brouer (4): xdp: reduce size of struct xdp_mem_info mvneta: activate page recycling via skb using page_pool xdp: bpf: cpumap redirect must update skb->mem_info veth: xdp_frames redirected into veth need to transfer xdp_mem_info drivers/net/ethernet/marvell/Kconfig | 1 drivers/net/ethernet/marvell/mvneta.c | 158 +++++++++++++++++---------------- drivers/net/veth.c | 1 include/linux/skbuff.h | 6 + include/net/page_pool.h | 6 + include/net/xdp.h | 5 + kernel/bpf/cpumap.c | 2 net/core/page_pool.c | 7 + net/core/skbuff.c | 7 + net/core/xdp.c | 14 ++- 10 files changed, 125 insertions(+), 82 deletions(-)