Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2009661pxj; Sat, 5 Jun 2021 09:39:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqAy45C7C+0/H8HLozlKwCTLd/LaoqWX/XhyF/4N2RcZEUHpLaDY1Qk9FQmE88sDrA1HJ9 X-Received: by 2002:a50:fd81:: with SMTP id o1mr259858edt.382.1622911150883; Sat, 05 Jun 2021 09:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622911150; cv=none; d=google.com; s=arc-20160816; b=IFowYBNNSZc1xnjHspzC1/29KiEccFr0y7fAzRQlRKZOv62K7eYm/79GPOH9b7X4rD MKivZ5iOSfgv0i4i4dKYy+NfZ33JSG941JbkJV0Np+mwn1r+iByGbhbPp7YsRaspLrik rtqOYFrBMkrzbPIuRdzd9RcTs6l5ydfJ7HA2/H5+YbEO3qzFpHbVhIk25x39Ypb9FG6j oHfa4iqYRsfzsFGPkW00XTzqm+niyiZxd6MjBSiXmgkIE18+FSzmWDl5rqwrHlGwV5d2 CQDTrNhEkvFmF/Km+b4nQohXip0aaFWNPMgJrp+12NDhp2+yrY/sDLQaJfVeMAlVrA1S X4Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=cOclEmmWl6j6+WY9j7NfknHEEHkDrYdGYI0sPaVF3h0=; b=PWdoagHea7o6hZY1H1LaCTNQ2U8PqXvDAcH9HeOUQCw+YV1C+ZaogVL7QRwFfoVvC/ iU5vxyiU1s5pKvUFpz30M/vL/I4P8T5yGPSj7fKdL6HurlmyHKqPWT25VbScvwFhrNqw hI5KdRQA9SbNUDAcPUnfV7x/QQUMbQmbj8/VA6khqvXMMDBzqtPCYc2xIclcQjlFegiI 2dwtgscgtQ2M2yZmSJ6/zIlt+2v0yPOLQIUCN0TB+9keKtR/FUnGoJTjOERX4zU0wVef RqKng08rjqZvVhF+Z7DhK6mF/RO0Qe6e9qveOTah9VfEmG4R7a02keHbA3/9WQVeglQj +hxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=sTFupoEn; 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=pass (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 w10si7217418edd.545.2021.06.05.09.38.47; Sat, 05 Jun 2021 09:39:10 -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; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=sTFupoEn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230010AbhFEQhI (ORCPT + 99 others); Sat, 5 Jun 2021 12:37:08 -0400 Received: from linux.microsoft.com ([13.77.154.182]:48346 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229930AbhFEQhI (ORCPT ); Sat, 5 Jun 2021 12:37:08 -0400 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by linux.microsoft.com (Postfix) with ESMTPSA id F2E3C20B802A; Sat, 5 Jun 2021 09:35:19 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com F2E3C20B802A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1622910920; bh=cOclEmmWl6j6+WY9j7NfknHEEHkDrYdGYI0sPaVF3h0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=sTFupoEnOZa+Rg9zsHZoCvqOc14skuu1zRcwpinyRGbdbTusvqQrZDUm0fjbulPTF sVrftj5RO8RAowEHni7wtOe2n/P/gl20hV6SUtbkq1vkwkJTA8qTEdWVj8lguBKVx8 /00lyf31dKHGn9dPLpuaHeNnfb/kAifuczy0T20Y= Received: by mail-pj1-f43.google.com with SMTP id 22-20020a17090a0c16b0290164a5354ad0so9185221pjs.2; Sat, 05 Jun 2021 09:35:19 -0700 (PDT) X-Gm-Message-State: AOAM531Agx8VrbqAEAQJQtambbnDsRlKP5GFCekXBUOEnwFdW3jL3o55 EjRbKe+lgjeCSHTcs0s46yAsqUH507TgQrFTfiU= X-Received: by 2002:a17:90b:109:: with SMTP id p9mr23537983pjz.11.1622910919349; Sat, 05 Jun 2021 09:35:19 -0700 (PDT) MIME-Version: 1.0 References: <20210521161527.34607-1-mcroce@linux.microsoft.com> <20210521161527.34607-4-mcroce@linux.microsoft.com> <722e5567-d8ee-228c-978e-9d5966257bb1@gmail.com> In-Reply-To: <722e5567-d8ee-228c-978e-9d5966257bb1@gmail.com> From: Matteo Croce Date: Sat, 5 Jun 2021 18:34:43 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net-next v6 3/5] page_pool: Allow drivers to hint on SKB recycling To: David Ahern Cc: Ilias Apalodimas , Yunsheng Lin , netdev@vger.kernel.org, linux-mm@kvack.org, 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 , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Boris Pismenny , Arnd Bergmann , Andrew Morton , "Peter Zijlstra (Intel)" , Vlastimil Babka , Yu Zhao , Will Deacon , Fenghua Yu , Roman Gushchin , Hugh Dickins , Peter Xu , Jason Gunthorpe , Jonathan Lemon , Alexander Lobakin , Cong Wang , wenxu , Kevin Hao , Jakub Sitnicki , Marco Elver , Willem de Bruijn , Miaohe Lin , Guillaume Nault , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, bpf@vger.kernel.org, Matthew Wilcox , Eric Dumazet , Lorenzo Bianconi , Saeed Mahameed , Andrew Lunn , Paolo Abeni , Sven Auhagen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 5, 2021 at 6:06 PM David Ahern wrote: > > On 6/4/21 2:42 AM, Ilias Apalodimas wrote: > > [...] > >>> + /* Driver set this to memory recycling info. Reset it on recycle. > >>> + * This will *not* work for NIC using a split-page memory model. > >>> + * The page will be returned to the pool here regardless of the > >>> + * 'flipped' fragment being in use or not. > >>> + */ > >> > >> I am not sure I understand how does the last part of comment related > >> to the code below, as there is no driver using split-page memory model > >> will reach here because those driver will not call skb_mark_for_recycle(), > >> right? > >> > > > > Yes the comment is there to prohibit people (mlx5 only actually) to add the > > recycling bit on their driver. Because if they do it will *probably* work > > but they might get random corrupted packets which will be hard to debug. > > > > What's the complexity for getting it to work with split page model? > Since 1500 is the default MTU, requiring a page per packet means a lot > of wasted memory. We could create a new memory model, e.g. MEM_TYPE_PAGE_SPLIT, and restore the behavior present in the previous versions of this serie, which is, save xdp_mem_info in struct page. As this could slightly impact the performances, this can be added in a future change when the drivers which are doing it want to use this recycling api. -- per aspera ad upstream