Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1978126lqp; Tue, 16 Apr 2024 03:55:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVPjWPOscVRXl49nirt1WsjNiCVsi5f0PXV0o6ecwgARGIHKqewdNKL1Hnx4VdUVbAmAAeWSi+9FsR7S1QtWs0QkqCin5eMierIfOn5Bw== X-Google-Smtp-Source: AGHT+IF1smbKui74eqq3WLc82ICdnofd3XmmY4PyWEPCEnOSgwrc9LMfv2Xjz68Fc9WC+P+6MYFf X-Received: by 2002:a05:6a21:2791:b0:1a9:5ba1:3b1b with SMTP id rn17-20020a056a21279100b001a95ba13b1bmr11132049pzb.9.1713264938078; Tue, 16 Apr 2024 03:55:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713264938; cv=pass; d=google.com; s=arc-20160816; b=kU5+INBuDMa4IKT6h9/ILFjijE7kAILdD0NZE0uRzzkAcv/lDidGyAGMieFuExGHz3 W2Jfqy6/kHfo1MaBuQJNVgSRz+XIxK3i70QLfCGaM9HUjzL66PjWZhSl4NmhNs3TS2th /tbCe3o/uFugcZpeGvkIsyd8e+Gv0NXt3UIZLdI4zdWTgmU1enDgKfDoRj/1G5GsSaOf sqJr9Q6V25E+GWqEr7KUP5a1/zx6PktTGZMjRHIzUnUM7t+aMpPKhaUxeGEk+bCimd2C qR383lMJqmKTo0bzMzA+LXhMWSjkPiaBcaAK2z1s4o1ZR1OVmfV2DBXq81fR7CB6l8ra +9ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=DtwTG3zehaHaSOcC37mZfAN1DvVU1D7IOo2hWiTQZNw=; fh=TquNsOiV+zNY1csTpltVB6A9QFW5SbuNs6JlqcKCQkw=; b=fsdBqGDXQx2mxS781OH+fkyXFL9aV3BT1rECdykb6xkxOD/ZpD28Wfzz4FPi9/dO/P 9icopolfk5DUnR6nl6vd3BDfP3iyF5IVw3X1giufe7R/Y93rtvi6nzbV6rL/2Wr+bBPB mcaMI2t6bXNea76e/3tpz5rIAIf/JVhU3xuReNIaurSzatfBeao4+ko8xeRaz0H40on/ fMLQTpN34dxwGwZNn//lu4NyvMd41m7Pi+ijyJ37jxTqFQgKCpK59SyCQTCaV/8Y5y6Z MCQSlynbO+RofZgs2EtLfNLrHe24WSSCJ14LHwwYIu20vCG3MQJwPbI1q5FxRAaWQO2U ZwIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nOFFZrlw; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-6390-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6390-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bv24-20020a17090af19800b002a1f9e74c23si5150383pjb.67.2024.04.16.03.55.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 03:55:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6390-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nOFFZrlw; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-6390-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6390-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BEC48281D57 for ; Tue, 16 Apr 2024 10:55:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A2646D1BC; Tue, 16 Apr 2024 10:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="nOFFZrlw" X-Original-To: linux-wireless@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D91012838A for ; Tue, 16 Apr 2024 10:54:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713264887; cv=none; b=JFnNBTTgQaDQ6OZcVuj5F0bTtvFb7vmV/XAKSy/d0geiOSeZIP8pxCx5RyHFzit0ePpPThR7RcukBWnOybhiI4VXW3WMA7zMeaIs4IKqnzj4P6SzSy9Q+TBsAMoEeRfzSDsuUqmYFH8g9T/B4iPkqy633qk31bIK0cYDJl/MFvE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713264887; c=relaxed/simple; bh=x/lcoARf5MEJ1oA41d6W+qXOAkz5KNqwXTugKUsV/hs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mSK3rBM8Fv/BaiOom8jglJLiq2o2yTvuUyZTRdRxLob6keOowVvNxW8TNrvzeaL9/MDrxSPgyUyPjVMHy+JvE0hbv+XOgCuLNUwfILpICXKNA1449tbsu+fo3ik+bvrx/9pMMY+kMf4XCy7b+M8EGpXwRQBOwWp4Y4r0No8onJg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=nOFFZrlw; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713264886; x=1744800886; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=x/lcoARf5MEJ1oA41d6W+qXOAkz5KNqwXTugKUsV/hs=; b=nOFFZrlwYERm+a6TmnReIZZU1dfqB9PoR9m03pRnBZl5B1PGFPQ7VjSD 5RFXNatb+/8BJUFlmDDC+JcUwQhDecIPhlRarRzrXaz6JQY5havMIoJ6V 61hTXB/zUs8DMwRiw4ad6w6r59gkBhxL+OFGhTdPQIner4PflhKXMezFh gdBhKSLdt7TGD0zNLEH+tGyo7w5JZfLs6CGhcaLP7YSj59x4WIYkEKZf6 ocrhiiMYV/fFhao/gwS8barl8rHNcHCRGI3970IzJ5Zma1iEATBmH3LDk cyJHEapJNrucDri8nLf8WA0aFDjynIscndPkW+x+77Yzh8o+2zEm/N2Kl g==; X-CSE-ConnectionGUID: rQZOl4/5SLG9/MpJs2R0rA== X-CSE-MsgGUID: 5jd98TttRSSP+d9PbiGtqA== X-IronPort-AV: E=McAfee;i="6600,9927,11045"; a="8556066" X-IronPort-AV: E=Sophos;i="6.07,205,1708416000"; d="scan'208";a="8556066" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 03:54:46 -0700 X-CSE-ConnectionGUID: oVNkfb4KSoqGbHhB8Ddb2Q== X-CSE-MsgGUID: GgQApMIGTf6S687nJ3vU9w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,205,1708416000"; d="scan'208";a="26872576" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 03:54:45 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 13/16] wifi: iwlwifi: mvm: don't recompute EMLSR mode in can_activate_links Date: Tue, 16 Apr 2024 13:54:08 +0300 Message-Id: <20240416134215.202cf5a9ef2c.I65e4698b730a8652ad8d1c01420aabb41a1d04fd@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416105411.706221-1-miriam.rachel.korenblit@intel.com> References: <20240416105411.706221-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited Content-Transfer-Encoding: 8bit mac80211 invokes the driver callback drv_can_activate_links() from ieee80211_set_active_links to verify it can activate the desired link combination. However, ieee80211_set_active_links is called with more than one link in 2 cases: - After driver's link selection decided to enter EMLSR - From debugfs, for testing purposes. For both cases there is no need to recompute all the considerations determining whether to activate EMLSR. Instead, only check if the vif is not blocked for EMLSR. Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg --- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 1 + .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 29 ++----------------- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 11 ++----- 3 files changed, 7 insertions(+), 34 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c index 4bb71a14ac3b..9f343d015d81 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c @@ -518,6 +518,7 @@ unsigned int iwl_mvm_get_link_grade(struct ieee80211_bss_conf *link_conf) } EXPORT_SYMBOL_IF_IWLWIFI_KUNIT(iwl_mvm_get_link_grade); +static u8 iwl_mvm_set_link_selection_data(struct ieee80211_vif *vif, struct iwl_mvm_link_sel_data *data, unsigned long usable_links, diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index 61f4c5dc3cec..4016aaf91e6e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -1177,30 +1177,6 @@ bool iwl_mvm_esr_allowed_on_vif(struct iwl_mvm *mvm, return !(mvmvif->esr_disable_reason & ~IWL_MVM_ESR_BLOCKED_COEX); } -/* - * This function receives a bitmap of usable links and check if we can enter - * eSR on those links. - */ -static bool iwl_mvm_can_enter_esr(struct iwl_mvm *mvm, - struct ieee80211_vif *vif, - unsigned long desired_links) -{ - struct iwl_mvm_link_sel_data data[IEEE80211_MLD_MAX_NUM_LINKS]; - u8 best_link, n_data; - - if (!iwl_mvm_esr_allowed_on_vif(mvm, vif)) - return false; - - n_data = iwl_mvm_set_link_selection_data(vif, data, desired_links, - &best_link); - - if (n_data != 2) - return false; - - - return iwl_mvm_mld_valid_link_pair(vif, &data[0], &data[1]); -} - static bool iwl_mvm_mld_can_activate_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 desired_links) @@ -1221,8 +1197,9 @@ static bool iwl_mvm_mld_can_activate_links(struct ieee80211_hw *hw, } /* If it is an eSR device, check that we can enter eSR */ - if (iwl_mvm_is_esr_supported(mvm->fwrt.trans)) - ret = iwl_mvm_can_enter_esr(mvm, vif, desired_links); + ret = iwl_mvm_is_esr_supported(mvm->fwrt.trans) && + iwl_mvm_esr_allowed_on_vif(mvm, vif); + unlock: mutex_unlock(&mvm->mutex); return ret; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index 920fd0afbb59..0e0b8dae5284 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -1992,23 +1992,18 @@ void iwl_mvm_select_links(struct iwl_mvm *mvm, struct ieee80211_vif *vif); u8 iwl_mvm_get_primary_link(struct ieee80211_vif *vif); u8 iwl_mvm_get_other_link(struct ieee80211_vif *vif, u8 link_id); -#if IS_ENABLED(CONFIG_IWLWIFI_KUNIT_TESTS) -unsigned int iwl_mvm_get_link_grade(struct ieee80211_bss_conf *link_conf); -#endif - struct iwl_mvm_link_sel_data { u8 link_id; enum nl80211_band band; u16 grade; }; -u8 iwl_mvm_set_link_selection_data(struct ieee80211_vif *vif, - struct iwl_mvm_link_sel_data *data, - unsigned long usable_links, - u8 *best_link_idx); +#if IS_ENABLED(CONFIG_IWLWIFI_KUNIT_TESTS) +unsigned int iwl_mvm_get_link_grade(struct ieee80211_bss_conf *link_conf); bool iwl_mvm_mld_valid_link_pair(struct ieee80211_vif *vif, const struct iwl_mvm_link_sel_data *a, const struct iwl_mvm_link_sel_data *b); +#endif /* AP and IBSS */ bool iwl_mvm_start_ap_ibss_common(struct ieee80211_hw *hw, -- 2.34.1