From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73BE8C48BCD for ; Sat, 5 Jun 2021 16:35:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E3A6361415 for ; Sat, 5 Jun 2021 16:35:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3A6361415 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5604E6B0036; Sat, 5 Jun 2021 12:35:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 50F306B006E; Sat, 5 Jun 2021 12:35:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 389CC6B0070; Sat, 5 Jun 2021 12:35:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0129.hostedemail.com [216.40.44.129]) by kanga.kvack.org (Postfix) with ESMTP id 0383B6B0036 for ; Sat, 5 Jun 2021 12:35:21 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 87A47181AEF00 for ; Sat, 5 Jun 2021 16:35:21 +0000 (UTC) X-FDA: 78220220442.16.CAA6994 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by imf07.hostedemail.com (Postfix) with ESMTP id 185BEA00014E for ; Sat, 5 Jun 2021 16:35:19 +0000 (UTC) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by linux.microsoft.com (Postfix) with ESMTPSA id 00B5120B802D for ; Sat, 5 Jun 2021 09:35:19 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 00B5120B802D 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-f45.google.com with SMTP id 22-20020a17090a0c16b0290164a5354ad0so9185226pjs.2 for ; Sat, 05 Jun 2021 09:35:19 -0700 (PDT) X-Gm-Message-State: AOAM530menKE1A9mXtYCYdTq890YEH/x7OC1KUpwriTbj0rUE21rGMy4 hub3EVrmboHZwGRzXekw+Bu9CSbXgWprOUJtB7g= X-Google-Smtp-Source: ABdhPJygiZdUBMofrvGIJKnAiSIUtdPe75CqrwuMthYT+s5sMbTwwbqXGEATDjb4JXV1JYjGO5sE09p+XSOr4C1NyS8= 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" Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=sTFupoEn; spf=pass (imf07.hostedemail.com: domain of mcroce@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=mcroce@linux.microsoft.com; dmarc=pass (policy=none) header.from=linux.microsoft.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 185BEA00014E X-Stat-Signature: gyaq3jq33n5mjqi7doi6t6qof8ijjwki X-HE-Tag: 1622910919-692243 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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