Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp358067rwb; Tue, 6 Dec 2022 22:38:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf5lkQvIrS0RQ+1XkjxuA1pb7p79ky3YY1w+28ZQaeS/aaYugzunUJQXAVmdHAgMGy+liOpL X-Received: by 2002:a17:906:660e:b0:78d:b43c:81be with SMTP id b14-20020a170906660e00b0078db43c81bemr66196402ejp.600.1670395081074; Tue, 06 Dec 2022 22:38:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670395081; cv=none; d=google.com; s=arc-20160816; b=BIVWkD9I8fRQLax0xc9jxghSBKSj3UiB5cP1yfzM2yz6mANBaN52imaxcU0G9JH0k1 wmFIZgHtF9p2NfJb5r30tXKVUAgALlSlYt0JIY+DbrGAAZkHpfNj1j0Hlsly9Lj9rVvr MKPe1eJ9h7cZ+22R25coPg2jz1SN740wgsNZzMqwt0eXeNuxBrbCB+jskZgYQe99C+0H RrlY9PoMBOV2Fwk3vBg9Jhak3sz0XiUtyLsLRAPxQiQcR0fNtu1f9OfwFH1zpgfSI0P4 GYsEt/a8/AerCk2oLRtkfAZF3CAS94Ix5XahmTYEhQfGLxAugMccMYmU2RUPt/gdxT1h pbSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id; bh=nyOK5oOLn35m+TODgZZPI2Dr5VQw5W7jbKDi4QgHBFw=; b=gDPWghy0go520Xtej2lxtW3NUcol7aUNqoU35evQrJU9/WdAfyloZ1UahwVtrKEa/4 nb6glaex1+/DagpIO0tkMSebcni+IhMAzNvGtdHu4QN6nTfVgM1EEnD8wVg78ASPKFBd z78AuYtgiWsa3GlXWB0mESClPiYFDqbM2Hm82DyWTKeErKmiuGugTEX/3ooXZwHclYOx aW6bAB3lzf1imRX9awNTUpCggg1oJ1uB/mKG9J3+kP6gqmgnWrh/8/kobzLBKGthfRd6 3VcrTivfAKNWiWY5M+gpNve90Gzgp4NhReF+3hh/y+ze+2sAclviMliUq3sUTmrFCr1H 3zbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg24-20020a170907971800b007ae30b550e5si16593909ejc.854.2022.12.06.22.37.42; Tue, 06 Dec 2022 22:38:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229589AbiLGG32 (ORCPT + 77 others); Wed, 7 Dec 2022 01:29:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbiLGG30 (ORCPT ); Wed, 7 Dec 2022 01:29:26 -0500 Received: from smtp.smtpout.orange.fr (smtp-25.smtpout.orange.fr [80.12.242.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3539359867 for ; Tue, 6 Dec 2022 22:29:23 -0800 (PST) Received: from [192.168.1.18] ([86.243.100.34]) by smtp.orange.fr with ESMTPA id 2nvjps6kw1LdI2nvjpWyzz; Wed, 07 Dec 2022 07:29:20 +0100 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 07 Dec 2022 07:29:20 +0100 X-ME-IP: 86.243.100.34 Message-ID: <3ac4ee1a-b6ad-283d-6747-1b2e15fb27f3@wanadoo.fr> Date: Wed, 7 Dec 2022 07:29:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 From: Christophe JAILLET Subject: Re: [PATCH] packet: Don't include To: Eric Dumazet Cc: "David S. Miller" , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, netdev@vger.kernel.org References: Content-Language: fr, en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 05/12/2022 à 06:24, Eric Dumazet a écrit : > On Sat, Dec 3, 2022 at 5:49 PM Christophe JAILLET > wrote: >> >> There is no need to include here. >> >> Prefer the less invasive which is needed for 'hlist_head'. >> >> Signed-off-by: Christophe JAILLET >> --- >> Let see if build-bots agree with me! >> > > net/packet/af_packet.c does not explicitly include linux/rculist.h > > It might be provided by include/linux/netdevice.h, but I wonder if > this is best practice. At least, it is not what I expect. My goal is to avoid some unneeded includes AND the related indirect needed includes that are buried somewhere in the dependency hell. I missed the one in af_packet.c I'll repost a v2 with the fix for af_packet.c (and double-check if some other are also needed) > >> Just declaring 'struct mutex' and 'struct hlist_head' would also be an >> option. > > I do not get it, see [1] Just forget about it. Requirement for: struct my_struct { struct another_struct x; and struct my_struct { struct another_struct *x; ~~~ are not the same, even if 'my_struct' is not used at all... (*ashamed *) CJ > >> It would remove the need of any include, but is more likely to break >> something. > > I do not see why you are even trying this ? > >> --- >> include/net/netns/packet.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/include/net/netns/packet.h b/include/net/netns/packet.h >> index aae69bb43cde..74750865df36 100644 >> --- a/include/net/netns/packet.h >> +++ b/include/net/netns/packet.h >> @@ -5,8 +5,8 @@ >> #ifndef __NETNS_PACKET_H__ >> #define __NETNS_PACKET_H__ >> >> -#include >> #include >> +#include >> >> struct netns_packet { >> struct mutex sklist_lock; > > [1] Definition of 'struct mutex' is definitely needed here. > >> -- >> 2.34.1 >> >