Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 830A4C433F5 for ; Sat, 1 Jan 2022 02:22:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231958AbiAACW3 (ORCPT ); Fri, 31 Dec 2021 21:22:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231938AbiAACW2 (ORCPT ); Fri, 31 Dec 2021 21:22:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 214CCC061574; Fri, 31 Dec 2021 18:22:28 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C3E3BB81D57; Sat, 1 Jan 2022 02:22:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9ED2DC36AEC; Sat, 1 Jan 2022 02:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1641003745; bh=APz4Jtsyu1sUD/EnSPVj4YAQO/qc9RwHaadctv1OyBw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oSzK52le/t8R9DqJxqmxoYsdRPxFhvrvZcoPqPCrFPHqM4ziCkYcKuX6oH4IkLONp C3DVB/joGYpK7j/d2DG8Za5o8fjHc8QoTWIWktvw8UDdPAxkC+loKcbpuX+4AuYa7U 2qzbZSIk5Ad/oZapumsR6y8ng7yI382Hupn9Kdf/nPJCgA8MOM2H+u3ZampoYe9tdN H49SeWt8zvEBqAaSlurJdM3oSjOX0AId0QH/JnAT60ISQ5BbYPjSn2CauwcNUTCq5j L+YAuaejs9PngWhJ2J6sPGv95bbpoXtRbuEs83el6Ac4kDQl/710kdVjkTCKHE3RrF tzNC93/19AY2w== Date: Fri, 31 Dec 2021 18:22:23 -0800 From: Jakub Kicinski To: Menglong Dong Cc: Steven Rostedt , David Ahern , mingo@redhat.com, David Miller , Neil Horman , Eric Dumazet , Hideaki YOSHIFUJI , jonathan.lemon@gmail.com, alobakin@pm.me, Kees Cook , Paolo Abeni , talalahmad@google.com, haokexin@gmail.com, Menglong Dong , atenart@kernel.org, bigeasy@linutronix.de, Wei Wang , arnd@arndb.de, vvs@virtuozzo.com, Cong Wang , LKML , netdev , Mengen Sun , mungerjiang@tencent.com Subject: Re: [PATCH v2 net-next 1/3] net: skb: introduce kfree_skb_with_reason() Message-ID: <20211231182223.43afa349@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> In-Reply-To: References: <20211230093240.1125937-1-imagedong@tencent.com> <20211230093240.1125937-2-imagedong@tencent.com> <20211230172619.40603ff3@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 31 Dec 2021 14:35:31 +0800 Menglong Dong wrote: > > > void skb_release_head_state(struct sk_buff *skb); > > > void kfree_skb(struct sk_buff *skb); > > > > Should this be turned into a static inline calling > > kfree_skb_with_reason() now? BTW you should drop the > > '_with'. > > > > I thought about it before, but I'm a little afraid that some users may trace > kfree_skb() with kprobe, making it inline may not be friendly to them? Hm, there is a bpf sample which does that, but that's probably not commonly used given there is a tracepoint. If someone is using a kprobe they can switch to kprobing kfree_skb*reason().