Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp4224984rba; Tue, 2 Apr 2024 10:38:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUjp9SONUxJfdKuPCTPwMDsema4lspRzI+BSjLrpIuVuBL9Be1tsdWkuPC9dpf2dUwbZ4ZaqhP7AOYl0GDHB6RfULa8zCnQQ0Dh/F1r1Q== X-Google-Smtp-Source: AGHT+IHWsdYtfG33kfQgVra4kyDowp9IhoOAHVDs1gVf/R8PGiEZP4iX7MIYEA6UNJD+OsLCNIIP X-Received: by 2002:ac2:4c0e:0:b0:513:b1d7:6d07 with SMTP id t14-20020ac24c0e000000b00513b1d76d07mr150137lfq.58.1712079526542; Tue, 02 Apr 2024 10:38:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712079526; cv=pass; d=google.com; s=arc-20160816; b=S0+6wpUWx2MIopR4ntkropmYjYebDfpyUWA7II9LhDbPDv1NSpCojK51hMYfEtt6Cc YEZK4tCIi5wkxJLYwAVi7H4CiqXyk/ETOFw0Aj9TMEEzh7WprYvhqUgt4JEQgtv5gf3F bRhXOUhGJ2KlL6UDkqbqrdLlC+8tO9XOiZAxg86Hjm0limp6xaW+qAK5KIAe4M4+mFg/ SszQrZUeXtwULG8H70Wa1fJe43zj3WExEd8X28Z3HPSRyXhk4R0+5RQEi72mQgm8TlgP sWEy1SBF9oT30sZU7dRcCEqemcFj4vzNamlWprCR+9u4H6yihQoxVnPcSogIvyTi5xBB Fl4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HtrkSh59QkjttbNzKcHQJ3LYMjwTS4ircoPC1SuYzsc=; fh=QvRZZHglr7mauvwp4exEsAbsDlwngpQj7Zjv8DYbedc=; b=ozkgcyTf0wwtgVqw0nKz/iDnR6wrcGkey/o6VZf62Qq51C6w6lq6O0dJjlbpHRyNJn 56RLq10JfSWJABdKLAdv0LxiG5T7V7Y+eD1V9oXIpdASBIiEqgl1Ja2Ict9fewUAtiG4 EvhtrPQi7OK8J+R6DapTRApHohEz7hPodfoUqWZ+8UXg926awKzO9cxK0aT8hyb26nyt NXJ7R3JpeXiS1HRynolYXSmaay1VJyPmqQCvzmAPasWMHRB8a+QpVbfs4E/EvaenDFFR D72OChXpIgSQraW1Y8jMp2hY7pQhKffQs4dku4fjTnJWAmL+OcMpsT3lIKP9Dq4rl8f7 ULhQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="cwYm0/+M"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-wireless+bounces-5754-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5754-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gb36-20020a170907962400b00a4e283893dcsi5774085ejc.531.2024.04.02.10.38.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 10:38:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5754-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="cwYm0/+M"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-wireless+bounces-5754-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5754-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 231B21F21E5E for ; Tue, 2 Apr 2024 17:38:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 98CBE15A4A9; Tue, 2 Apr 2024 17:38:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="cwYm0/+M" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCD5E15A4A6 for ; Tue, 2 Apr 2024 17:38:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712079523; cv=none; b=jWLB/UAce8aYas494x9dy6+xH3nzM2whvhEKF0yNDdludYBLo6ptI24jgoA1JHC1izebZoVBU+i2cCchjT07H6dfRu4iABXO1WwUyNr+/rTbRIoz3RS+OjmOWwVi+TP9sRBqmHn/smEKS36tPYnin8R/C76j54ovU+GG52R50Iw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712079523; c=relaxed/simple; bh=mjehrL1CeGLW4kKW6mfOdXsxoEA+KJygo9ZmNvXCcmw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SuiCmBpzwd+WAkr7Qjsi4fSoftvGM6lkB06n127eUegRxVvnEeJ2lcRA0Yg5PW2glSCJ+NwqQgRW+GCtoCJcDD7B0aCEGKnPD/9W48nyxKGBYKhgPhYcdFqhi/1eSyu71HPlfYhAIzQpJgBk+l3gmPE6KDlfbgzpJhCSbbtIuTI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=cwYm0/+M; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6e6afb754fcso5180077b3a.3 for ; Tue, 02 Apr 2024 10:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1712079521; x=1712684321; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=HtrkSh59QkjttbNzKcHQJ3LYMjwTS4ircoPC1SuYzsc=; b=cwYm0/+MP90FD7gcZnZWzAQ1lF6KtZlZ8o0M7ZMvq/P/0O8M1el4K2bZUHzle+WU8w gF1IAfpS3MVTt2+Kkocb2BodYAiDwsGxNSbW7nciozRHzLZ1YhyBZlRsbxvekcqoo6pE qIVFfAk71n4D1B5yQSYnhiH0oBFXgHd25BAxc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712079521; x=1712684321; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HtrkSh59QkjttbNzKcHQJ3LYMjwTS4ircoPC1SuYzsc=; b=LiQTyRYOAAOrL5wsXJeShx5Tf4dyK/aYgY1qj4oQUnxC+iNNqhZ4CEzdFW0yqW5uOD jKEHhF4v6qossTNW6BuzdTpmEgL5hJ5ZScBX1yVOquhWfwHbfceXlz9MKvRzGNHgbnrh cTu6Zery5Aa56B5N/lXyDSzFq+UYfL2OXo1yTOKtRgMhXWwphA36fHf1K1IRQYoom+Zh sRNhx+pBIgSZgVCPr9PTVq1J0imSN2wOsqZ/TgTW6099lg62xR0G9SXF6nf2VjNhnVOK knK40O1FcKQRpRFVWhr6gLUSNGbc6NgTCb1PoS5pU2uWO0k3OT45bzcII1Yybpk9cmh/ rExg== X-Forwarded-Encrypted: i=1; AJvYcCWkoBcbYd4mrqvJwJ6Iju/pA2xYH9DVQHFZnLOuOTq2dlQWnmZ44wN1ldkFiwgQBaMTf6Ux5yQZXPTVxRiR1OvR/X0dJaiTCUV/hJ5UJEw= X-Gm-Message-State: AOJu0Yx3EU/mLHiqRcAxoSkmnwwsu4W543WH+xYH65JtkD95/93GActu GhalZSvFUAnaXU239NeUfqDa76s7MKhZ1VOhIihr8urXZCvcA1T/J/45Vf2v2g== X-Received: by 2002:a05:6a20:7354:b0:1a7:23ae:92c3 with SMTP id v20-20020a056a20735400b001a723ae92c3mr2197471pzc.12.1712079520977; Tue, 02 Apr 2024 10:38:40 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:73c6:f4e5:23b5:e248]) by smtp.gmail.com with UTF8SMTPSA id n4-20020a170903110400b001dcc7795524sm11363589plh.24.2024.04.02.10.38.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Apr 2024 10:38:40 -0700 (PDT) Date: Tue, 2 Apr 2024 10:38:38 -0700 From: Brian Norris To: David Lin , Johannes Berg Cc: Johannes Berg , Francesco Dolcini , "kvalo@kernel.org" , "linux-wireless@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Pete Hsieh , "rafael.beims" , Francesco Dolcini Subject: Re: [EXT] Re: [PATCH v9 0/2] wifi: mwifiex: add code to support host mlme Message-ID: References: <969e95ccc4a1d35b45212b7fcb536ee90995e3b5.camel@sipsolutions.net> <4e5f3741819e457c5c79d825c6520cb9ee531b95.camel@sipsolutions.net> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi Johannes and David, On Fri, Mar 29, 2024 at 10:06:19AM +0000, David Lin wrote: > > From: Johannes Berg > > > > The way I see it, the issue here isn't necessarily the fact that this uses the > > auth command (and then requires assoc, of course), but that we see here > > this is "growing" towards a more mac80211-like model, with the code > > duplication (albeit little that it is today) implied by that. To me, it seems like > > the firmware is moving into the "oh we can't do all _that_ in firmware" > > territory, and that brings it closer to mac80211. > > > > At the same time, as you say, mac80211 is doing more and more offload > > capability, so it seems like apart from "today the firmware requires an assoc > > command rather than assoc frame processing in the host", it's actually not > > _that_ far apart any more! > > > > Now that may be an issue in the short term, but I wouldn't be surprised at > > all if desiring to implement FILS and other new features in this space would > > make the driver move to assoc frame processing in the host as well, because > > it's getting more and more complex, just like auth. > > > > At which point - yeah the APIs are still significantly different, but again we'd > > end up implementing something that exists in mac80211 today and taking it > > into mwifiex? So it seems there's 2 possible sticking points: code duplication, and overall trend in the specs and implementation that might increase duplication? To me, it seems like the duplication is minimal today, or at least, not much as a result of anything in this patch proposal. There's some repetition of 802.11 definitions already, but that's probably orthogonal. I have less understanding and foresight on the "trend" questions, although David seems to somewhat agree in his response below -- that NXP intends to handle modern security features in the host more and more, which could indeed mean a bit more framing-related duplication. > Mwifiex is designed based on a "Thick FW" architecture. > As security features become more complicated, this patch adds WPA3 support by offloading to wpa_supplicant/hostapd > With this patch, auth, assoc and key handshakes are handled in wpa_supplicant/hostapd. > Wpa_supplicant communicates peer capability and derived keys to driver/FW via cfg80211 assoc and add_key commands. > The cfg80211 commands are standard. Implementation between driver and firmware is vendor specific. It shall not break any existing architecture. > > > > It may be harder to add > > > future additions to the mac80211 stack [*], if we have to add new > > > concerns of a non-mac80211 implementation in the mix. > > > > Not sure that makes a difference for mac80211 in itself, obviously changes in > > this space would then affect mwifiex, but that shouldn't be much of an > > issue. > > > > With this patch Mwifiex still a non-mac80211 implementation. > Driver communicates with wpa_supplicant/hostapd via cfg80211 > I think how driver/FW communicate each other is proprietary, I don't see a dependency with mac80211 here David, I may have pointed in the wrong direction by claiming "conflict" with mac80211. I believe Johannes's concerns are in code duplication. Pretty much all other actively-maintained Linux WiFi drivers are based on mac80211, so that we don't all have to implement the same frame construction and parsing code. mwifiex is somewhat of an outlier in actively adding new features while remaining a cfg80211-only driver. But for myself, I'm not even fully convinced mac80211-style stuff makes sense here. Even just looking at the auth() stuff in patch 1, this driver is far from a thin layer that allows mac80211 to handle the 802.11 details. Just look at the 'priv->host_mlme_reg' and HostCmd_CMD_MGMT_FRAME_REG stuff -- it seems that the simple act of sending a single 802.11 frame requires opting into some FW-specific command mask. This feels "thick", like David mentioned above. > > I'm less worried about this individual patch than what it says about the > > direction this driver and firmware are taking, and I fear we'll end up in a > > situation where over time this driver actually gets to a point where it should > > be using mac80211, but because it's such a piece-meal affair (auth frames > > now, etc.) and large architectural change, they'd never actually do that. > > > > To be fair, that might also require firmware API changes in some way. I used > > to think that was something we should never require, but I'm not so sure > > now any more - certainly we've changed our (Intel) FW API in support of > > Linux architecture many times, and overall that's for a better product (on > > Linux at least.) Yeah, I feel like I see hints of stuff (in public driver code, and in internal discussions with vendors) where things really work best in mac80211 land if firmware is developed with *some* consideration for the mac80211 Linux architecture (or else already is a very thin firmware from the start). I don't feel like Marvell/NXP has that consideration at all, and so trying to drag its firmware into mac80211 regardless would bring its own unique pain. But that's just a lightly-educated feeling. > > Also: David, I'd appreciate if you actually took this discussion seriously; so > > far you've not really contributed any technical arguments. > > I think we are using standard cfg80211 commands. How it's handled > between driver/FW is proprietary, it's carefully verified and shall > not impact other features or break any architecture. David, repeating the "carefully verified" stuff doesn't really help the subject at hand, and it's not really a technical argument either, when it's not accompanied by any proofs. Being careful and running a good QA cycle are excellent and appreciated, but that's not what we're talking about any more. We're trying to understand what the firmware architecture is like, and what driver architecture matches your future development best, with the needs of the Linux community in mind. (Now, as an example useful argument: if you claimed that implementing a mac80211 driver with a generalized ieee80211_ops::tx() function would introduce unvetted combinations of control logic that cannot be reconciled with your HostCmd protocols, or that QA can't properly vet that ... well, that would be a start of a technical argument. But it would require more than a sentence or two to describe why that's impossible or difficult.) > We do not see a need why driver has to be redesigned based on > mac80211. We can keep adding new features using cfg80211. All in all, other than being a little grumpy about reviewing new features here, I'm still leaning toward David's statement here -- that I don't see why it *must* be rewritten toward mac80211. But I still defer to Johannes, and I'm just trying to be a bit of a referee, or the proverbial "devil's advocate". Brian