Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp126368iob; Tue, 17 May 2022 21:06:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyFmmnr3GnQArGpDJAZOYzdk7dPm8kFMZXjHgfVEgACaiVXHHrVxvVX+Pqm4kdgjlrmDF3 X-Received: by 2002:a05:6a00:b41:b0:50d:35fa:476d with SMTP id p1-20020a056a000b4100b0050d35fa476dmr25954890pfo.33.1652846776104; Tue, 17 May 2022 21:06:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652846776; cv=none; d=google.com; s=arc-20160816; b=Bz7HVInrB33HA/lPqi3mX7/KOX9YQ8dtl6q3lQcdNuy6Du3emm2MJKD4+c5NGdJO5D GTED3iZ87vYjK1VHUwxH6tMRk+zBR7BdnifjJ2NpxHEr/9ALYh0+TE2irpuLqJTSOkUl IYVx3NE46DALjt7DIaSy+Vp9Q8h2gHNHzYw04T7EObtVPOr95LPS0m8DYJGkCS41Mhvm h1ut9UpyHahFsD+2cNuYurJylqR2JPfCjSOv/JofjbgM6KahqdVSkXsyw3CqMC/5nP2/ QKzL7FbQQn9CgqmGEYuahKT5xeq8y2ik07vwK61FUfUCICCNgAEhrdx4KFy9jkytzydQ PMsA== 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=bqzCtFjgTUeoMKq0jc3gRTgVsZZ79GTpEF7UawaP29k=; b=d53Nga9m/2DTffeds2RnJYHI5tGFSMgsZXg5dvmXpFjA7LuUs9MA3qr1Jt/zHtRXzL Bcs69+p5FzXZePjkdeBmrM5mYF6ZjR2Zf20pXIfL1rGlrSSZz3maKwNaiCI24TPFIyQ8 qU4ClRMQzzAGStmeMDCM0zU8d9oITLPG5lujS4eOGbWqfrEv28Z507WMQ6rPsQAdVxDd Nh0soV4mHpGcon8OoXpRf0q1xah8af/KeDMypo7uDNT5gKIBh7CwXGlazbcH06GQbqtN iSOiR6Yb/jH9StgPPq1RTTIymUpFRxYkAIzuzgTLorgCndi9FZGfHeXnbBaMR5HmCaDH sSEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rMfmaF2j; 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 g6-20020a656cc6000000b003f26b211c84si1055385pgw.349.2022.05.17.21.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:06:16 -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=rMfmaF2j; 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 E263C6C564; Tue, 17 May 2022 20:40:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348819AbiEQTuB (ORCPT + 70 others); Tue, 17 May 2022 15:50:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352878AbiEQTtv (ORCPT ); Tue, 17 May 2022 15:49:51 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0878C522F4; Tue, 17 May 2022 12:49:47 -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 sin.source.kernel.org (Postfix) with ESMTPS id 3BEAFCE1C2E; Tue, 17 May 2022 19:49:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1404CC385B8; Tue, 17 May 2022 19:49:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652816984; bh=8Vh3M3tm6VPH+uYWWUnPKertgAz3IANS4NLNGdL1+T8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rMfmaF2jqEP0GdDSmMJD2CPlj+To9i/T2Xu8ZBxkWHjrDNWqtZYWCoQBadeYN7YXT zgyBNmsvHdujCCuYROcukp7F6NFBaxSAIL9qKCD4cp5uw3lnBtAR/Oq8lLZ+jS9dGG xBZius/+AV4S4LaRFK373WxecrquyxpkExVMaf7WH/7ovnFhHtIIqSQWi+OO69Oqeb eFvA2X/unEYHoJ7uDs0ALCr5tI8q0e9RETyvxkdmHtqmp3uIo4oPpQaKLFMPjXPURr EaadW/+4jADSbKYLKZ5RHVhippxWeOZIwxRuJPQsSq1qGRRW+2q05hrGhl9FbtIrNO U/I2zsmiBCUNg== Date: Tue, 17 May 2022 12:49:42 -0700 From: Jakub Kicinski To: Alexander Aring Cc: Florian Fainelli , "David S. Miller" , Network Development , edumazet@google.com, Paolo Abeni , johannes@sipsolutions.net, Alexander Aring , Stefan Schmidt , mareklindner@neomailbox.ch, sw@simonwunderlich.de, a@unstable.cc, sven@narfation.org, linux-wireless@vger.kernel.org, linux-wpan - ML Subject: Re: [PATCH net-next] net: ifdefy the wireless pointers in struct net_device Message-ID: <20220517124942.7e89216a@kernel.org> In-Reply-To: References: <20220516215638.1787257-1-kuba@kernel.org> <8e9f1b04-d17b-2812-22bb-e62b5560aa6e@gmail.com> 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 15:33:02 -0400 Alexander Aring wrote: > > 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? > > note that ieee802154 has also functionality like __dev_get_by_index() > and checks via "if (netdev->ieee802154_ptr)" if it's a wpan interface > or not, guess the solution would be like it's done in wireless then. Ack, but that code must live somewhere under #if IS_ENABLED(CONFIG_IEEE802154) || IS_ENABLED(CONFIG_6LOWPAN) otherwise I think I'd see a build failure. I guess a nice thing about having the typed pointers is that we can depend on the compiler for basic checking :)