Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1787606rdh; Tue, 26 Sep 2023 03:43:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtzn5Z2bYlYg0qEhIc41fU68UG7hpKwwXWpfPH2EUDEsLgr0LsNwaaoDS/3F69Mq27OvaT X-Received: by 2002:a05:6a20:4416:b0:13e:99c0:fe6e with SMTP id ce22-20020a056a20441600b0013e99c0fe6emr3402345pzb.5.1695725016471; Tue, 26 Sep 2023 03:43:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695725016; cv=none; d=google.com; s=arc-20160816; b=bFn+thVK74l7xTnKbnILWUFh8Lhi8qZKdDat46V0WzgLFY96Kvo17p03o3nEhUP5VG dQdqql6bnTBLmlNasgh3k31RfFLHV0v0/OsAkErsemS4Bicz6YI2Fz5rxqLd/QFLTxfI +X9H4sxx9rCDHr0s0jY+KHQ7tSJo50d0863C5q5x9luJmfwRPm/cRPGzR6laXdVPh65c YqiyQJzm6FVAFsCNAsNB+gYxi7fIGDp1PbeQM6X+AiwexF7YrVHAIR/t782xeJmouYDj unAhr30uFgofKVTEIam28s2GOm0mPuEGpNxLL9kOUykIMx/yS2FfHu03zW+gGuYczcW7 Uk1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=YMkWUhPMi5MlgEJx/17dv5tGxomlRYsOBLSY0nriJC8=; fh=LtJZwl0EW4z3w9rdvkMhapcb7Ii6Nhw2MbdXQyqM/o0=; b=mGC58iDjCAx5w1xbkw50nv04B3nQjiNunYhO6HfiqiJnozf5CBZy8NbPVVlnEPZDAe Q8wagsyN9Q5dejgg6gkvB/sxDmwYJTlTJUtllp+ZFVn+YX2GZuGg0ivRjiBBkuzJLJ2C p9jEE7cdZVH/UED8r3E5UMqzXEFnkt5b7q803F1Zku/Vbtit7rrn0HiLm85tFjYnkbQq zci5vVSuhrCIkkgZwhUe9WoM8UAu64H9OnIzrczxrIcXLTnvw34Bo/PnXKtXRKgMwPt9 0k/gOrZQT+bnOZWUaGS+0KCAmiKp2gieNs79j3lk6qjwQCp7dhK27JcoTX7UcFQSMX/Y mgWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="YwM/gTTf"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id l192-20020a633ec9000000b005741597ab7fsi11316437pga.96.2023.09.26.03.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 03:43:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="YwM/gTTf"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3140C813528A; Tue, 26 Sep 2023 03:00:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233201AbjIZKAe (ORCPT + 56 others); Tue, 26 Sep 2023 06:00:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234337AbjIZKAb (ORCPT ); Tue, 26 Sep 2023 06:00:31 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CF52193 for ; Tue, 26 Sep 2023 03:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=YMkWUhPMi5MlgEJx/17dv5tGxomlRYsOBLSY0nriJC8=; t=1695722424; x=1696932024; b=YwM/gTTf1R07V69YE00JJh2zEouI2y2aWa1j4jYA72kWylz k/hLzCEHDjPBCn37HNNSbRvn/Cemet8ijCWy8m8Oi7JC8v1A5SNM9adPR1vxak8iUDUbthsqYoVZW 2oH08mjWRgUz3zg5KAVT9lf0rgZn5Em4BCf7HrtJjdhK0yyzlS90HFN+lnefaydqmpcCmOP4Yhji0 Vfwxr+IS/cruiIzwj2SxU8zYDaAtxlUk7Q3nd5n8tIAbVkXKxNNQg1WvtaPoiTpqIS45ZSd5+SvTW mHmF7SieBJtEjR/bYO6dXcKZijmgL8lIWwSLDc+n94r1TlgKilETSqc9dXGOSEfw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1ql4rd-005SgD-1e; Tue, 26 Sep 2023 12:00:21 +0200 Message-ID: <6892f4026a275756eecf36f46711442882aac7fd.camel@sipsolutions.net> Subject: Re: [PATCH 2/3] wifi: mac80211: add support to allow driver to set active link while connection for station From: Johannes Berg To: Wen Gong , ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Jeff Johnson Date: Tue, 26 Sep 2023 12:00:20 +0200 In-Reply-To: <96ae3c1d-274b-00b1-cb19-a9a301b6aa56@quicinc.com> References: <20230906103458.24092-1-quic_wgong@quicinc.com> <20230906103458.24092-3-quic_wgong@quicinc.com> <4b597bba9dc13c3260f174826de38b4f1bc3bf6e.camel@sipsolutions.net> <96ae3c1d-274b-00b1-cb19-a9a301b6aa56@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-malware-bazaar: not-scanned X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 26 Sep 2023 03:00:36 -0700 (PDT) > For ieee80211_set_active_links(), driver need save and install pairwise > keys for the other links as you said in link below. But driver do not > save the key data currently. So driver could not install the pairwise > keys by itself. > https://lore.kernel.org/linux-wireless/50719d34bc48d816d00b56d3d9efdb59e3= e51a16.camel@sipsolutions.net/ Well it can still easily iterate the keys, but OK, I can buy this argument. You should probably mention it all in the commit log though. > > > @@ -166,6 +167,13 @@ static void ieee80211_set_vif_links_bitmaps(stru= ct ieee80211_sub_if_data *sdata, > > > WARN_ON(dormant_links); > > > break; > > > case NL80211_IFTYPE_STATION: > > > + active_links =3D drv_calculate_active_links(sdata->local, sdata, > > > + valid_links & ~dormant_links); > > > + if (active_links) { > > > + sdata->vif.active_links =3D active_links; > > > + break; > > > + } > > >=20 > > I also _really_ don't think this should operate at this low-level > > infrastructure. >=20 > I really want to know the reason why active *only* the assoc link for=20 > station, but >=20 > active *all* links for AP here=F0=9F=98=81? Well, fair point. I was somehow anyway thinking that it should be the other way around, I mean, in the sense that this code here is just mechanism, and the policy should've been in higher-level code ... but somehow that's not what we ended up doign here. It really feels wrong to me to have the driver involved in this low- level infrastructure, but OTOH that really is how it works now? Maybe really what you want is a driver flag saying IEEE80211_HW_MANAGES_ACTIVE_LINKS or something, and then from a mac80211 perspective you don't set active links at all? Though I'm not sure that works with TTLM, for instance? And maybe you'd still want the debugfs? But in fact, if you do still want something from mac80211 for debugfs or TTLM, then this code here is not really right, since you'd interact with _all_ attempts in mac80211 to activate or deactivate links - when all you really wanted was the very first one. Which today mac80211 achieves by bailing out "if (sdata->vif.active_links)", and while you could do the same in the driver, it feels really brittle / error-prone to me. I think it'd be better than all these callbacks to encode the specific behaviour you need in a flag, e.g. "activate all STA links on assoc" or something? johannes