Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4338178pxj; Tue, 25 May 2021 05:55:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbFbxgbpwF444vXwhdJ6tNELGCp1cnp3cRyzxRlTI8Ad6TU+7UB+Pk4E8VeznECHFthuND X-Received: by 2002:a17:906:1311:: with SMTP id w17mr29760470ejb.182.1621947348776; Tue, 25 May 2021 05:55:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621947348; cv=none; d=google.com; s=arc-20160816; b=zGr16OBkiU4EEufNVZ1NW3m6ayXJfJCZ67P4dx8wQ0GP7SXyOpsTe9nFES00Z07hgG 1orBDSkFdWmxRf5kEQAQWJQl/0360yBDQLb0tFDrTRz0dZNCgBCfqyuUWRT07wEmCpmb iihghPyi7SoeXk06x4gI/MigFPH6lzOQURrLT1+vNwI9mByYwA2K+1XtpHTlOlVoIg1S QqZhHL3OszdLOqe4yrKWYsZUuFXdOC7241iK0crxOF9MNHrihtxpRRGkMB0yHzLOYtKq Q8bp8TmyVEOB405bjawptTeX/c0uGAgAf8R98xFepcZfo+ucPe7hlyAyaqgA9fdx4Joj 9spA== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=4iFLrLwneJITGdkkBO4svJGt8qwi5j4X5/XlCCm7/3E=; b=OpsGysuhiEz7VQiDmXRby58wQqKCx3OWgA7rnMaymViFztK1m7y7kCX9JPfQ5c0N5w qEkkszYGCKw0iPA4tzk7oiS/fQDoZpyc5DWIR0enaF+CtgPJ9VLgF84TmoS9qILcE/PF 9AlvyJBbqEqbQwysfjvCedc7urOQ/P5SzAzPoNCBjb2va0RtInSKHsWh2mgmPeBoDaeC 8VYsEg7rf/e8CNNct1UnMCa1AceFHSaPh//ByCvSeaPf7Wm7mKuSRDzzk6dvm/HufMvb H6qNNungd0s5c/Op9lo93vD4rpFwttxbO7R1r3+fCxXzbTHnfnJWj3I+fDbb0tfYbo// gn/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si15999965ejj.11.2021.05.25.05.55.23; Tue, 25 May 2021 05:55:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232766AbhEYM4o (ORCPT + 99 others); Tue, 25 May 2021 08:56:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231847AbhEYM4n (ORCPT ); Tue, 25 May 2021 08:56:43 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77DA3C061574; Tue, 25 May 2021 05:55:13 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1llWaU-00EOe9-9l; Tue, 25 May 2021 14:55:10 +0200 Message-ID: Subject: Re: [PATCH V3 15/16] net: iosm: net driver From: Johannes Berg To: Loic Poulain , "Kumar, M Chetan" Cc: Network Development , "linux-wireless@vger.kernel.org" , "Sudi, Krishna C" , linuxwwan , Dan Williams , =?ISO-8859-1?Q?Bj=F8rn?= Mork , Jakub Kicinski Date: Tue, 25 May 2021 14:55:09 +0200 In-Reply-To: (sfid-20210525_101545_116148_0A5A9BB6) References: <20210520140158.10132-1-m.chetan.kumar@intel.com> <20210520140158.10132-16-m.chetan.kumar@intel.com> <90f93c17164a4d8299d17a02b1f15bfa@intel.com> (sfid-20210525_101545_116148_0A5A9BB6) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, 2021-05-25 at 10:24 +0200, Loic Poulain wrote: > > > > Can you please share us more details on wwan_core changes(if any)/how we should > > use /sys/class/wwan0 for link creation ? > > Well, move rtnetlink ops to wwan_core (or wwan_rtnetlink), and parse > netlink parameters into the wwan core. Add support for registering > `wwan_ops`, something like: > wwan_register_ops(wwan_ops *ops, struct device *wwan_root_device) > > The ops could be basically: > struct wwan_ops { >     int (*add_intf)(struct device *wwan_root_device, const char *name, > struct wwan_intf_params *params); >     int (*del_intf) ... > } > > Then you could implement your own ops in iosm, with ios_add_intf() > allocating and registering the netdev as you already do. > struct wwan_intf_params would contain parameters of the interface, > like the session_id (and possibly extended later with others, like > checksum offload, etc...). > > What do you think? Note that I kind of tried this in my version back when: https://lore.kernel.org/netdev/20200225105149.59963c95aa29.Id0e40565452d0d5bb9ce5cc00b8755ec96db8559@changeid/#Z30include:net:wwan.h See struct wwan_component_device_ops. I had a different *generic* netlink family rather than rtnetlink ops, but that's mostly an implementation detail. I tend to like genetlink better, but having rtnetlink makes it easier in iproute2 (though it has some generic netlink code too, of course.) Nobody really seemed all that interested back then. And frankly, I'm really annoyed that while all of this played out we let QMI enter the tree with their home-grown stuff (and dummy netdevs, FWIW), *then* said the IOSM driver has to go to rtnetlink ops like them, instead of what older drivers are doing, and *now* are shifting goalposts again towards something like the framework I started writing early on for the IOSM driver, while the QMI driver was happening, and nobody cared ... Yeah, life's not fair and all that, but it does kind of feel like arbitrary shifting of the goal posts, while QMI is already in tree. Of course it's not like we have a competition with them here, but having some help from there would've been nice. Oh well. Not that I disagree with any of this, it does technically make sense. However, I think at this point it'd be good to see some comments here from DaveM/Jakub that they're going to force Qualcomm to also go down this route, because they're now *heavily* invested in their own APIs, and inventing a framework just for the IOSM driver is fairly pointless. > I also plan to submit a change to add a wwan_register_netdevice() > function (similarly to WiFi cfg80211_register_netdevice), that could > be used instead of register_netdevice(), basically factorizing wwan > netdev registration (add "wwan" dev_type, add sysfs link to the 'wwan' > device...). Be careful with that, I tend to think we made some mistakes in this area, look at the recent locking things there. We used to do stuff from a netdev notifier, and that has caused all kinds of pain recently when I reworked the locking to not be so overly dependent on the RTNL all the time (which really has become the new BKL, at least for desktop work, sometimes I can't even type in the UI when the RTNL is blocked). So wwan_register_netdevice() is probably fine, doing netdev notifier I'd now recommend against. But in any case, that's just a side thread. johannes