Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1941156ybg; Thu, 30 Jul 2020 06:43:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6p7cPLaXFFjDqB2pidT+YtyF/rbh93VXgaTJe9gPjW1t9dmiaz8IjOuBnt6wt44pnW9d5 X-Received: by 2002:a05:6402:2037:: with SMTP id ay23mr2696640edb.48.1596116587430; Thu, 30 Jul 2020 06:43:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596116587; cv=none; d=google.com; s=arc-20160816; b=fYSr2lS6qo/Fg8lSZLPmSvpefF2DU6VgFnJacjIWW7Gm0YxgPe8tNHyxvJsV7rf/GM yarM+V8WZmYnsRS4QWuIPUtBXTB7VX7+bYakLG7LCyaxnSLEMbEoo+Hn7z/IfRZxsGU2 pUirKEUAxmw1VJaXGo/mpo/RAS7gP3qeSVo81vnKLvuHouId1tE1GPE+7m6sMHnpe2qr oxpf7V9fFY3zGcN6F+JsxSTwJCY34rdaWlmDvj9LQZMtr499nPqswV7/KBM+cv2nDEqa 51hsWcjQL80UlBBkjMcO6ZglsCdiSL+s8npC95Akm12r7lBOJu7LhqLcuEePOR0y7B1X dWdQ== 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=AUytuJm7ocF+qqNTgToFXALfldMX5ydltoqqxFQ1vDc=; b=maDN733fA3JW+2tyay8eFlGD8Ac2WZkcSEaqPf7hJfdgSgew9gmRNDr0H6wP5uWsnB GDPXBsVr9442hJBzI3kHIbeWsECB0ksf10muu8rO0pN84TBpyMkXbz/J+9HupOvvqKiu H0bHMG2g2O3YUIC7bSCSItsMVbVS1WClFhpjoMwSStCL0ssuMSahF8TXu/I9SpJu2DZY eq19LiHGEOx11DsB+zaN4fq/fglj3lmAinszrmQXC4Dcvc5j9Yh3/3Puk7SWhcsIy902 6nrOvqfnmlRhQ8H+MorB+UgCzJlIjUSuJ6h1M5F55w8L3Ck6A620HFiCWm8m4WTz9GkQ wTvQ== 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 x12si3317928edl.33.2020.07.30.06.42.42; Thu, 30 Jul 2020 06:43:07 -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 S1728391AbgG3Nlk (ORCPT + 99 others); Thu, 30 Jul 2020 09:41:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728092AbgG3Nlj (ORCPT ); Thu, 30 Jul 2020 09:41:39 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76D75C061574 for ; Thu, 30 Jul 2020 06:41:39 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1k18oT-00DYSj-Ey; Thu, 30 Jul 2020 15:41:37 +0200 Message-ID: <2bcd9fbd6d141d6e78f606fd7f96fb99573810d2.camel@sipsolutions.net> Subject: Re: [PATCH] mac80211: do not iterate active interfaces when in re-configure From: Johannes Berg To: Ben Greear , linux-wireless@vger.kernel.org Date: Thu, 30 Jul 2020 15:41:36 +0200 In-Reply-To: <6a0f46b1-54c0-c090-56e6-7cca3b295691@candelatech.com> References: <20200525165317.2269-1-greearb@candelatech.com> <7f2722c9d30bb1a4715398b4f29309b1f383593b.camel@sipsolutions.net> <6a0f46b1-54c0-c090-56e6-7cca3b295691@candelatech.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.4 (3.36.4-1.fc32) 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 On Thu, 2020-07-30 at 06:27 -0700, Ben Greear wrote: > > 1. track per vif whether it was re-added, and skip before it is > > > > If that works, I can certainly get behind it for semantic reasons (the > > vif isn't yet active again), although even there I'm not sure how > > iwlwifi would behave - but that's something I'd look into and perhaps > > even consider a bug there since it shouldn't know about that interface > > yet. > > Wouldn't that complicate the sdata-in-driver check even more? So it would > be something like is-in-driver-but-not-yet-reconfigured-in-driver? We should probably just clear the "is-in-driver" flag for the most part, and just remember "was-in-driver" so we know which ones to reconfigure, or something like that? > This sort of state is quite nasty in my experience. Almost better if > we had less state. Driver should already know if it has an object or not, > so redundant adds, or requests from mac80211 for objects the driver does not > have can be handled properly by the driver? I don't think that'll work. Drivers just act on "add" and "remove", they're not checking against double-add. And IMHO it makes more sense to have mac80211 do good sequencing than the throw our hands in the air and let the drivers have to be idempotent just because we can't figure out the right sequencing? > > 2. If for some reason that doesn't work, add an iteration flag that > > controls this, rather than a per-device config? > > I wrote this patch probably 5 or so years ago, and since I have fixed most of > the ath10k firmware crashes that would tend to trigger this bug. I think I have no > good way to test any complicated change to this patch. > > I am quite certain that ath9k and ath10k are at least not harmed by this patch, and > certainly old ath10k benefited from this. So, I'm comfortable adding a driver > level flag enabled for those two drivers. Changing all the calling locations to > (maybe) add a flag or adding and tracking vif state is too risky to be worth this change I > think. Uh, why? I mean, at least mechanically replacing all the callers in that driver wouldn't really be any different than adding a driver flag, but is so much more flexible and can be used elsewhere. I don't think I buy this argument much really. Yes, I understand that there's always resistance to changing something that works, but ... Really I think the right thing to do here would be 1., and let mac80211 sort out the sequencing. Consider add interface wlan0 add interface wlan1 iterate active interfaces -> wlan0 wlan1 add interface wlan2 iterate active interfaces -> wlan0 wlan1 wlan2 If you apply this scenario to a restart, which ought to be functionally equivalent to the normal startup, just compressed in time, you're basically saying that today you get add interface wlan0 add interface wlan1 iterate active interfaces -> wlan0 wlan1 wlan2 << problem here add interface wlan2 iterate active interfaces -> wlan0 wlan1 wlan2 which yeah, totally seems wrong. But fixing that to be add interface wlan0 add interface wlan1 iterate active interfaces -> add interface wlan2 iterate active interfaces -> (or maybe -> wlan0 wlan1 wlan2 if the reconfig already completed) seems equally wrong? johannes