Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1708042pxf; Fri, 9 Apr 2021 15:39:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk+dG/fH80EjobuTpBYX1A/XPCLV6fzyCsp/vOEkTW7op4QbnpFTKV3AHXvArm5yOrUA2L X-Received: by 2002:a62:824c:0:b029:21b:66f5:c813 with SMTP id w73-20020a62824c0000b029021b66f5c813mr14242998pfd.32.1618007946273; Fri, 09 Apr 2021 15:39:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618007946; cv=none; d=google.com; s=arc-20160816; b=b91GlBMAGv473Q/0XogmD1yE7B+n8O62hruzvzAYF5q/k0FHuN2PVmNHlIvHqsfqQm W21WMu1LTje3NCD+/OJh5xqkrMjV9Ryeq4Nvy4NX6gzdjy5IKkvndG+V65PyFbpERVrr TkADxyxctPJfhwsCtk1JjTuu46gPl1y7J9cUBeNroS8zEf1UPMneMjaowzlFRE3kGOMw 2zq6SiITt1Hl8uJpQFKPIA67e+yfn4hEct2lzxPrje0aGTtnloJGmvWmNLx3w9HSVz1L FFsfyihWHk8wvHZAzfJWri3pO28U2978+15JXg6nxqOweJBaDAvcRL4FDOKVpjtJirBg TMpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=RQaj4GV0Jq3ffxY/eFd7Oq4i8/CAPwtBW6FzUex6oGs=; b=plVTwgfkbIGEVPG5N/ebwjtIJHRFU9KTcMJgTgwEh0xdu4OQNL3cthQnI3pcfVUBDs 4QWEsYQEfVGGTAnH3w/Y8mjzrJtVtxy8rQQDeYcKlKZliSllvSspK1BDXfoCWaup+qH6 Hk9KGkfSZQjl3baineCJ9xUla8JUIk6EpiAyBuz78K/YxeAqPbOXyNAF5nwGbCGqm2IE SJ9jkNKsr0gNbZWgmLbQbKU5bprkQRsaBCfSGDl2lKgH1RFyUuJhT1z0xiitG4DcRmvv ZYurJx3RGtUUZnkEAd9TSt7d3GRJe8t1mCjuOLBQbLOAXV1/9FMg1bKsUSwoYzrPHWK5 sDSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d23si4008614pgl.436.2021.04.09.15.38.53; Fri, 09 Apr 2021 15:39:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235048AbhDIWiX (ORCPT + 99 others); Fri, 9 Apr 2021 18:38:23 -0400 Received: from mail-ej1-f52.google.com ([209.85.218.52]:44600 "EHLO mail-ej1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234602AbhDIWiW (ORCPT ); Fri, 9 Apr 2021 18:38:22 -0400 Received: by mail-ej1-f52.google.com with SMTP id e14so10965640ejz.11; Fri, 09 Apr 2021 15:38:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RQaj4GV0Jq3ffxY/eFd7Oq4i8/CAPwtBW6FzUex6oGs=; b=Yb6NVkMJNita1PGzV5CCuUAwzPKKoTcDsweDvWicPgK5MvjWToqprZ0FjJkHtvSlxO hye5PNpTW3Z1Itu3ifvn/jqOIdYRI8Tcz4SCiV2pdZJg/r4Yo5f6hfnzwrJ9LLIXv7r1 4cpRUx0pUxP0csi0ooBNLTkNg9nTc0ZcSyKam3/H1s1dylvm1SBnctl6CPFnPb/IUWQw eugYp4U26rsz4/nNnfyvS109hQhhPJm7Mk2Yx1j+9IavpavYJJyfMNf3nYxuMp8bj8GK 0RbFjHZq0QbJBH3ZPYdCmkbYGIoBAoppTt5ykg5R8hWMmG+5yB494WjgZebU1IHMzdjM jMSw== X-Gm-Message-State: AOAM533W78O8hPX7mCE4TqF/SZVxlCeO+zWMnJXjENG9XDA511ajlrPy w35XLckbukF3c31nQS6ZqluqvukE89yfpw== X-Received: by 2002:a17:907:33cb:: with SMTP id zk11mr1145396ejb.231.1618007887368; Fri, 09 Apr 2021 15:38:07 -0700 (PDT) Received: from msft-t490s.teknoraver.net (net-93-66-21-119.cust.vodafonedsl.it. [93.66.21.119]) by smtp.gmail.com with ESMTPSA id s20sm2108726edu.93.2021.04.09.15.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 15:38:06 -0700 (PDT) From: Matteo Croce To: netdev@vger.kernel.org, linux-mm@kvack.org Cc: Ayush Sawal , Vinay Kumar Yadav , Rohit Maheshwari , "David S. Miller" , Jakub Kicinski , Thomas Petazzoni , Marcin Wojtas , Russell King , Mirko Lindner , Stephen Hemminger , Tariq Toukan , Jesper Dangaard Brouer , Ilias Apalodimas , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Boris Pismenny , Arnd Bergmann , Andrew Morton , "Peter Zijlstra (Intel)" , Vlastimil Babka , Yu Zhao , Will Deacon , Michel Lespinasse , Fenghua Yu , Roman Gushchin , Hugh Dickins , Peter Xu , Jason Gunthorpe , Guoqing Jiang , Jonathan Lemon , Alexander Lobakin , Cong Wang , wenxu , Kevin Hao , Aleksandr Nogikh , Jakub Sitnicki , Marco Elver , Willem de Bruijn , Miaohe Lin , Yunsheng Lin , Guillaume Nault , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, bpf@vger.kernel.org, Matthew Wilcox , Eric Dumazet , David Ahern , Lorenzo Bianconi , Saeed Mahameed , Andrew Lunn , Paolo Abeni Subject: [PATCH net-next v3 0/5] page_pool: recycle buffers Date: Sat, 10 Apr 2021 00:37:56 +0200 Message-Id: <20210409223801.104657-1-mcroce@linux.microsoft.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matteo Croce This is a respin of [1] This 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. 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. Instead of allocating buffers specifically for SKBs we now allocate a generic buffer and either wrap it on an SKB (via build_skb) or create an XDP frame. The recycling code leverages the XDP recycle APIs. The Marvell mvpp2 and mvneta drivers are used in this patchset to demonstrate how to use the API, and tested on a MacchiatoBIN and EspressoBIN boards respectively. Please let this going in on a future -rc1 so to allow enough time to have wider tests. [1] https://lore.kernel.org/netdev/154413868810.21735.572808840657728172.stgit@firesoul/ v2 -> v3: - added missing SOBs - CCed the MM people v1 -> v2: - fix a commit message - avoid setting pp_recycle multiple times on mvneta - squash two patches to avoid breaking bisect Ilias Apalodimas (1): page_pool: Allow drivers to hint on SKB recycling Jesper Dangaard Brouer (1): xdp: reduce size of struct xdp_mem_info Matteo Croce (3): mm: add a signature in struct page mvpp2: recycle buffers mvneta: recycle buffers .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 2 +- drivers/net/ethernet/marvell/mvneta.c | 7 ++- .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 17 +++---- drivers/net/ethernet/marvell/sky2.c | 2 +- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +- include/linux/mm_types.h | 1 + include/linux/skbuff.h | 35 ++++++++++++-- include/net/page_pool.h | 15 ++++++ include/net/xdp.h | 5 +- net/core/page_pool.c | 47 +++++++++++++++++++ net/core/skbuff.c | 20 +++++++- net/core/xdp.c | 14 ++++-- net/tls/tls_device.c | 2 +- 13 files changed, 142 insertions(+), 27 deletions(-) -- 2.30.2