Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1559842pxj; Sat, 8 May 2021 22:16:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0JRweNfX6ETAJdTi7vBURvJJvTZr5h35WBP+Q0Kk1j6O4NT87PrbZrwTG1hJbnGlAFQrE X-Received: by 2002:a50:9d4a:: with SMTP id j10mr18708007edk.378.1620537362318; Sat, 08 May 2021 22:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620537362; cv=none; d=google.com; s=arc-20160816; b=qVeuK0h55+Pcrl6Fjamw0EH9go04MqxMPQ331XuGkuxT8e1FKue8X8MM4OfoZZ0OD1 AiiVkuYRVcot+qclY3i8emy1cb0tfSPg9suvY0dbxTqf5+TsGwp38avXmrNW4w1zYnFQ YyPlsDM0/km53HmlSyKfER0KnuJFIxCYdtEL/f1gpfYPA4W3fAfvdcJqx4Bq0a4enMrK oR7MeQqbFqikdWmr3e0TXemiU0qrb601hGp5CDjQgLkSsXvR+CpW2GifouXem0dpORDo 6mY5m/1gAM7Q64Q2//tmJExMyV07g/DkIrVXZxM9LvKgwHjrXuIf3eEeSqDc6vW35joI 17jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to:subject :cc:to:from:user-agent:references:dkim-signature; bh=XVtQRWhA4CuXLzObdTcbpeSXr8ZueHXWK6PH9f+p+0w=; b=wLJXWw9orXJgTnl5Iw5YdF42oZPDO9GnLPrG8lvK9mOfAUZ+5u4oKREjLBmBA2m3Ca s4/H22jroUoKgP4uoSufLCrvcSi8jF+DMF5k8XT0BL5dBUHZ17IhlQ16Vdw2hM3cCW1W E99RVhWiFpmH3tQDyPdYbDOhhDOvIT8if3yeR18nRhxpE4gE0gYH6EgZUoESUgs696rm qN5dxbibfx5Es5BBERtaIU57q8UJZL9K+qoXAhw6iiDUlU7OlelTOSFDadSyHwieOpST 8t0pRUCWZmQrBzHKN+9gyS04LvrM6tKKM92J8Fe/dOheXlKmku47mWY4S7wwEqT6eFg2 hCQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=v1WPo1YH; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si9305954ejv.549.2021.05.08.22.15.37; Sat, 08 May 2021 22:16:02 -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=@amazon.com header.s=amazon201209 header.b=v1WPo1YH; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229615AbhEIFNs (ORCPT + 99 others); Sun, 9 May 2021 01:13:48 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:32241 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbhEIFNs (ORCPT ); Sun, 9 May 2021 01:13:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1620537165; x=1652073165; h=references:from:to:cc:subject:in-reply-to:date: message-id:mime-version; bh=XVtQRWhA4CuXLzObdTcbpeSXr8ZueHXWK6PH9f+p+0w=; b=v1WPo1YHYOKGrHFhZjvvAWMzbEDpvW1UOzGpiw4sJHHElau0nbELpCbG o4mg3/gFXyC8+nYa8Dxhjc7IrLPzLqW5QxtSdX3JBWds7y2cub0iSgwqs hR3C/Vl0uT2tb68ja6H9+d4CC4GVlK0/WTt27aPFHf4zvO+D16locrgkV M=; X-IronPort-AV: E=Sophos;i="5.82,284,1613433600"; d="scan'208";a="134015522" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-2b-c300ac87.us-west-2.amazon.com) ([10.25.36.210]) by smtp-border-fw-9102.sea19.amazon.com with ESMTP; 09 May 2021 05:12:39 +0000 Received: from EX13D28EUC001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2b-c300ac87.us-west-2.amazon.com (Postfix) with ESMTPS id 51476A17D3; Sun, 9 May 2021 05:12:22 +0000 (UTC) Received: from u570694869fb251.ant.amazon.com.amazon.com (10.43.160.119) by EX13D28EUC001.ant.amazon.com (10.43.164.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 9 May 2021 05:11:57 +0000 References: <20210409223801.104657-1-mcroce@linux.microsoft.com> <9bf7c5b3-c3cf-e669-051f-247aa8df5c5a@huawei.com> <33b02220-cc50-f6b2-c436-f4ec041d6bc4@huawei.com> <75a332fa-74e4-7b7b-553e-3a1a6cb85dff@huawei.com> <20210507121953.59e22aa8@carbon> User-agent: mu4e 1.4.15; emacs 27.1 From: Shay Agroskin To: Jesper Dangaard Brouer CC: Yunsheng Lin , Ilias Apalodimas , Matteo Croce , , , 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 , 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 , Guillaume Nault , , , , Matthew Wilcox , Eric Dumazet , David Ahern , Lorenzo Bianconi , Saeed Mahameed , Andrew Lunn , Paolo Abeni Subject: Re: [PATCH net-next v3 0/5] page_pool: recycle buffers In-Reply-To: <20210507121953.59e22aa8@carbon> Date: Sun, 9 May 2021 08:11:35 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Originating-IP: [10.43.160.119] X-ClientProxiedBy: EX13D13UWB002.ant.amazon.com (10.43.161.21) To EX13D28EUC001.ant.amazon.com (10.43.164.4) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jesper Dangaard Brouer writes: > On Fri, 7 May 2021 16:28:30 +0800 > Yunsheng Lin wrote: > >> On 2021/5/7 15:06, Ilias Apalodimas wrote: >> > On Fri, May 07, 2021 at 11:23:28AM +0800, Yunsheng Lin wrote: >> >> On 2021/5/6 20:58, Ilias Apalodimas wrote: >> >>>>>> >> >>>>> > ... >> > >> > >> > I think both choices are sane. What I am trying to explain >> > here, is >> > regardless of what we choose now, we can change it in the >> > future without >> > affecting the API consumers at all. What will change >> > internally is the way we >> > lookup the page pool pointer we are trying to recycle. >> >> It seems the below API need changing? >> +static inline void skb_mark_for_recycle(struct sk_buff *skb, >> struct page *page, >> + struct xdp_mem_info *mem) > > I don't think we need to change this API, to support future > memory > models. Notice that xdp_mem_info have a 'type' member. Hi, Providing that we will (possibly as a future optimization) store the pointer to the page pool in struct page instead of strcut xdp_mem_info, passing xdp_mem_info * instead of struct page_pool * would mean that for every packet we'll need to call xa = rhashtable_lookup(mem_id_ht, &mem->id, mem_id_rht_params); xa->page_pool; which might pressure the Dcache to fetch a pointer that might be present already in cache as part of driver's data-structures. I tend to agree with Yunsheng that it makes more sense to adjust the API for the clear use-case now rather than using xdp_mem_info indirection. It seems to me like the page signature provides the same information anyway and allows to support different memory types. Shay > > Naming in Computer Science is a hard problem ;-). Something that > seems > to confuse a lot of people is the naming of the struct > "xdp_mem_info". > Maybe we should have named it "mem_info" instead or > "net_mem_info", as > it doesn't indicate that the device is running XDP. > > I see XDP as the RX-layer before the network stack, that helps > drivers > to support different memory models, also for handling normal > packets > that doesn't get process by XDP, and the drivers doesn't even > need to > support XDP to use the "xdp_mem_info" type.