Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp600037ybe; Wed, 11 Sep 2019 01:38:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbkjBLzU5t9a0rbysn8v0BdyT64eU7dI3pVKaJDGNCMiAMRhxwhG8FIDI+SRzzMcRX396/ X-Received: by 2002:a50:fc94:: with SMTP id f20mr34158959edq.175.1568191081061; Wed, 11 Sep 2019 01:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568191081; cv=none; d=google.com; s=arc-20160816; b=ZeTRAEhngvOE0q155a7ESpenHQJ4jQkUfnltc+Y5b20gL43OZWKDB/PZJZ3ISflNlD 1tUxpu6Jxu1FPPwF94h3GXRSkkvYOTL+gUUOPJNYPz6IZnihQQYjk0iLtkXs92okwmsx ziPIF4Pnei1/kiBzeatkAhUjOWU76XHXmzfvDzyC2IyypS/Gh8fVI8yipvTq0iMP4CoR 1C978+xE8023LcZfrX6Aeu1kaWTsglI9/ZyNfxP/7ZfB6f/JkCB2sw5XuHBFz4YYc8Kj 90Ppolc72Acug94cH7+f2DlfKxFFtQ/Sa67smZVyC/yxG/YlU143VSgXT+996sv3hJWT GwnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:to:from:subject:message-id; bh=gHAARnaxiQscxa2SEMWF3tmEL12aApB2qAWpcNFABdI=; b=sAWm1EWEcULfVwrepbk9XTbvfZ6TuuHoYoDpA3Q/G6a9DbS4/SAeYudCk+ZcuIT6md zOehvv7ik4/spYHazK+uV8hyFEdX6oX6FkGaZPVg6KaIMCLaQWr82oq9GyBW7DJiPmRK 7HYu0WZZWhJeQEMGw4M5Py2of7UCM4/cXUbSxYkMa6Ldkmn4laJuTJJul1+C+Wh62EZD jhc8ccrtmiwWEMDuq12UDpQS7ONbrNOHavkF9UqPBBl2WiGbzqyZIgh4mA0cM1e9plk/ 3LHo9LU0JUaAvQqGOvq0i0/uygTB78zA/4Fkcr7did4dRSNzB+FTOFsJgL/qInmWEaST xung== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q28si11461649eda.322.2019.09.11.01.37.36; Wed, 11 Sep 2019 01:38:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727152AbfIKIhH (ORCPT + 99 others); Wed, 11 Sep 2019 04:37:07 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:33392 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726579AbfIKIhG (ORCPT ); Wed, 11 Sep 2019 04:37:06 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1i7y7c-0001Vr-IA; Wed, 11 Sep 2019 10:37:04 +0200 Message-ID: <6dac6b1dccf059c964a0010a022402a599b7cc0d.camel@sipsolutions.net> Subject: Re: [PATCH 1/2] nl80211: Add NL80211_EXT_FEATURE_LIVE_IFTYPE_CHANGE From: Johannes Berg To: Denis Kenzior , linux-wireless@vger.kernel.org Date: Wed, 11 Sep 2019 10:37:03 +0200 In-Reply-To: <73e78b3e-f36a-aa29-a818-e0e1f0598b2f@gmail.com> (sfid-20190830_185517_653983_CFF14188) References: <20190826162637.7535-1-denkenz@gmail.com> <73e78b3e-f36a-aa29-a818-e0e1f0598b2f@gmail.com> (sfid-20190830_185517_653983_CFF14188) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi, > Agreed. I guess I just view nl80211.h as a sort of combination between > a uapi file and an actual manpage. And manpages do mention which kernel > version a certain feature/flag/whatever was added. Such info can be > useful in many ways, e.g. figuring out which kernel version might be > required for a certain piece of hardware, etc. Yeah, fair point, I just think it's better to document that behaviour as dependent on the flag, not the kernel version; this will continue to be true for drivers that don't set the flag in future kernels after all. IOW, I don't see how it does you any good to know that you're running on kernel version 5.4, when the flag isn't set you still have to follow the 4 steps you outlined. > > > + * @NL80211_EXT_FEATURE_LIVE_IFTYPE_CHANGE: This device supports switching > > > + * the IFTYPE of an interface without having to bring the device DOWN > > > + * first via RTNL. Exact semantics of this feature is driver > > > + * implementation dependent. > > > > That's not really nice. > > Sorry. This came from some doc changes I have pending. I think I wrote > this after looking at some fullmac drivers and how they handle mode > changes and the wording reflects the exasperation I felt at the time. > > Do you want to suggest some alternate wording? I think it is worth it > to have some fair warning in the docs stating that prior to version so > and so the semantics are completely driver dependent. Well, but you're trying to document/advertise the restrictions now. So this feels a bit insufficient, by advertising the feature flag the device is now saying "it's possible I can switch, but don't ask me how or when". (Cont'd below) So I don't really think it's the wording that bothers me so much as the fact that you're basically going only half the way documenting this. We have nothing now, which I can agree isn't a good thing, but adding a flag that says "maybe you can do it on this device" doesn't really change the status quo *much*, since that was already true before. It seems to me you'd rather want a definitive statement. > > > For mac80211, the following restrictions > > > + * apply: > > > + * - Only devices currently in IFTYPE AP, P2P_GO, P2P_CLIENT, > > > + * STATION, ADHOC and OCB can be switched. > > > + * - The target IFTYPE must be one of: AP, P2P_GO, P2P_CLIENT, > > > + * STATION, ADHOC or OCB. > > > + * Other drivers are expected to follow similar restrictions. > > > > Maybe we should instead have a "bitmask of interface types that can be > > switched while live" or something like that? > > > > I'm fine with that, but this would only apply to newer kernels, no? Sure, but all that you're doing here does. > Don't we at least want to attempt to state what the rules are for older > ones? That's what you did above for the NL80211_CMD_SET_INTERFACE documentation update, I don't think it would belong into the documentation for NL80211_EXT_FEATURE_LIVE_IFTYPE_CHANGE? And you wrote that this is what happens when the flag is *set* which by definition cannot happen in older kernels. > An alternative might be to simply state what the restrictions are and > just enforce those at the cfg80211 level. Sounds good to me, we do that for a lot of things. Basically that just takes it one step further - I said above we could advertise the restrictions, but once we do that cfg80211 knows and can also enforce it. johannes