Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp116654iob; Tue, 17 May 2022 20:46:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysE+RlDbeb9e27EuwI/Col2yUwW5I1ZKS6/shLzZ1iK5uE7SkKoswuj07LixXcYpHUSul5 X-Received: by 2002:a17:902:b703:b0:15e:ea16:2c6e with SMTP id d3-20020a170902b70300b0015eea162c6emr25290804pls.100.1652845611917; Tue, 17 May 2022 20:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652845611; cv=none; d=google.com; s=arc-20160816; b=u+YiqeSMrdPKswSLo20u11Opm8C7SGjbVnDttbbkeSrz8M4RNNGBRTkaxG8Lb4kfug 0ZlKFC20vw+g7WuCGQqehVnBA2i7L12zsI+MYNPdCUaJ563XqmvSvrDpQUpyuoh2WB+x fwrjjRnyX0LEj1yClFAI8RFrxkp6YWOacsglanVC+Ppx1Jn6Ve8/OPa5cI86YQdu0Ehc luMyZLBkbLm10Xr/aQ7nFweu7hnL0AYj/xYHPvpK6mVxE78fNu6zZWzpE9byJ4XsgREd +ykKOVcnSNlJKgGWzkC5KwkAUaFPawHV67LFrS71+w89avBa/f6D5HQmt/lzoI/5Jcy2 No2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=bSHMh0MkHwz6Uil7fdxpKtFbpVRjAd/QdjL2Da66I+Q=; b=Bu1JY5E1lzuF3BacaqlLbAlz1KG7R2W2Ydbop6GFrGnisQKolRdZvu2O+Yn5tiwVlD g9DuAv5dEQPWf8LVb8YOEZDHoSygbMJZldSG1NdaB496TpEymQC7tYAyK4X+wQARGUft EgycVkHHN6rdVfc1ABY+XdaRJ/JRL6YDORpfAv9ljGXzkGCTDze4wPwSLs28h13RfH6z jiYgfXgQecH+6ovkXx1XnTlHhyZXOgJrUKpSN3IO3l5Ip3TpdrN3eHhE5JN0tzmKr/Y3 +supPpqR4DHqKiuxHxbV5loe50KcAjb+5f0lmSYZNhX5WxlamIEYzpS9HqXGW9dMTU42 atcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="I5kAF3I/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t9-20020a17090aba8900b001decaeaf1easi1226080pjr.6.2022.05.17.20.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 20:46:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="I5kAF3I/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2863F6F48A; Tue, 17 May 2022 20:31:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351512AbiEQRiF (ORCPT + 70 others); Tue, 17 May 2022 13:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351501AbiEQRiD (ORCPT ); Tue, 17 May 2022 13:38:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EC2D3A18E; Tue, 17 May 2022 10:38:02 -0700 (PDT) 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 343A6B81B18; Tue, 17 May 2022 17:38:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82BF6C385B8; Tue, 17 May 2022 17:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652809080; bh=eHifGayDG02quoV3KcJSM+PxEDMZbY8lAV/ptLfgFvM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=I5kAF3I/AUbaMnhhKAimpquiSrx5qPouEKWy+HiK6ll1MuFC+ZQ/CRNvNLRMxWWiv OrdhZaLWneMrYP8oaN1bqO29C0RQCkLY2a7BsSB+/lAn9UcZpJ+8ExeBuA45n0Y2Ui LlEFcrQ1rI34YVg7s100GRSK9jDE7hNzV/X1rUBUHpZmLBADNzm6w4hVP9/cl0KZwP 8XNxUeLUfyuUO9mb5zFChF3PvCVunKudgTXZltGi3atXRWlqYLRLzFrttc4JNZuRma F/pxcMYztZPQOHcwCvnX4d/HKYKGnEkVRax6QUemNClmKfA95fQP+fZfa/VEV7dFZr sv8ohsqoDSuPw== Date: Tue, 17 May 2022 10:37:58 -0700 From: Jakub Kicinski To: Johannes Berg Cc: Florian Fainelli , davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, alex.aring@gmail.com, stefan@datenfreihafen.org, mareklindner@neomailbox.ch, sw@simonwunderlich.de, a@unstable.cc, sven@narfation.org, linux-wireless@vger.kernel.org, linux-wpan@vger.kernel.org Subject: Re: [PATCH net-next] net: ifdefy the wireless pointers in struct net_device Message-ID: <20220517103758.353c2476@kernel.org> In-Reply-To: <74bdbec0580ed05d0f18533eae9af50bc0a4a0ef.camel@sipsolutions.net> References: <20220516215638.1787257-1-kuba@kernel.org> <8e9f1b04-d17b-2812-22bb-e62b5560aa6e@gmail.com> <74bdbec0580ed05d0f18533eae9af50bc0a4a0ef.camel@sipsolutions.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-wireless@vger.kernel.org On Tue, 17 May 2022 09:48:24 +0200 Johannes Berg wrote: > On Mon, 2022-05-16 at 19:12 -0700, Florian Fainelli wrote: > > > > On 5/16/2022 2:56 PM, Jakub Kicinski wrote: > > > Most protocol-specific pointers in struct net_device are under > > > a respective ifdef. Wireless is the notable exception. Since > > > there's a sizable number of custom-built kernels for datacenter > > > workloads which don't build wireless it seems reasonable to > > > ifdefy those pointers as well. > > > > > > While at it move IPv4 and IPv6 pointers up, those are special > > > for obvious reasons. > > > > > > Signed-off-by: Jakub Kicinski > > > > Could not we move to an union of pointers in the future since in many > > cases a network device can only have one of those pointers at any given > > time? > > Then at the very least we'd need some kind of type that we can assign to > disambiguate, because today e.g. we have a netdev notifier (and other > code) that could get a non-wireless netdev and check like this: > > static int cfg80211_netdev_notifier_call(struct notifier_block *nb, > unsigned long state, void *ptr) > { > struct net_device *dev = netdev_notifier_info_to_dev(ptr); > struct wireless_dev *wdev = dev->ieee80211_ptr; > [...] > if (!wdev) > return NOTIFY_DONE; Can we use enum netdev_ml_priv_type netdev::ml_priv and netdev::ml_priv_type for this?