Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp639664pxv; Thu, 15 Jul 2021 12:11:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywgCqYoNVtIniIFZjUFIZHC8kPUTBdoANJMSU4tZAuspbXkZtyKnozS6gfoXk3+2gZrsg0 X-Received: by 2002:a92:660f:: with SMTP id a15mr3912817ilc.182.1626376288164; Thu, 15 Jul 2021 12:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376288; cv=none; d=google.com; s=arc-20160816; b=Xy8lFudbwf/5Nvt3ay5PMkub1m+lrm1u6NKhVCbeITX9tuzAZxRqHKOSrWMiB3pNcH 8HcWLePjTsEH1PG1mDtFVStWviX2xy5+ZURwwvoE8EZ0ATA6NT6sET9lVyT6Yp/Dar+I Ynd/KhsfaehrKcdx3Pa2RPl6BztecTmfSLIj/8B4VGmy5dBDo4O6Q0Y11VGhiXRDH5EE INiCTkMZjRNPc2bGD8NoSFEUMHzNEjixIpSSDvG3FDK/+5enOS8aezg0NNL7a8qUCyeB CtkETK0bbkl05jMua+MMrpU4mWhsC0ZS8k+m47cRlDslFam0FT728+LZ4fRKiioSkZVY dF2Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ndV632vIODQ07Pc62OLOqlrxDqma7ybok/yMdpGkwxs=; b=GvZuF86pynfZ5cKaGG/QOUhmFpfK+jkyPNzBNCTTcgpB75Thm2gEeEC0N6NhihPVX5 ys9B8J5HACr/Tgf5bKivJz/kEM6FV6oWIdJ1rTlithqx5l8wruMZqLisAEZyxZeDc7Qt OYf0+8MiWn76vYFJKhq/SSK5QjcfEhmwDCJTJlA7QEkleIbp7SWDrm2ZJKtka4k35S/3 +BfIUC1KP9jbIWEHIEQ/rhphtNCnLh/ZF7X18G/PAD0dXdcYKngW4aMrytkBZAFRqg44 h8Z+5gpNiDmmW1nCn157GIRY/Eb4r5U+Cyp6e0TFU5qcWuNUFoA6dwjffnQVk1Gl53l+ 0JQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pgIqmy2P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w4si7906989ilm.77.2021.07.15.12.11.13; Thu, 15 Jul 2021 12:11:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pgIqmy2P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241248AbhGOTMz (ORCPT + 99 others); Thu, 15 Jul 2021 15:12:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:38430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240617AbhGOTAz (ORCPT ); Thu, 15 Jul 2021 15:00:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2137561158; Thu, 15 Jul 2021 18:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375463; bh=sJtv/WdN+bUh2CGo+fSl+5fnkGlbnS7mWPAyvRD7Z1Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pgIqmy2PrzJJJ9HARHyKJvHs5dW13niO+YEZac1DiPBzlQ7hAoIRGEEpjW+9FelOC C4Qg9T4CAy8Q01A9/NxtV6bDBAn1t6nvKQpVefvu1k1CKBsU4m2yTbd8iDK5M0JQPI j875Hh00Tf0/GL4QFpOHz25O6LwJ3YbJiQqMeXXc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Fietkau , Sasha Levin Subject: [PATCH 5.12 097/242] mt76: dma: use ieee80211_tx_status_ext to free packets when tx fails Date: Thu, 15 Jul 2021 20:37:39 +0200 Message-Id: <20210715182610.162715896@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Felix Fietkau [ Upstream commit 94e4f5794627a80ce036c35b32a9900daeb31be3 ] Fixes AQL issues on full queues, especially with 802.3 encap offload Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/dma.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index 426787f4b2ae..ee0acde53a60 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -349,6 +349,9 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q, struct sk_buff *skb, struct mt76_wcid *wcid, struct ieee80211_sta *sta) { + struct ieee80211_tx_status status = { + .sta = sta, + }; struct mt76_tx_info tx_info = { .skb = skb, }; @@ -360,11 +363,9 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q, u8 *txwi; t = mt76_get_txwi(dev); - if (!t) { - hw = mt76_tx_status_get_hw(dev, skb); - ieee80211_free_txskb(hw, skb); - return -ENOMEM; - } + if (!t) + goto free_skb; + txwi = mt76_get_txwi_ptr(dev, t); skb->prev = skb->next = NULL; @@ -427,8 +428,13 @@ free: } #endif - dev_kfree_skb(tx_info.skb); mt76_put_txwi(dev, t); + +free_skb: + status.skb = tx_info.skb; + hw = mt76_tx_status_get_hw(dev, tx_info.skb); + ieee80211_tx_status_ext(hw, &status); + return ret; } -- 2.30.2