Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4324682pxv; Tue, 29 Jun 2021 04:31:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+51ZJVKbOWgurNQZi+k2Jtlr+NFkw1e78AiFpnoe5xuYjK/oOOJcOQXPiaNoWegMce+tA X-Received: by 2002:a92:7312:: with SMTP id o18mr20655642ilc.289.1624966260607; Tue, 29 Jun 2021 04:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624966260; cv=none; d=google.com; s=arc-20160816; b=pqAAG4WXF8S9LcGJyBr6UFP9s9ktK/k+5li2cK1coWzxr45ZFgEfHgL8v2dd8bbHis ORNBlnLeCT/yvMqvsIvC3tHbfyHVucgAKWdYVCi9G60JCtcZyoRG3C5LcaAEjho0as79 e6RL7aW5gn/MUd8oB7ZKCXMyfYNnE6Hfrmj9PXr4jzWVCwKVmqHvvg1sjLyOmpQD4luc Zcc2ZOidDY+tbTIMjMtihG67g1kADMa52HmKh3e+v+Ukn237ztBDrSCYRimxbltVcbX/ BucJx/50/2bo0vg/7KcFrGD1rkT5wG+Q2EoAESbAsg5YGjHe5lF8gng8czJZg7/nHdzf EygQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=COxEAXPCUPIInmlp3mCbquU+blypUSMoxsW40vsGPTo=; b=pTKT+dG2TrjXA1e3/Thh9kSrumFWRgK4Dgkjn6CVuAYZSBhZnwRyd2ZhJWk8rap+e2 hNfaM1wcBIO4K4bSbS5Db2jmpmwzYCg8k33xMDd0ZsJJ9v9GERXCFvp2d6VrHywX4zjS J7CKDkUOnpYPrWtljqJRyRo4j1sdEK+DHU0M8EgWfbfKJfq1mOnnDgbPygpDTnEEPWu7 4Gwg2EnmLrklliIwadzDyfWi4HgGe+/kYD7joO0rCJx43FH71hFHTi72xAkDhnQYDbe3 OrlmoDi+OMlRCb/J4ujDjNbL8aSdXKVVSOzzH63hyUJ4O13bmIlXFpBp13Xf8c1opN1Z TPAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=BOO+Q5Qr; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l7si5717119iow.4.2021.06.29.04.30.41; Tue, 29 Jun 2021 04:31:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=BOO+Q5Qr; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233421AbhF2Lb0 (ORCPT + 99 others); Tue, 29 Jun 2021 07:31:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233281AbhF2Lb0 (ORCPT ); Tue, 29 Jun 2021 07:31:26 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 329A9C061760 for ; Tue, 29 Jun 2021 04:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=COxEAXPCUPIInmlp3mCbquU+blypUSMoxsW40vsGPTo=; b=BOO+Q5QrXB9dBDFEh7IN3UT5wr u8qFcGJ/eviBeKpxz6BE5K261+xKCDDlru7QQIKfBTa7QTcIDKEx17bLbH3lxJyx/WnSh0O3MJ3ZR 27Oo06n7GqOguzEjCVmRnB1zVIgJ+R0kTEjXDAtNvzoQnCTF9xcBSAah13zrAA5k1aYE=; Received: from p54ae93f7.dip0.t-ipconnect.de ([84.174.147.247] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lyBvD-0006Bt-PZ; Tue, 29 Jun 2021 13:28:55 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH] mac80211: fix starting aggregation sessions on mesh interfaces Date: Tue, 29 Jun 2021 13:28:53 +0200 Message-Id: <20210629112853.29785-1-nbd@nbd.name> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The logic for starting aggregation sessions was recently moved from minstrel_ht to mac80211, into the subif tx handler just after the sta lookup. Unfortunately this didn't work for mesh interfaces, since the sta lookup is deferred until a much later point in time on those. Fix this by also calling the aggregation check right after the deferred sta lookup. Fixes: 08a46c642001 ("mac80211: move A-MPDU session check from minstrel_ht to mac80211") Signed-off-by: Felix Fietkau --- net/mac80211/tx.c | 57 ++++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index e96981144358..8509778ff31f 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1147,6 +1147,29 @@ static bool ieee80211_tx_prep_agg(struct ieee80211_tx_data *tx, return queued; } +static void +ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata, + struct sta_info *sta, + struct sk_buff *skb) +{ + struct rate_control_ref *ref = sdata->local->rate_ctrl; + u16 tid; + + if (!ref || !(ref->ops->capa & RATE_CTRL_CAPA_AMPDU_TRIGGER)) + return; + + if (!sta || !sta->sta.ht_cap.ht_supported || + !sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO || + skb->protocol == sdata->control_port_protocol) + return; + + tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; + if (likely(sta->ampdu_mlme.tid_tx[tid])) + return; + + ieee80211_start_tx_ba_session(&sta->sta, tid, 0); +} + /* * initialises @tx * pass %NULL for the station if unknown, a valid pointer if known @@ -1160,6 +1183,7 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, struct ieee80211_local *local = sdata->local; struct ieee80211_hdr *hdr; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + bool aggr_check = false; int tid; memset(tx, 0, sizeof(*tx)); @@ -1188,8 +1212,10 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, } else if (tx->sdata->control_port_protocol == tx->skb->protocol) { tx->sta = sta_info_get_bss(sdata, hdr->addr1); } - if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) + if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) { tx->sta = sta_info_get(sdata, hdr->addr1); + aggr_check = true; + } } if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && @@ -1199,8 +1225,12 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, struct tid_ampdu_tx *tid_tx; tid = ieee80211_get_tid(hdr); - tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); + if (!tid_tx && aggr_check) { + ieee80211_aggr_check(sdata, tx->sta, skb); + tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); + } + if (tid_tx) { bool queued; @@ -4120,29 +4150,6 @@ void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac) } EXPORT_SYMBOL(ieee80211_txq_schedule_start); -static void -ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata, - struct sta_info *sta, - struct sk_buff *skb) -{ - struct rate_control_ref *ref = sdata->local->rate_ctrl; - u16 tid; - - if (!ref || !(ref->ops->capa & RATE_CTRL_CAPA_AMPDU_TRIGGER)) - return; - - if (!sta || !sta->sta.ht_cap.ht_supported || - !sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO || - skb->protocol == sdata->control_port_protocol) - return; - - tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; - if (likely(sta->ampdu_mlme.tid_tx[tid])) - return; - - ieee80211_start_tx_ba_session(&sta->sta, tid, 0); -} - void __ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev, u32 info_flags, -- 2.30.1