Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp701064rdg; Wed, 11 Oct 2023 03:10:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsVzwtyg8YyhndLX+sZbFfyeL8qBpcACAKFuBpOSQbbLlWaK8FSbakAzNC2i0VbuTA3wV7 X-Received: by 2002:a17:90b:4b8b:b0:274:98ae:d72f with SMTP id lr11-20020a17090b4b8b00b0027498aed72fmr18095000pjb.38.1697019014213; Wed, 11 Oct 2023 03:10:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697019014; cv=none; d=google.com; s=arc-20160816; b=Jhc18l/WcQlLM2hXKWGicWRjDxwEi9LLyrm1ezYvRbkwmWCynvnhZHjP0fSU7MTyei 8h09y/s8Mu2qzJH7hqBmTFiyJn1iH9nTvSqAng/XDqg5mSGlWaI0RZiUOJNXKR1/gfEF UQdbLLrd+Hff09Fmuf5XxH8HAlaeq99a5GIk1fPnVSKeZLoutMFOOHvrjFBCovA3jtK5 kZJOwGf+1D1Tni3V1noTZE/MuiKiXiMaFi29zz72A6xg+Y3+KWiTRLx2Qqj2D5PQWaa0 TVud/opohCl8LRCc/GXdNeGBKhDbLyYWqj3bmwfaw4EPzn3YsmWurK2CqbgkHjdyvckQ GF9Q== 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=6Wq67GIQM0mYcfP8MitkuLnqjYC2IBt7hfRHiG9J3O0=; fh=Y2IfAqdjkYQAx7XZcGq/8JceY1atOOwfX771vvMvH7o=; b=o/HmoU5IwxrVJfCiJ/7Pa1uT57uPewEj1O0+GWjm8EkpA2UabqylKEgbjeptDaXMH1 u9qxbbJGlC3noco+IVyldR4jPc3Z/mm9BLiQFv1kviZvCiP+p3yy87+Tq3545qURED4l 01HloGkq8TJ0FuWbrg4Ls997c/EteT/3LQJuFw0lof/grHvmsXPalQW1DBRsassRnCxN 9E6YxUNoJKEk0GBRBfGn70UVF30lTslnmc836Kl/gRHZ28TgFYcsPg2ZZDzsKGSTfvTH svz3bDK3Uw+pKq7wIRZ5AwJ+WNxK0yOKPZNzq+QJ6D3pGGZARhbdUH1H9t89xjeOhQCs 0X/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NJfPjBMZ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id c11-20020a17090ab28b00b002774ecb2ecdsi13815378pjr.19.2023.10.11.03.10.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:10:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NJfPjBMZ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7B7DF8115469; Wed, 11 Oct 2023 03:10:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234743AbjJKKKA (ORCPT + 52 others); Wed, 11 Oct 2023 06:10:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345805AbjJKKJg (ORCPT ); Wed, 11 Oct 2023 06:09:36 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B58672134 for ; Wed, 11 Oct 2023 03:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697018895; x=1728554895; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8FMhd4RO5KDInkk9YkMQ2aB7b64ajBL3L45W1zWaTnY=; b=NJfPjBMZUJz0X1P7IqlK108uWaXCeGiUm1Pseal3sn3q//xOZECCIADD BWxiqyFX1GLfNGLFVgVzeG4E8gsLiQf5zxd4wASq2pLONbypbHkyS8uoj 6v1prwSLs/n3gZc7RnIfXdNMkQ65/NFYgeA1Eo4NzuNg2ZU0iSXq4uz8Q kmmuxtD7S+MnmnzfmrN+68DxF/jUtuPQnEAVPycXC9kQSexnd8sZB1zSf KGDbL+EsEku9Iz47xAfzxYwPzKS3yNHNBKwWREwkkhDZLHCh6RxeTJ07Q pVlIM81LlOObdX/N5ZZnMssTqLyTEJ0JWezqgJZ51Wir1b+Scv/k8e5Uk g==; X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="415670683" X-IronPort-AV: E=Sophos;i="6.03,214,1694761200"; d="scan'208";a="415670683" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 03:08:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="1001050327" X-IronPort-AV: E=Sophos;i="6.03,214,1694761200"; d="scan'208";a="1001050327" Received: from mzarix-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.249.94.125]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 03:08:14 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 14/16] wifi: iwlwifi: mvm: fix iwl_mvm_mac_flush_sta() Date: Wed, 11 Oct 2023 13:07:29 +0300 Message-Id: <20231011130030.0b5878e93118.I1093e60163052e7be64d2b01424097cd6a272979@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20231011100731.361200-1-gregory.greenman@intel.com> References: <20231011100731.361200-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Wed, 11 Oct 2023 03:10:10 -0700 (PDT) X-Spam-Level: ** From: Johannes Berg When I implemented iwl_mvm_mac_flush_sta() I completely botched it; it basically always happens after the iwl_mvm_sta_pre_rcu_remove() call, and that already clears mvm->fw_id_to_mac_id[] entries, so we cannot rely on those at iwl_mvm_mac_flush_sta() time. This means it never did anything. Fix this by just going through the station IDs and now with the new API for iwl_mvm_flush_sta(), call those. Fixes: a6cc6ccb1c8a ("wifi: iwlwifi: mvm: support new flush_sta method") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index c142d5d0d414..ba087c5ba6e1 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -5697,22 +5697,20 @@ void iwl_mvm_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void iwl_mvm_mac_flush_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta) { + struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); - int i; + struct iwl_mvm_link_sta *mvm_link_sta; + struct ieee80211_link_sta *link_sta; + int link_id; mutex_lock(&mvm->mutex); - for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) { - struct iwl_mvm_sta *mvmsta; - struct ieee80211_sta *tmp; - - tmp = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], - lockdep_is_held(&mvm->mutex)); - if (tmp != sta) + for_each_sta_active_link(vif, sta, link_sta, link_id) { + mvm_link_sta = rcu_dereference_protected(mvmsta->link[link_id], + lockdep_is_held(&mvm->mutex)); + if (!mvm_link_sta) continue; - mvmsta = iwl_mvm_sta_from_mac80211(sta); - - if (iwl_mvm_flush_sta(mvm, mvmsta->deflink.sta_id, + if (iwl_mvm_flush_sta(mvm, mvm_link_sta->sta_id, mvmsta->tfd_queue_msk)) IWL_ERR(mvm, "flush request fail\n"); } -- 2.38.1