From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0006321D; Thu, 11 Jul 2024 01:22:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720660926; cv=none; b=OoB2JSqr0fMkK+OsRZGsYqFJrhQh3XNFOOOzqnKdSxHm1P4ldTF7T/FRwVmoZpj0N8I1nUpinDOHaT+pFbvkGqw1A+aovtohyifTLoJjM1Ltvz/LYO5k16uaDJNfkVAEn2hDxZC/0anyhX29OK+XNr+oNO2lrAohhqyK4djcd6c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720660926; c=relaxed/simple; bh=QjOULS8b+CZJ29PyHWRuJmie+Hn55IcoVG3HP/3LohE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VnLLlJrh8akdwLMbZgs6JyUadYlISBRD8TKjtAK0oRxNmJsBE4UHUK+CaoBHXWev/sMdN+uNmXaSy98TkuseZ9dbLyMGkdIwQ1UHDi6b5GP4U2+RbFNtsJ4m0J4TdBYOVW+eLRZhesxjMkORYNlidiT1d3CLO/iDP0omG8gj5/g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Nu7j9vqd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Nu7j9vqd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAA79C32781; Thu, 11 Jul 2024 01:22:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720660925; bh=QjOULS8b+CZJ29PyHWRuJmie+Hn55IcoVG3HP/3LohE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Nu7j9vqdXFB65PlvnMG07kLL4ivK1FfVmXPHqTj2KJK596Mc9VqYs9lJeZEnKP7ON zXThKeg9bymdodZ2PIefG7emFD2gdT5qBsgTLm+H20XqJqPqzN0EFhC0m76b69HAKY IYbR340PfQzawxYhWyFufDRPBQHIiiklguQ7ygzJqm+l2Li6ovHnuc9HjM2IhUp6DQ /pG5oYdKyNVQMInWszt3EtEL8K4E758yZUnsbrn5XLQuIRBzGAmZ53YVSi6XiVF6Hp w6+ekApzB8N7QHyw3aeV+j7GzkIcFhh/EmmQxXvlulGRFFFtOWh1wCj2EME4SmvAhb q7RK7aphR1DUQ== Date: Wed, 10 Jul 2024 18:22:02 -0700 From: Jakub Kicinski To: Mina Almasry Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, bpf@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, Donald Hunter , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Andreas Larsson , Jesper Dangaard Brouer , Ilias Apalodimas , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Arnd Bergmann , Steffen Klassert , Herbert Xu , David Ahern , Willem de Bruijn , Shuah Khan , Sumit Semwal , Christian =?UTF-8?B?S8O2bmln?= , Bagas Sanjaya , Christoph Hellwig , Nikolay Aleksandrov , Taehee Yoo , Pavel Begunkov , David Wei , Jason Gunthorpe , Yunsheng Lin , Shailend Chand , Harshitha Ramamurthy , Shakeel Butt , Jeroen de Borst , Praveen Kaligineedi , linux-mm@kvack.org, Matthew Wilcox Subject: Re: [PATCH net-next v16 05/13] page_pool: devmem support Message-ID: <20240710182202.0324279f@kernel.org> In-Reply-To: References: <20240710001749.1388631-1-almasrymina@google.com> <20240710001749.1388631-6-almasrymina@google.com> <20240710094900.0f808684@kernel.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 10 Jul 2024 13:29:03 -0700 Mina Almasry wrote: > If we want to add __skb_frag_ref() support for net_iov I suggest something like: > > diff --git a/include/linux/skbuff_ref.h b/include/linux/skbuff_ref.h > index 0f3c58007488a..02f7f4c7d4821 100644 > --- a/include/linux/skbuff_ref.h > +++ b/include/linux/skbuff_ref.h > @@ -17,7 +17,13 @@ > */ > static inline void __skb_frag_ref(skb_frag_t *frag) > { > - get_page(skb_frag_page(frag)); > + netmem_ref netmem = skb_frag_netmem(frag); > + > + /* netmem always uses pp-refs for refcounting. Never non-pp refs. */ > + if (!netmem_is_net_iov(netmem)) > + get_page(netmem_to_page(netmem)); > + else > + page_pool_ref_netmem(netmem); > } Probably not much better since freeing still looks at the recycle bit. Eric and Willem acked patch 8, maybe it works, and if it doesn't we know who to call :) I can't point out any case that won't work so if y'all think this is fine, let's leave it.