Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2054513rwe; Fri, 2 Sep 2022 07:54:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR6q1orqHfM4d8FAzB9fJ+xdiIrrPu/DLzp8egdWSUUAg6NuBLIkiSz4sH8Y/M3TdIiJBt9Z X-Received: by 2002:a17:902:d589:b0:174:63e0:5a5c with SMTP id k9-20020a170902d58900b0017463e05a5cmr30769809plh.5.1662130487126; Fri, 02 Sep 2022 07:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662130487; cv=none; d=google.com; s=arc-20160816; b=jl2thOvsI5/6uPVNCwVh1oM36mkaU4UDBAFVwcmONAart9/KRofMnZMSwnRGD0Gn11 TpVpBrKSnXOowQ4JsD3EBHsKEwQmGAGSocFBC7PPWkA8zgl9XRFoj6/9pazsZ25B0ubk ohQxCbTMg/XpF/Dt7MHIqLYbfV/p6v/Uj3GKxk3Pt/30Ia1MN6iGyzR4zJeFbHfFtO8b ab83entmuhDAnI6zKMNYcdpsUaj1rmc/N+tzPRqpBep9413WqKKXzv6aMsuwrx/g1I9l 4jZdbR/1WfnvHTBYBDOq8LJj3VaPVHNVlRxtuQQTg6IWqIZE3LHcSAvnbcfSTgteYEpL +2bQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=095hDYsDlcTV8evU1aEFxpjTrvn2h/uZJCNm8+1IhlU=; b=O81GTOgGzT6/oIpJ9b56SJqKTwLGyOxqhszOYzxgXGsu05lsjNbX/s7MSR2v6Lk3Ml W06RG8uQkMIHeZS0FjCCGco64qpiGCnSvQFhyGObxKTazYuzAiMUpz0TOV0afVd9cTKa E+fKY8Yhe4PsKfE7xodd7iv2PwsnlEt+aNvHXZWvFlQYYGH5ZAJi+HQml+N5GEY0Tvah 5aP++DjWMmW8HctOnJOUktIcbqrUeKkPCM7PHTv0WAEbHcEdqohf/T/lSGSP556qS+0x a1Vknr5BOmERf0zaNwFaokrXO/F8wlS2pf34P7foIYr5p4p+jq3GwO3t7/6yzU6obsJe KjYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=fxbzBWk1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j187-20020a638bc4000000b0042a33a60040si2193665pge.712.2022.09.02.07.54.38; Fri, 02 Sep 2022 07:54:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=fxbzBWk1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237196AbiIBOv2 (ORCPT + 64 others); Fri, 2 Sep 2022 10:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236609AbiIBOvF (ORCPT ); Fri, 2 Sep 2022 10:51:05 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E84397D55 for ; Fri, 2 Sep 2022 07:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=095hDYsDlcTV8evU1aEFxpjTrvn2h/uZJCNm8+1IhlU=; t=1662127990; x=1663337590; b=fxbzBWk1TYYX8IpZnXB/4sFblBLtE7TxcWl+UagvePqXjfa 4Hn8MWoXPcbTWXNMnkUkswYX7N/B8u0WiPKDlcBpRNvC6yRYLQzdjvephwFKeKCuJY0qDpHUDZ1EN v4O0G6B3mv08v4/ps03TmXyNi1ott1rSMNO3xVVbFSzKOxTUXajebBrtB7owpFW/MAIgAmKPtUFX5 ZhZrcDUxZVeH4HwgzPwT9tmygwMA66y3c4Vv5tDLact/YdnW26H8D0dKn3OiczOoMPrm3G1JIUZCm bBuMUcV9LXaZq9dixgnO4wdkgN2SHM32PDx99T5aBKFokyuYdFlhZIIO+5voSx/g==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1oU7Pw-006Ch3-1Y; Fri, 02 Sep 2022 16:13:08 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 12/27] wifi: mac80211_hwsim: skip inactive links on TX Date: Fri, 2 Sep 2022 16:12:44 +0200 Message-Id: <20220902161143.3489c3850898.I8f77618ccb1a9eaedf3495464a6f8594ccf5112c@changeid> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220902141259.377789-1-johannes@sipsolutions.net> References: <20220902141259.377789-1-johannes@sipsolutions.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, T_SCC_BODY_TEXT_LINE 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 From: Johannes Berg With the link activation handling in mac80211, skip any inactive links on TX. Signed-off-by: Johannes Berg --- drivers/net/wireless/mac80211_hwsim.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index a75420d92816..f17de806a35d 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -1735,6 +1735,9 @@ mac80211_hwsim_select_tx_link(struct mac80211_hwsim_data *data, /* round-robin the available link IDs */ link_id = (sp->last_link + i + 1) % ARRAY_SIZE(vif->link_conf); + if (!(vif->active_links & BIT(link_id))) + continue; + *link_sta = rcu_dereference(sta->link[link_id]); if (!*link_sta) continue; @@ -1743,6 +1746,10 @@ mac80211_hwsim_select_tx_link(struct mac80211_hwsim_data *data, if (WARN_ON_ONCE(!bss_conf)) continue; + /* can happen while switching links */ + if (!rcu_access_pointer(bss_conf->chanctx_conf)) + continue; + sp->last_link = link_id; return bss_conf; } -- 2.37.2