Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp392528ybi; Fri, 7 Jun 2019 09:44:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOv1ZU+4B91D+ZLWh306xrXKJrF8YAwKZYAZLCyOZ85eH8cIb2dVj+gct93B9COKDOmBjX X-Received: by 2002:a17:902:20eb:: with SMTP id v40mr56578128plg.239.1559925871265; Fri, 07 Jun 2019 09:44:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559925871; cv=none; d=google.com; s=arc-20160816; b=YXq7yeK/5L286+5OgOHiWR2wH1fa3sPug/HxIaDchLIGHz4nJt/hLv9PW10JUmldEi J/QcfrHgYZz6m4vVUnuGV9vZe+xqef7dqNLeu/O6IE0Bq/o6P72hZcAYzMLZfItN3UFR JC2HQl5DPAArVnB1cz366vdMWr+SFyD6KpDM1hIfmWiBLXh4OgPU0u9kwFur8hrPt/r1 lkBeTobIi+lq/gHl6RLKycbY8wYLr2CSd4eIKZ0rLKF2oZjizKyFcKuG9KELyGVNdd7S ZfMpRsd/ajLMlq/Xt2o3ITjcgneL8XmqS2/d4p/8BUvAix5xnJsC+xL01XEGnRRcGquV WlHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature; bh=xCHMrLAO5Q2Yd+Lh2OSxw6vaBzQBBrYFHGUmZS75spE=; b=P12Aanxc4XMI3IS961q6ka7SnotknmcbzKfJHOdNX7XGtKjGntQKtEFe9snGz6svtZ iL/32BJXwSUnLmgsIiDpRSrzgHM2VGUYphZnqx4R/WQ5ni3dbmbnw+MGTpqD1ugOaWza D+YAaY87j0tEZ1EA2ye0dVPCEj1+EjE3NPTJSZLeeBS+Me9zfMQJD8qgRLLfott8rNBf BDKMfoADAg62O7i9w4+fDn6C65GK4DJQ7nVVkm8/wfZEstaaw9i+FkpIf4K00f4sqfIn g/GYgqiCerGLXCYQ/QxMvbeQuQ0FDe7f1BBhGMo19GwhLMkpZ9gLOGf1/yvxwI56yZoc 4p4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=l9S3c7Oa; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si2241364plv.26.2019.06.07.09.44.15; Fri, 07 Jun 2019 09:44:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=l9S3c7Oa; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730985AbfFGQoA (ORCPT + 99 others); Fri, 7 Jun 2019 12:44:00 -0400 Received: from nbd.name ([46.4.11.11]:58272 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730169AbfFGQoA (ORCPT ); Fri, 7 Jun 2019 12:44:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xCHMrLAO5Q2Yd+Lh2OSxw6vaBzQBBrYFHGUmZS75spE=; b=l9S3c7OaXCI8MkxUnWshCoP+fO p4nlQp6jGlkyvrPkyIAQGRYwI2qmAD3QW4vylfP83ex7KIlPxLCfkfme3ngeArCi7msQZUxZpeM20 pUWt6m2WH4woocKo0Sv62smmjIVNdCqWBHFiRqzkCfJ3ZE3QmT554T7sahAMU0Vd1FNE=; Received: from p4ff13bc7.dip0.t-ipconnect.de ([79.241.59.199] helo=maeck-3.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hZHyA-0008DB-IK for linux-wireless@vger.kernel.org; Fri, 07 Jun 2019 18:43:58 +0200 Received: by maeck-3.local (Postfix, from userid 501) id B430B5C32BC1; Fri, 7 Jun 2019 18:43:57 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 4/4] mt76: mt76x02: fix tx reordering on rate control probing without a-mpdu Date: Fri, 7 Jun 2019 18:43:55 +0200 Message-Id: <20190607164355.51876-4-nbd@nbd.name> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190607164355.51876-1-nbd@nbd.name> References: <20190607164355.51876-1-nbd@nbd.name> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org To avoid aggregating rate control probing packets with other traffic, and to ensure that the probing rate gets used, probing packets get assigned a different internal queueing priority. This causes packets to be transmitted in a different order, which is compensated by the receiver side reordering. However, if A-MPDU is disabled, this reordering can become visible to upper layers on the receiver side. Disable the priority change if A-MPDU is disabled. Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c | 3 ++- drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c b/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c index 95c73049a68b..9f1c4e085380 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c @@ -154,6 +154,7 @@ int mt76x02_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx_info->skb->data; struct mt76x02_txwi *txwi = txwi_ptr; + bool ampdu = IEEE80211_SKB_CB(skb)->flags & IEEE80211_TX_CTL_AMPDU; int hdrlen, len, pid, qsel = MT_QSEL_EDCA; if (qid == MT_TXQ_PSD && wcid && wcid->idx < 128) @@ -171,7 +172,7 @@ int mt76x02_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, txwi->pktid = pid; - if (mt76_is_skb_pktid(pid)) + if (mt76_is_skb_pktid(pid) && ampdu) qsel = MT_QSEL_MGMT; tx_info->info = FIELD_PREP(MT_TXD_INFO_QSEL, qsel) | diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c b/drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c index 2436f14ca24a..04bfc923ac71 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c @@ -79,6 +79,7 @@ int mt76x02u_tx_prepare_skb(struct mt76_dev *mdev, void *data, struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76); int pid, len = tx_info->skb->len, ep = q2ep(mdev->q_tx[qid].q->hw_idx); struct mt76x02_txwi *txwi; + bool ampdu = IEEE80211_SKB_CB(skb)->flags & IEEE80211_TX_CTL_AMPDU; enum mt76_qsel qsel; u32 flags; @@ -96,7 +97,7 @@ int mt76x02u_tx_prepare_skb(struct mt76_dev *mdev, void *data, txwi->pktid = pid; - if (mt76_is_skb_pktid(pid) || ep == MT_EP_OUT_HCCA) + if ((mt76_is_skb_pktid(pid) && ampdu) || ep == MT_EP_OUT_HCCA) qsel = MT_QSEL_MGMT; else qsel = MT_QSEL_EDCA; -- 2.17.0