From patchwork Tue Nov 16 21:28:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 12623209 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F5B4C433FE for ; Tue, 16 Nov 2021 21:28:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0310563232 for ; Tue, 16 Nov 2021 21:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230391AbhKPVbf (ORCPT ); Tue, 16 Nov 2021 16:31:35 -0500 Received: from mout.gmx.net ([212.227.17.20]:56845 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbhKPVbf (ORCPT ); Tue, 16 Nov 2021 16:31:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1637098110; bh=JjihNC2AuMle56rp/XZwqMFFyfo8WjXDke4I/IpBhek=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=f+7IyAwqkBrue5PnhRySoRtMi567QBNukMC7C1UebYBMsoU95zkB4nclrrGy8HZO0 Sxk6LxfvORM58mYSgzKOtYMModRSLuD2rwE0XGI7EEjZAQmYJmRK4Q1k6DcQHph4XR fh9a4HAS1FkHy8h4DhyLbmVmvmP6vvlV4ZYSeEUY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.fritz.box ([62.216.209.243]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MnJlc-1mLhnN49dk-00jMJU; Tue, 16 Nov 2021 22:28:30 +0100 From: Peter Seiderer To: linux-wireless@vger.kernel.org Cc: Johannes Berg , "David S . Miller" , Jakub Kicinski , Felix Fietkau , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [RFC v2] mac80211: minstrel_ht: do not set RTS/CTS flag for fallback rates Date: Tue, 16 Nov 2021 22:28:28 +0100 Message-Id: <20211116212828.27613-1-ps.report@gmx.net> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:i0D7gr7L/ZCMLUuc1pnVQU1UzGNyCFGILH/EzO2yW/WcxBLuIaT 2lPH/XkCH28ZPBg4U476PBfzrcqqOcH8iFvH15KRTtNwM+EF0eZVYlYIDGfOO4df8Hk/NEK 6OkqaIP4o59tIlYD61SK1/QSRLgIZo5EuY9SLSBAhOwg1Cxs4R/2L8rzoq6Ti7e1Q3Mhn9s Oe7e743WZmFK5/NKBquBQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:vfR6jKaB1wQ=:EZxKxdYDzgle0aw8IefyA7 iLYQK0VPBaz7ECtaTRipoJ63ecxY1wPjD32uYl6mEsK4EvRN7iVE4F0u/JLqK4VUr+6VXa2hL Bu5ql38/LjFPpj4ivg22SjmmKONYViNoHLKMfNaT3O6oMrqarMv2PvXpUthQpTOno8yheWKgp CHlZ/mfEtdUBHpzdR58C45XwprZRf4+sSF3mV+kM8/TCXcDFb5cqWnlEVnKDuqmli7Jp2Skl6 aa1pmqa+gZsoujubqvbBlswTUJykWToSgLU7G0zvhaA8QogsZmkbDw3cuFbwRmZUmWz4U4l/Y v7ltsUPmM6hOhUELtKkz+Xkpv0pNwi4xsiCNLF1+yS66Kd36uH6amyUlJk8HOGuj5fO6TYqMQ CWVrfgCu/h2113x9mztwWn90iQT+6muLotIkF39w0q4A53C7PuvigOS0WoUvCTYWM63WbidQG 9hbu4u9if92Y0bP7qChjS7q8E8JC3jKpZWXR0TenMnBkqUJBWCp/dUcAL+pdR4UGNG3Mhy3bL SIO/wnOUT3tqq3s1IjRBOy8SqDiCwNQu9YMCxYKfA2W34FSgQcGZA3Svr0NxZC0IO5Kd8u525 Vg6YZCzbqdYeVX3VdwT7goT3x4ghLhXhcxw4CwFiTakNIobOOIn6Ausqx2ow0BI8nOsv7JxeT Q1fH9Zivd+ZykiOm6+W/y1tkzh2gIx0qVmkK7Wu1pewYKPtw4um2jgWdTnn4AzsLjFqs2JaTa pg8nqv1TrMOX9cMC69n4hbUeMbVim1V8bvr62agCRculPkJeAFdVIhknVL2FbFiMBVzZbghdH pHCFID5g697gQAtwVZffVGLggYNaQB64r3tTqJpC91eB5lwafTySKNSjURqtmh2gOU68cOtqd uyfLy5rxjbFNwJNvIys/tCjFGQUTFsYXq4VA5yFAVzIh6Dn4sOyKv1l8LPWarPDcG6yQPL+Id n8sm0vTc54iXMaalAujnIS3aH+IuoRD/zANLBqzeA0tRgQ8Q01EQOdrWNpGhtrlQcu0QO1De3 a4DB3e+FkFQoQ/SvWApdx71H6GmCKYtLQEhQDKzOney2ZQblw3s40zNGx/1tXG9jkHVBCunzX ueEOki3YG0lu5A= Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Despite the 'RTS thr:off' setting a wireshark trace of IBSS traffic with HT40 mode enabled between two ath9k cards revealed some RTS/CTS traffic. Debug and code analysis showed that most places setting IEEE80211_TX_RC_USE_RTS_CTS respect the RTS strategy by evaluating rts_threshold, e.g. net/mac80211/tx.c: 698 /* set up RTS protection if desired */ 699 if (len > tx->local->hw.wiphy->rts_threshold) { 700 txrc.rts = true; 701 } 702 703 info->control.use_rts = txrc.rts; or drivers/net/wireless/ath/ath9k/xmit.c 1238 /* 1239 * Handle RTS threshold for unaggregated HT frames. 1240 */ 1241 if (bf_isampdu(bf) && !bf_isaggr(bf) && 1242 (rates[i].flags & IEEE80211_TX_RC_MCS) && 1243 unlikely(rts_thresh != (u32) -1)) { 1244 if (!rts_thresh || (len > rts_thresh)) 1245 rts = true; 1246 } The only place setting IEEE80211_TX_RC_USE_RTS_CTS unconditionally was found in net/mac80211/rc80211_minstrel_ht.c. As the use_rts value is only calculated after hitting the minstrel_ht code preferre to not set IEEE80211_TX_RC_USE_RTS_CTS (and overruling the RTS threshold setting) for the fallback rates case. Signed-off-by: Peter Seiderer --- Changes v1 -> v2: - change from 'respect RTS threshold setting' to 'do not set RTS/CTS flag for fallback rates' (see commit message for reasoning) --- net/mac80211/rc80211_minstrel_ht.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 72b44d4c42d0..f151acbe7bf5 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -1355,11 +1355,9 @@ minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, /* enable RTS/CTS if needed: * - if station is in dynamic SMPS (and streams > 1) - * - for fallback rates, to increase chances of getting through */ - if (offset > 0 || - (mi->sta->smps_mode == IEEE80211_SMPS_DYNAMIC && - group->streams > 1)) { + if (mi->sta->smps_mode == IEEE80211_SMPS_DYNAMIC && + group->streams > 1) { ratetbl->rate[offset].count = ratetbl->rate[offset].count_rts; flags |= IEEE80211_TX_RC_USE_RTS_CTS; }