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 593D4C4743D for ; Sat, 5 Jun 2021 16:35:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3362F6141D for ; Sat, 5 Jun 2021 16:35:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230060AbhFEQhJ (ORCPT ); Sat, 5 Jun 2021 12:37:09 -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-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" Precedence: bulk List-ID: X-Mailing-List: netdev@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