From patchwork Wed Mar 20 07:13:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13597392 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 CFD8E2208F for ; Wed, 20 Mar 2024 07:14:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918859; cv=none; b=jXHhE6YxVjRlUqh7/TdTnoGfqAcvHrNIbdoPwMqnG9IxVIKjz6O4kk0Ulzb6o4gIHBcxEEpwAHWzLqY6NV5pqQEAig0Hhfu7IUOZVz7IJvX7KWk9+dXlpICc0KkBo3ig4kcd6CixLu/wSiUI8ijCIOeuZ89kNtyAJt6PqLby3T8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918859; c=relaxed/simple; bh=jYA5rmFK6ns6xtK1SrCtNjRmMM6pIneu5GEu2vkYJ44=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WkMyiMcRS3Etxy7n5GGjlMoN3m5sXWailhrt9OqdJ2qVv2H91mxdBmUEjvi7Me8/3RZ2VwMo2XvbQ69RqHpthwUoCy1phLUPG/F3xDLHcVq2SAfXT3a7Qc4h2LQxEVCJ2qq68h9VMEuLfZv5b2tPDwftA8h+al9rV6yrZtbB9Co= 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=Os9KdABe; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Os9KdABe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710918857; x=1742454857; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jYA5rmFK6ns6xtK1SrCtNjRmMM6pIneu5GEu2vkYJ44=; b=Os9KdABe7foWj1qJnv51u7BDilcPOLkeQ8uf70ObDEFokfae6XQiJXGF nx2SQMwdzvoNH7x8Dzt0L4elLVGjL7iRx/VhNtezPBjlN7fICi/LAG56e b0PcixVRMQjEY/BzOxoO4WeFyh1BkOlwzjr2dsB4xClZPFEJ9Sqp/VC33 9Bhmqrr4PJAbNIHXAVCqd6fPRp480EEH5ESDSocDFpyoaTbCT/MDpNoap u0jWZT51Gm5THKKIYC3ZztF2FUwHpq4i0SCQSHI/Xi1PqHLUWAxdWu3c0 Tg47RNbmfMqljT9o9DaUhQ4rPTVHVlzETKV98Rt03ATzxnRFPRhx0VG5n w==; X-IronPort-AV: E=McAfee;i="6600,9927,11018"; a="5763828" X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="5763828" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="14477397" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:15 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Benjamin Berg , Johannes Berg Subject: [PATCH 1/8] wifi: mac80211: do not call ieee80211_key_switch_links during reconfig Date: Wed, 20 Mar 2024 09:13:58 +0200 Message-Id: <20240320091155.6ab8520bd4a1.Iea3e7e5d8b2bb5db1dd93f6ca589e8ea1bacaf60@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240320071405.815427-1-miriam.rachel.korenblit@intel.com> References: <20240320071405.815427-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 From: Benjamin Berg The keys will be configured later by a call to ieee80211_reenable_keys. Signed-off-by: Benjamin Berg Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- net/mac80211/link.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/mac80211/link.c b/net/mac80211/link.c index 685ec66b4264..7f01462f84e9 100644 --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -375,8 +375,10 @@ static int _ieee80211_set_active_links(struct ieee80211_sub_if_data *sdata, WARN_ON_ONCE(ret); } - ret = ieee80211_key_switch_links(sdata, rem, add); - WARN_ON_ONCE(ret); + if (!local->in_reconfig) { + ret = ieee80211_key_switch_links(sdata, rem, add); + WARN_ON_ONCE(ret); + } list_for_each_entry(sta, &local->sta_list, list) { if (sdata != sta->sdata) From patchwork Wed Mar 20 07:13:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13597393 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 249FD23778 for ; Wed, 20 Mar 2024 07:14:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918861; cv=none; b=bFLLIAVGVtmI6YrUlmNdk0/lpQN7DYj9LHc3sBjdiAET057Do5ANu1WCifUOal9hnks79RzXj28XkfchIba0kiupJ0k6dPxHCwatOskcK0T+2mMMmD2pAx6viSxxSD47dU9ZQCTNAGzuvfT3gjApl5skKp3huEI2ISYFgoP5Qag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918861; c=relaxed/simple; bh=DV6yRITVcZS2bjN0kFl77JZPjPEXGlJb8iFBXArNIco=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JCFbtcw2LLhqa0Xs7jnlommFxA9284IjepBwn62Kp/mqq4Hrc9r+g7x6xJ8S8xksEaqqWQ0UfhUNcSF/g4mg/ehXPqU+apkra97QgKgcxmIos9vSKSnsiJqOO23gR0MWu1/+yyUqN4JXEM8gclGk+jmU/OedeYtBig/5N6ayJ6o= 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=k9/1QvTR; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="k9/1QvTR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710918859; x=1742454859; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DV6yRITVcZS2bjN0kFl77JZPjPEXGlJb8iFBXArNIco=; b=k9/1QvTRZleA1aYzVL7JbFpmApEM+7nFihFjPI8QT4oq8v4tKIQbNNuN ptQPpePEqxtyuhEy3Otd+mTJhzsGbNiQMCLdQfMgs/bdJz6uJblizHOsi cnO2vbsRoB0hdjlqWYZYI0tLsnYm4J6zO9DSjExREgpb0AwntfEr0HQhR 6iZhXgQ0TRY10fc/gQdtHaj8QEDR1JYJfEmrKKquF3fyoVb65LP88x8Da 9G+Dim2BJgkgz1NK8TjrBpVDoO7CE/EWTRnGmQtX5YPGuHBo6CDU9g+7F bg7/Q3cmpWirkQMnSDL801Nbp8oZPUtGPaCZ+Pad0ahVpOhhyNl4062fU Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11018"; a="5763830" X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="5763830" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="14477400" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:17 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 2/8] wifi: mac80211: don't enter idle during link switch Date: Wed, 20 Mar 2024 09:13:59 +0200 Message-Id: <20240320091155.170328bac555.If4a522a9dd3133b91983854b909a4de13aa635da@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240320071405.815427-1-miriam.rachel.korenblit@intel.com> References: <20240320071405.815427-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 From: Johannes Berg When doing link switch with a disjoint set of links before and after the switch, we end up removing all channel contexts, adding new ones later. This looks like 'idle' to the code now, and we enter idle which also includes flushing queues. But we can't actually flush since we don't have a link active (bound to a channel context), and entering idle just to leave it again is also wrong. Fix this by passing through an indication that we shouldn't do any idle checks in this case. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- net/mac80211/chan.c | 34 +++++++++++++++++++--------------- net/mac80211/ieee80211_i.h | 2 ++ net/mac80211/link.c | 2 +- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index 80e4b9784131..5a7fb0e4f89d 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -695,26 +695,29 @@ ieee80211_new_chanctx(struct ieee80211_local *local, } static void ieee80211_del_chanctx(struct ieee80211_local *local, - struct ieee80211_chanctx *ctx) + struct ieee80211_chanctx *ctx, + bool skip_idle_recalc) { lockdep_assert_wiphy(local->hw.wiphy); drv_remove_chanctx(local, ctx); - ieee80211_recalc_idle(local); + if (!skip_idle_recalc) + ieee80211_recalc_idle(local); ieee80211_remove_wbrf(local, &ctx->conf.def); } static void ieee80211_free_chanctx(struct ieee80211_local *local, - struct ieee80211_chanctx *ctx) + struct ieee80211_chanctx *ctx, + bool skip_idle_recalc) { lockdep_assert_wiphy(local->hw.wiphy); WARN_ON_ONCE(ieee80211_chanctx_refcount(local, ctx) != 0); list_del_rcu(&ctx->list); - ieee80211_del_chanctx(local, ctx); + ieee80211_del_chanctx(local, ctx, skip_idle_recalc); kfree_rcu(ctx, rcu_head); } @@ -1002,7 +1005,7 @@ int ieee80211_link_unreserve_chanctx(struct ieee80211_link_data *link) list_del_rcu(&ctx->list); kfree_rcu(ctx, rcu_head); } else { - ieee80211_free_chanctx(sdata->local, ctx); + ieee80211_free_chanctx(sdata->local, ctx, false); } } @@ -1218,7 +1221,7 @@ ieee80211_link_use_reserved_reassign(struct ieee80211_link_data *link) CHANCTX_SWMODE_REASSIGN_VIF); if (err) { if (ieee80211_chanctx_refcount(local, new_ctx) == 0) - ieee80211_free_chanctx(local, new_ctx); + ieee80211_free_chanctx(local, new_ctx, false); goto out; } @@ -1232,7 +1235,7 @@ ieee80211_link_use_reserved_reassign(struct ieee80211_link_data *link) ieee80211_check_fast_xmit_iface(sdata); if (ieee80211_chanctx_refcount(local, old_ctx) == 0) - ieee80211_free_chanctx(local, old_ctx); + ieee80211_free_chanctx(local, old_ctx, false); ieee80211_recalc_chanctx_min_def(local, new_ctx, NULL); ieee80211_recalc_smps_chanctx(local, new_ctx); @@ -1286,7 +1289,7 @@ ieee80211_link_use_reserved_assign(struct ieee80211_link_data *link) err = ieee80211_assign_link_chanctx(link, new_ctx); if (err) { if (ieee80211_chanctx_refcount(local, new_ctx) == 0) - ieee80211_free_chanctx(local, new_ctx); + ieee80211_free_chanctx(local, new_ctx, false); goto out; } @@ -1383,7 +1386,7 @@ static int ieee80211_chsw_switch_ctxs(struct ieee80211_local *local) if (!list_empty(&ctx->replace_ctx->assigned_links)) continue; - ieee80211_del_chanctx(local, ctx->replace_ctx); + ieee80211_del_chanctx(local, ctx->replace_ctx, false); err = ieee80211_add_chanctx(local, ctx); if (err) goto err; @@ -1400,7 +1403,7 @@ static int ieee80211_chsw_switch_ctxs(struct ieee80211_local *local) if (!list_empty(&ctx->replace_ctx->assigned_links)) continue; - ieee80211_del_chanctx(local, ctx); + ieee80211_del_chanctx(local, ctx, false); WARN_ON(ieee80211_add_chanctx(local, ctx->replace_ctx)); } @@ -1652,7 +1655,8 @@ static int ieee80211_vif_use_reserved_switch(struct ieee80211_local *local) return err; } -static void __ieee80211_link_release_channel(struct ieee80211_link_data *link) +void __ieee80211_link_release_channel(struct ieee80211_link_data *link, + bool skip_idle_recalc) { struct ieee80211_sub_if_data *sdata = link->sdata; struct ieee80211_bss_conf *link_conf = link->conf; @@ -1680,7 +1684,7 @@ static void __ieee80211_link_release_channel(struct ieee80211_link_data *link) ieee80211_assign_link_chanctx(link, NULL); if (ieee80211_chanctx_refcount(local, ctx) == 0) - ieee80211_free_chanctx(local, ctx); + ieee80211_free_chanctx(local, ctx, skip_idle_recalc); link->radar_required = false; @@ -1721,7 +1725,7 @@ int ieee80211_link_use_channel(struct ieee80211_link_data *link, if (ret < 0) goto out; - __ieee80211_link_release_channel(link); + __ieee80211_link_release_channel(link, false); ctx = ieee80211_find_chanctx(local, chanreq, mode); if (!ctx) @@ -1737,7 +1741,7 @@ int ieee80211_link_use_channel(struct ieee80211_link_data *link, if (ret) { /* if assign fails refcount stays the same */ if (ieee80211_chanctx_refcount(local, ctx) == 0) - ieee80211_free_chanctx(local, ctx); + ieee80211_free_chanctx(local, ctx, false); goto out; } @@ -1930,7 +1934,7 @@ void ieee80211_link_release_channel(struct ieee80211_link_data *link) lockdep_assert_wiphy(sdata->local->hw.wiphy); if (rcu_access_pointer(link->conf->chanctx_conf)) - __ieee80211_link_release_channel(link); + __ieee80211_link_release_channel(link, false); } void ieee80211_link_vlan_copy_chanctx(struct ieee80211_link_data *link) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 925e875f9b96..c2212363dad3 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -2567,6 +2567,8 @@ int __must_check ieee80211_link_change_chanreq(struct ieee80211_link_data *link, const struct ieee80211_chan_req *req, u64 *changed); +void __ieee80211_link_release_channel(struct ieee80211_link_data *link, + bool skip_idle_recalc); void ieee80211_link_release_channel(struct ieee80211_link_data *link); void ieee80211_link_vlan_copy_chanctx(struct ieee80211_link_data *link); void ieee80211_link_copy_chanctx_to_vlans(struct ieee80211_link_data *link, diff --git a/net/mac80211/link.c b/net/mac80211/link.c index 7f01462f84e9..503ec47bbc2a 100644 --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -358,7 +358,7 @@ static int _ieee80211_set_active_links(struct ieee80211_sub_if_data *sdata, ieee80211_teardown_tdls_peers(link); - ieee80211_link_release_channel(link); + __ieee80211_link_release_channel(link, true); } list_for_each_entry(sta, &local->sta_list, list) { From patchwork Wed Mar 20 07:14:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13597394 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 ED17C2BAF2 for ; Wed, 20 Mar 2024 07:14:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918863; cv=none; b=MT7vUNUv3269hkHFfYAfJl/TF95ns+LD4hGH19EqTcZnHtTnkRF6OOfY+q8ecdXJ0k2Lv6CVkD7C/ltZshz5ri5QqFCz1i3VAm+9YvE0x++sMafbwdkLT8YrbXKL3L6fuHeZwrT7S8xc5DfkNe7RQ4KrS7H1nE4UmwI0pyw6PQY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918863; c=relaxed/simple; bh=XfD/MD9aJLdMuYQ9JNy1aV5uqn0V5yb4tqrj6uooTpg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Torb0mFvqcOQu3uvfWJQFqewjA16u51srQGS+GsLV938JZREzlEbkeUi56IciGTl5itdb/zoSsDS/bJVXAQbHE1FskLpPYXbXadVPhN+cKKQEugRZnuN2VNAvE6kQQEGCpGA99stwqAgP9F7zdIWbm8O0P8tAUqQmSxUz6cK5Hg= 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=NeBzXDVH; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NeBzXDVH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710918861; x=1742454861; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XfD/MD9aJLdMuYQ9JNy1aV5uqn0V5yb4tqrj6uooTpg=; b=NeBzXDVHe1seBTLhAoU3c1Eo3ZtQ+78+nKutKPNRDqfDcxu83iw/UHc9 lPGqdZ6XeTaukz30LGCMwMcUAiBbltf4eZ2Wp2UFslnT4k5wPGUVn++Fv vWa1+LhX94vS3LRzdvye0EDZtKjclUsr1gow2ThIxL4OT6Koexg+t76ei mQrUH6S/mWo8HrfXYyTOjwYf0K8gnhEICyqhxs3LGyKSaJvvCm//B4E7L WXvkac8uCLyvc4LiyC5zCvd2Y3xTwShtf5VRALc/mZ5lE/fL6kTBPSikA pE9yLtVfQXRrnRWq4lQsg5VOB/r6cDsJL4rckZM6+snjIVWTsdSnxPph3 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11018"; a="5763832" X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="5763832" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="14477403" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:19 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Ayala Beker Subject: [PATCH 3/8] wifi: mac80211: clarify IEEE80211_STATUS_SUBDATA_MASK Date: Wed, 20 Mar 2024 09:14:00 +0200 Message-Id: <20240320091155.28ac7b665039.I1abbb13e90f016cab552492e05f5cb5b52de6463@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240320071405.815427-1-miriam.rachel.korenblit@intel.com> References: <20240320071405.815427-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 From: Johannes Berg We have 13 bits for the status_data, so restricting type to 4 and subdata to 8 bits is confusing, even if we don't need more bits now. Change subdata mask to be 9 bits instead, just to make things match up. If we actually need more types or more subdata bits we can later also reshuffle the bits between these, but we should probably keep them at 13 bits together. Signed-off-by: Johannes Berg Reviewed-by: Ayala Beker Signed-off-by: Miri Korenblit --- net/mac80211/ht.c | 2 +- net/mac80211/ieee80211_i.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c index c3330aea4da3..d7e8cf8e48b7 100644 --- a/net/mac80211/ht.c +++ b/net/mac80211/ht.c @@ -580,7 +580,7 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata, /* we'll do more on status of this frame */ info = IEEE80211_SKB_CB(skb); info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; - /* we have 12 bits, and need 6: link_id 4, smps 2 */ + /* we have 13 bits, and need 6: link_id 4, smps 2 */ info->status_data = IEEE80211_STATUS_TYPE_SMPS | u16_encode_bits(status_link_id << 2 | smps, IEEE80211_STATUS_SUBDATA_MASK); diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index c2212363dad3..fe81ab641620 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -90,7 +90,7 @@ enum ieee80211_status_data { IEEE80211_STATUS_TYPE_INVALID = 0, IEEE80211_STATUS_TYPE_SMPS = 1, IEEE80211_STATUS_TYPE_NEG_TTLM = 2, - IEEE80211_STATUS_SUBDATA_MASK = 0xff0, + IEEE80211_STATUS_SUBDATA_MASK = 0x1ff0, }; static inline bool From patchwork Wed Mar 20 07:14:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13597395 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 A2AB42C6BB for ; Wed, 20 Mar 2024 07:14:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918865; cv=none; b=pbx9cMXudzOrA//Sg749ZZC9wv6gWxdAJNVQcKP7MxvYvQrZkKqmLsq5k4C3/PD+y96XhBB2Jd/iyrtAA5192J/0FyE0/hojxkGZz22AlC4ZY2NhUctegEDzBe8NHzSSdvBTT5iK+0xlsQnYojDDL2JHjLij6LhyG9neH+jjeSg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918865; c=relaxed/simple; bh=tTL/viAfyjiu0dYZw/j1lxbLsfKv/fvkE2mrf9/csu4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CiW7JGOfApxSLK7+5d1bncRk8sKMj3zYvgSb0oPq3oniMGpTF480Pp/gy8degxlALsPd0ExIs7uBMIfedd2HIIwxrPMBq/tEudals2TU9ryy8T1zo8gdIUB+QJRHwHGrskMAtCrAc1BAjCvdqzlk11Mbez9mTzD6iRZYNWhK2O8= 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=O0cRlVMI; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="O0cRlVMI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710918864; x=1742454864; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tTL/viAfyjiu0dYZw/j1lxbLsfKv/fvkE2mrf9/csu4=; b=O0cRlVMIPPvB0Ub3TjxMQW0dhhpsCDE0FyEV1uIfWOOT2BtwUvSrR1NM 1eBdEyk1jn441xXAbgC4mm5XdYB6EBalde5Q2oWa8vzfZDCTVc6OYWvyv a7DNY9V8fZc0xlEFyDZ3+jI6tOW2CkDvd8lfLv6B87InUrcbU/oEQ4iX7 CHStUH7mFa0hPPNBuMiXgq3JWpa+XQemoYyM9faGCSyrufACw+KTT5HKs jDbUW2xKSjMtnApLmD6JrwRaBzJl7/YXHFqy4VhTPqHxqptvdcTuuBrGH zxWS+FspyGRh4hKiN81CPYQekaq3fs5l1leJEhLJ9txRpaeVkxiP314Jw w==; X-IronPort-AV: E=McAfee;i="6600,9927,11018"; a="5763834" X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="5763834" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="14477407" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:21 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Ilan Peer , Johannes Berg Subject: [PATCH 4/8] wifi: mac80211_hwsim: Declare HE/EHT capabilities support for P2P interfaces Date: Wed, 20 Mar 2024 09:14:01 +0200 Message-Id: <20240320091155.73ae309d27c2.I31ef6af2f1ebf54281858e2f63afcb10b61985fe@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240320071405.815427-1-miriam.rachel.korenblit@intel.com> References: <20240320071405.815427-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 From: Ilan Peer Declare HE/EHT capabilities support also for P2P client and P2P GO interface types. Signed-off-by: Ilan Peer Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/virtual/mac80211_hwsim.c | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c index 450913cf6583..30acd78926a6 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c @@ -4125,7 +4125,8 @@ static void hwsim_mcast_new_radio(int id, struct genl_info *info, static const struct ieee80211_sband_iftype_data sband_capa_2ghz[] = { { - .types_mask = BIT(NL80211_IFTYPE_STATION), + .types_mask = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_P2P_CLIENT), .he_cap = { .has_he = true, .he_cap_elem = { @@ -4232,7 +4233,8 @@ static const struct ieee80211_sband_iftype_data sband_capa_2ghz[] = { }, }, { - .types_mask = BIT(NL80211_IFTYPE_AP), + .types_mask = BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_P2P_GO), .he_cap = { .has_he = true, .he_cap_elem = { @@ -4383,8 +4385,8 @@ static const struct ieee80211_sband_iftype_data sband_capa_2ghz[] = { static const struct ieee80211_sband_iftype_data sband_capa_5ghz[] = { { - /* TODO: should we support other types, e.g., P2P? */ - .types_mask = BIT(NL80211_IFTYPE_STATION), + .types_mask = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_P2P_CLIENT), .he_cap = { .has_he = true, .he_cap_elem = { @@ -4508,7 +4510,8 @@ static const struct ieee80211_sband_iftype_data sband_capa_5ghz[] = { }, }, { - .types_mask = BIT(NL80211_IFTYPE_AP), + .types_mask = BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_P2P_GO), .he_cap = { .has_he = true, .he_cap_elem = { @@ -4679,8 +4682,8 @@ static const struct ieee80211_sband_iftype_data sband_capa_5ghz[] = { static const struct ieee80211_sband_iftype_data sband_capa_6ghz[] = { { - /* TODO: should we support other types, e.g., P2P? */ - .types_mask = BIT(NL80211_IFTYPE_STATION), + .types_mask = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_P2P_CLIENT), .he_6ghz_capa = { .capa = cpu_to_le16(IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START | IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP | @@ -4825,7 +4828,8 @@ static const struct ieee80211_sband_iftype_data sband_capa_6ghz[] = { }, }, { - .types_mask = BIT(NL80211_IFTYPE_AP), + .types_mask = BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_P2P_GO), .he_6ghz_capa = { .capa = cpu_to_le16(IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START | IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP | From patchwork Wed Mar 20 07:14:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13597396 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 935322CCD5 for ; Wed, 20 Mar 2024 07:14:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918867; cv=none; b=b8EQ+2zclWwL5jCYsg45cYZ3J9ZqWg11HnXyHzwaLs/f/6IZ4AwZd2O+n0QVb3qtqtvQTaeBpNLa0Tm9Xi8CLLVbtkG0eUSIAiozZ8/Q+f+jJCRVq7EOCJqO7sV3HbnzrGx2S3I1F24pjMM0dUjxMfHpxVcLkXwa1UaEQcODEZM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918867; c=relaxed/simple; bh=Oh/FWv3K/mVgkzq25lWsBxzlu55oL0B6MzEZgLlekqc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uP3iLGByLoCuL/DgZr3myMrUw4o950nANLYKDDMIalzzxOsP9L7Mp6aY0AdblFwyD+DG3ZfcAWtXUQs0wZkXF1NPrlXb0lXm6HBdvrefP1Ht2yC3l5RRjyyHAgNNAJCi5P/fDjt2DBjqI3/gJQFoXGnWi3LWMzbZMcxdgB3GrHA= 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=O5SWzW6D; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="O5SWzW6D" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710918866; x=1742454866; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Oh/FWv3K/mVgkzq25lWsBxzlu55oL0B6MzEZgLlekqc=; b=O5SWzW6DcQU6b/IHuPy2mM7r9cqTNzhqi+dQuxoTmjFQrfgR1w3XcZRB byVPLtSS9fN0ODD3z3wd0mv/t3yFd1evfV7TYgs9m/fp7sS2ff83qk+m2 VV1eX0m1EhRG7awQIR7FJn0WSSdxfZ4nZU0T9XC593O5w251hYG2weGWI 6BDKxQwwZnWgbaK4RrAM560nJRvMb/XHNSzDvUpjfe7f3MhQeCXhK5Rxt k2YiJFQTGwKCslJksq/CmrQoUm+OV1aEin8K5G0SJGgDCjv1hj6BDuPFO 9kyMwKFBREAQV34enK+sjHtGFyEBi8hxlZNc3nJUVufZfooVSnZMNbcdm g==; X-IronPort-AV: E=McAfee;i="6600,9927,11018"; a="5763841" X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="5763841" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="14477410" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:24 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Ayala Beker , Johannes Berg Subject: [PATCH 5/8] wifi: mac80211: don't select link ID if not provided in scan request Date: Wed, 20 Mar 2024 09:14:02 +0200 Message-Id: <20240320091155.a6b643a15755.Ic28ed9a611432387b7f85e9ca9a97a4ce34a6e0f@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240320071405.815427-1-miriam.rachel.korenblit@intel.com> References: <20240320071405.815427-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 From: Ayala Beker If scan request doesn't include a link ID to be used for TSF reporting, don't select it as it might become inactive before scan is actually started by the driver. Instead, let the driver select one of the active links. Fixes: cbde0b49f276 ("wifi: mac80211: Extend support for scanning while MLO connected") Signed-off-by: Ayala Beker Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- net/mac80211/scan.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 0429e59ba387..977f8eb0a67b 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -707,19 +707,11 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata, return -EBUSY; /* For an MLO connection, if a link ID was specified, validate that it - * is indeed active. If no link ID was specified, select one of the - * active links. + * is indeed active. */ - if (ieee80211_vif_is_mld(&sdata->vif)) { - if (req->tsf_report_link_id >= 0) { - if (!(sdata->vif.active_links & - BIT(req->tsf_report_link_id))) - return -EINVAL; - } else { - req->tsf_report_link_id = - __ffs(sdata->vif.active_links); - } - } + if (ieee80211_vif_is_mld(&sdata->vif) && req->tsf_report_link_id >= 0 && + !(sdata->vif.active_links & BIT(req->tsf_report_link_id))) + return -EINVAL; if (!__ieee80211_can_leave_ch(sdata)) return -EBUSY; From patchwork Wed Mar 20 07:14:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13597397 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 C272F1EB22 for ; Wed, 20 Mar 2024 07:14:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918870; cv=none; b=ojoeleGCXGyvJKtG1Ce2nvlGASDH8dNFRLRZMuGIJNZIosMrgUnKlmQgK72OZO8P4ZIAXRGsJw6f3B7aNlvCWFv2ZMNKXsLigm00rVwt2tLEaZ7r6InxHl5vtaZu4rzsmOUYzXLaFF0nI25iM/zXikaeInYWfAH+vRENkLsfaVk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918870; c=relaxed/simple; bh=6eUlFMEubQxbS9/JI+XiecwitNl0neGcOQzXq4fA+0o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=c8hJJB/aL8HeAAdEkntqOTop726cjBj/O9kTXkI/I1ohw++PzxLboHKZEpshOnPV+wbxFDhD+PPG5RIED0Q7p1mbNU+C49dvfS9meGYrU4EBR7WO8xeEa62D/Vi5dhghU+OGEK2GFnBQnOT0XG2B+zmFhc0B08o3mlJKE+nBxHo= 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=YXDaB43E; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YXDaB43E" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710918869; x=1742454869; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6eUlFMEubQxbS9/JI+XiecwitNl0neGcOQzXq4fA+0o=; b=YXDaB43EuTe4wA+w3ubTkzDGfpcBdK/ZZevmWny3JoQsKruQZAiXC/Dl 0Dod8m8KFP1HNbl3Oq5ApYMuJWtuiMz0UxOpUqcXnFySfhG+iTnrVaYTO S+lH2SxVfqrFSP0O+2dmrD5ydlG1OBDC68JyTLb2gdFh9foIWUOI8crwR gBU/g65v3nuXdDl5yGq/Nfz5eqbs7z3FHZVecPN7gHk87jZjbkTyvjB8N HiDBp3GjrqjdG1ic7PdzqJYY5aiHZt5Qw0Gu7K/9CJ6ir29G/SJiVoieq 42rhX2HqYI3fbgkTPbsi0wdBLZX47y1MwW4y/8SuBEapa8snF9kubhsMr w==; X-IronPort-AV: E=McAfee;i="6600,9927,11018"; a="5763845" X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="5763845" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="14477413" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:26 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 6/8] wifi: mac80211: don't ask driver about no-op link changes Date: Wed, 20 Mar 2024 09:14:03 +0200 Message-Id: <20240320091155.a8190a312a27.If4e6f5ce8228eda7afac0fc8c17dd731c5da9ed9@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240320071405.815427-1-miriam.rachel.korenblit@intel.com> References: <20240320071405.815427-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 From: Johannes Berg If the links won't actually change, nothing will happen. This was previously done in the inner function (twice in some cases), but we shouldn't bother the driver with it. Clean that up. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- net/mac80211/link.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/mac80211/link.c b/net/mac80211/link.c index 503ec47bbc2a..84efb6487970 100644 --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -452,10 +452,13 @@ int ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links) if (WARN_ON(!active_links)) return -EINVAL; + old_active = sdata->vif.active_links; + if (old_active == active_links) + return 0; + if (!drv_can_activate_links(local, sdata, active_links)) return -EINVAL; - old_active = sdata->vif.active_links; if (old_active & active_links) { /* * if there's at least one link that stays active across From patchwork Wed Mar 20 07:14:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13597398 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 6695C1EB44 for ; Wed, 20 Mar 2024 07:14:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918872; cv=none; b=mM4jcVx8RKOKR8qvUIlq2/ZY6nauxZUbi1hT9JALI86j0HLzkSRwJ+OUg092kkJOShu+9YiBM7DTrF4UDOab/U8yey5NOvZkOiVDXVbcScIC0m/ZhaVxsInOI/4oFiUVsSN88rm3wmoU1uIkNsomepaKCfrMQXoxrIKTcaFkaW4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918872; c=relaxed/simple; bh=ZtKFd3Bi4Cle40OK/sRPs46B+k4y2b9A0Jtju5McVHI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mgxJSs6LRpk+6sDdaiBkQKQgUdCPSJmPYP5x8IpawE7vGPULsIY50K91ViDnhSh2lPxWj5MItv0YqN9UIY8q3EfbpAJfOySnIOJLuS2mc7Ht9jzCParsliiXCURnUJpcCPsCxwAQjXJkiDanYs26tzAa7qGGYd19ySBp1+olR70= 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=QlqKCtjk; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="QlqKCtjk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710918870; x=1742454870; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZtKFd3Bi4Cle40OK/sRPs46B+k4y2b9A0Jtju5McVHI=; b=QlqKCtjkUvLwv/2xil1FDO80K8aBBD9cmzHOshCk3cO3afBXIpnS/Njz NiFZQ91NT/Quow+9+8e03BT18r/LYuNmkqJQUAbEP1tfQlXQmJPyHqxmd CFtm0F8Bb8/39l+aNcepAIw8f3d3TegHtIQHZdl5kP59puY6GSFEKudDA 4g5ETRSvftRrgIa2I0NbbVjr01vxxrnaRA3bsldfF7P8ysS2w7835e9Ec CJTbBAFEs0EGUcomewxkM6ZEa7a0fYhDvTwOIUOCKz5hhQPROKG4Uh4JZ ODAMKB6e39gOcdUs4Ntadgi+JdbdN6bkNfsYCb9pTb7rzkjeCbZRmqgVY A==; X-IronPort-AV: E=McAfee;i="6600,9927,11018"; a="5763847" X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="5763847" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="14477421" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:29 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 7/8] wifi: mac80211: improve drop for action frame return Date: Wed, 20 Mar 2024 09:14:04 +0200 Message-Id: <20240320091155.34daf0a89eb4.I60e0639511f9de64e40e6105b640adf90f8f57f7@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240320071405.815427-1-miriam.rachel.korenblit@intel.com> References: <20240320071405.815427-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 From: Johannes Berg If we use a drop we not only save the extra call to dev_kfree_skb(), but also have a better reason in tracing, so do that. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- net/mac80211/drop.h | 3 ++- net/mac80211/rx.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/net/mac80211/drop.h b/net/mac80211/drop.h index 12a6f0e9eca6..59e3ec4dc960 100644 --- a/net/mac80211/drop.h +++ b/net/mac80211/drop.h @@ -2,7 +2,7 @@ /* * mac80211 drop reason list * - * Copyright (C) 2023 Intel Corporation + * Copyright (C) 2023-2024 Intel Corporation */ #ifndef MAC80211_DROP_H @@ -66,6 +66,7 @@ typedef unsigned int __bitwise ieee80211_rx_result; R(RX_DROP_U_UNEXPECTED_STA_4ADDR) \ R(RX_DROP_U_UNEXPECTED_VLAN_MCAST) \ R(RX_DROP_U_NOT_PORT_CONTROL) \ + R(RX_DROP_U_UNKNOWN_ACTION_REJECTED) \ /* this line for the trailing \ - add before this */ /* having two enums allows for checking ieee80211_rx_result use with sparse */ diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index c1f850138405..4b4cbd8bf35d 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -3958,8 +3958,8 @@ ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx) __ieee80211_tx_skb_tid_band(rx->sdata, nskb, 7, -1, status->band); } - dev_kfree_skb(rx->skb); - return RX_QUEUED; + + return RX_DROP_U_UNKNOWN_ACTION_REJECTED; } static ieee80211_rx_result debug_noinline From patchwork Wed Mar 20 07:14:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13597399 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 A49AE1EB44 for ; Wed, 20 Mar 2024 07:14:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918876; cv=none; b=hDmLJQWTCCipV37S89GzPzmUKRszJlOBhaHgki3RlzZLMH7ARql1GYa7iMZ86J7/j2fTj0KgFBEayE3aRtzLQSXhl6s/0lbbercJzWCtn6D1lP3PQTHoQbPyUx/K+HknowDGaeN0QPqj8gRvn0w7UocrZm+NMl5Se+OT7OZBcBg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710918876; c=relaxed/simple; bh=/cc65Oa0aaFaRbS1B5xQMhyQXFJsA9V7cUmzv9Rf5io=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Jv5bQIWDZ+FmznAsgjbtD23VQeRcxMTvQ0goQMYZTtCWMYJftk/yScpDim+T+lcN51FMW3+XREpbfXlDSciYVBPlAzOXp3K30OgcC2w/1wGzXEOtIk+ELqZwYjWDI8NmzDxwLB0n1XxZF1QZ6Ye9rVdsAkxF27zmGgbveDbWJXQ= 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=faG8jmep; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="faG8jmep" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710918875; x=1742454875; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/cc65Oa0aaFaRbS1B5xQMhyQXFJsA9V7cUmzv9Rf5io=; b=faG8jmepqFCdBGb8txEfJ83CfwfQHC6d42c3Rf/NYqgucOURhCxbHunp 8S0lmSjj+ZYrVTRt8o97mPtuWLC7ToIOhWgg7Ux1QNdKoIOwVuOuMW4w+ NnODMFPgIOSDVZJnt/P9R1qydD21aDMspRvxKjMRg7QhfW2fsUWBot4d9 xz3O9WRJRo+ZO3ge0Juox9yq8FS5BoVxYdIV2385ILxCJAKBzDvcT7S8j EtPnskLYbLTGQmzzghP3GyCLtrJVvIIitsG4x1Euau0Ub5kPM/Y/zEfWg J1/I8EthhqLsrcTnZIrO2enk/tFh7/04/XUAAI9I9rgOxArzoAlObM0Gs A==; X-IronPort-AV: E=McAfee;i="6600,9927,11018"; a="5763850" X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="5763850" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="14477427" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 00:14:31 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 8/8] wifi: mac80211: reactivate multi-link later in restart Date: Wed, 20 Mar 2024 09:14:05 +0200 Message-Id: <20240320091155.d0f18a56335d.Ib3338d93872a4a568f38db0d02546534d3eff810@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240320071405.815427-1-miriam.rachel.korenblit@intel.com> References: <20240320071405.815427-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 From: Johannes Berg In case of restart, we currently reactivate multi-link on interfaces before reconfiguring keys etc. which means the drivers need to handle this case differently. Enable more links later to allow them to handle it the same way. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- net/mac80211/ieee80211_i.h | 2 ++ net/mac80211/util.c | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index fe81ab641620..def611e4e55f 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1161,6 +1161,8 @@ struct ieee80211_sub_if_data { struct wiphy_work activate_links_work; u16 desired_active_links; + u16 restart_active_links; + #ifdef CONFIG_MAC80211_DEBUGFS struct { struct dentry *subdir_stations; diff --git a/net/mac80211/util.c b/net/mac80211/util.c index a5d5e05688b4..cda398d8f60d 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1932,6 +1932,8 @@ int ieee80211_reconfig(struct ieee80211_local *local) old); } + sdata->restart_active_links = active_links; + for (link_id = 0; link_id < ARRAY_SIZE(sdata->vif.link_conf); link_id++) { @@ -2059,9 +2061,6 @@ int ieee80211_reconfig(struct ieee80211_local *local) WARN_ON(1); break; } - - if (active_links) - ieee80211_set_active_links(&sdata->vif, active_links); } ieee80211_recalc_ps(local); @@ -2102,6 +2101,13 @@ int ieee80211_reconfig(struct ieee80211_local *local) list_for_each_entry(sdata, &local->interfaces, list) ieee80211_reenable_keys(sdata); + /* re-enable multi-link for client interfaces */ + list_for_each_entry(sdata, &local->interfaces, list) { + if (sdata->restart_active_links) + ieee80211_set_active_links(&sdata->vif, + sdata->restart_active_links); + } + /* Reconfigure sched scan if it was interrupted by FW restart */ sched_scan_sdata = rcu_dereference_protected(local->sched_scan_sdata, lockdep_is_held(&local->hw.wiphy->mtx));