Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp362582pxf; Wed, 7 Apr 2021 01:05:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOzsQdqmZ/v8nGnRxMYP7AtJDNwCdPIL28+1BgXtgkSLqQqTYzYApmp1i//Q9V4xyn569P X-Received: by 2002:a6b:f802:: with SMTP id o2mr1606472ioh.197.1617782745736; Wed, 07 Apr 2021 01:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617782745; cv=none; d=google.com; s=arc-20160816; b=0ACkNDi5IbwBUA49w+g0VQYY+P5/IGV1OuUPRWaWEAxKKhYJ8ZDytKsAEYK6cF+tYN IDwMpDRiSZ4NMIe20cM5kyO1DwPZUYJMGqEujmiVPaVCxVkY9prjJABOjQHvyQAsStSx 7y1hw0O9AJQGXty+FdTeZ6ZVHpnSTRb72sC4JNdoXxtJwFG7QdPlOXDmoIIAL245bY0m 9P5OwCUDf7H6azQQglU+OSLx/flm65QknLUOsvXsmnVuLCVipo7+Y94Ih3XgJmGPgHW0 7Ml133A1yQ94tlGGQ7KAiM5m3/B6wB8jqWdm7d80aJt5dFPo2s7gTMyfFttT8fLzv0cI hnOw== 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:to:from:dkim-signature; bh=OWqQFrPlWSOoTfV2qTbhbwEDNJ7XXI9Atjex8euzvzo=; b=lyAmyENzU/vgpqJeZxUXn+Wfs4QBJRzltU8PWEI/MxIuNnfqlB8VzhTD0Hhe52ypOs afxrSUatUlKMBgseMkCzOKHdbJMuw2xNlrXn5smojLrsU7lD1HfBPu171bN9+AOqyCaU oJ6WCaiNNEy2aHiSGBqO4sFFIGosljH0sMUhKQLHEawurr+/BeE5XtNL6Tez1TYEwRtJ AX8cmlgl2R2eQGD9t9JFSictg/MYXMs7GaUzg/cFzNgxtKYIjn8KWTrb+gHSAAHydXPT 2K77RKJhGUTt+pW/rpf0gfwZQADydfb0Zrhf3d0ClhFEF1p6jvQZp5mAHBboO03hFHul 68Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=taV7E67p; 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 b23si20076033ioz.86.2021.04.07.01.05.32; Wed, 07 Apr 2021 01:05:45 -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=taV7E67p; 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 S240782AbhDFSWu (ORCPT + 99 others); Tue, 6 Apr 2021 14:22:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234933AbhDFSWt (ORCPT ); Tue, 6 Apr 2021 14:22:49 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8437CC06174A for ; Tue, 6 Apr 2021 11:22:41 -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 :To:From:Sender:Reply-To:Cc: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=OWqQFrPlWSOoTfV2qTbhbwEDNJ7XXI9Atjex8euzvzo=; b=taV7E67pqfwtvRLka8aKK36D+Y zLeASR9UqKW2NlLbNTROz7czwSkxE9B8CprDnti+LpMGJOsUXKsESIwgMtfO7hyBSfCSFfA85xtOt sU3n/naqwM5Jn+fKl85WqHlk9W4ERBGwjobS/BjvqvM9Sog4dINUUrScJmVtLmLU3FY8=; Received: from p4ff13c8d.dip0.t-ipconnect.de ([79.241.60.141] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lTqLW-00075B-R9 for linux-wireless@vger.kernel.org; Tue, 06 Apr 2021 20:22:38 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH] mt76: fix rx amsdu subframe processing Date: Tue, 6 Apr 2021 20:22:35 +0200 Message-Id: <20210406182235.14377-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 When receiving an A-MSDU containing only a single subframe, status->last_amsdu is set, but no previous head is present in the rx A-MSDU queue. In this case, the A-MSDU subframe will be held until the next one is received, potentially causing significant extra latency. Fix this by releasing the frame instead of creating a new queue head if last_amsdu is set. Fixes: c7fd4a5d3f75 ("mt76: mt7915: enable hw rx-amsdu de-aggregation") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mac80211.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index 7684a8cf00fb..0d92b658b6a6 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -517,10 +517,14 @@ static void mt76_rx_release_burst(struct mt76_phy *phy, enum mt76_rxq_id q, /* first amsdu subframe */ if (status->amsdu && !phy->rx_amsdu[q].head) { + if (status->last_amsdu) { + nskb = skb; + goto reset_burst; + } phy->rx_amsdu[q].tail = &skb_shinfo(skb)->frag_list; phy->rx_amsdu[q].seqno = status->seqno; phy->rx_amsdu[q].head = skb; - goto enqueue; + return; } /* ampdu or out-of-order amsdu subframes */ @@ -543,7 +547,6 @@ static void mt76_rx_release_burst(struct mt76_phy *phy, enum mt76_rxq_id q, reset_burst: phy->rx_amsdu[q].head = NULL; phy->rx_amsdu[q].tail = NULL; -enqueue: if (nskb) __skb_queue_tail(&dev->rx_skb[q], nskb); } -- 2.30.1