Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp654608pxv; Thu, 15 Jul 2021 12:35:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpjt4WGhq7dD+KYzilQDTi4y01k5xI9SIx3o5pz9iD3EVLY1lVhXkQrWg7mXWQl6NAch23 X-Received: by 2002:a05:6402:3096:: with SMTP id de22mr9284259edb.91.1626377726567; Thu, 15 Jul 2021 12:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626377726; cv=none; d=google.com; s=arc-20160816; b=I2q9VOhh/PLwF830vGTpR/F5kuAqDuqUsfiP8VEGEcFe+d/nY1vYBVbXNUrTOZ6qM+ p5Fto5gApZ2cXlgssDGwZhATUsl5f4z283Rs4REXUyYPvFQoqGmfO5WHiLNjZCIYytP9 9oY7eGucZm7Aq3pJ265a2bmdCirmBcH3iSIRa+6+PrTP67I5jbHf/YK3RY+Iu1vrOIBH xjmJQ89RKU3OlsZVL/bjGk3YOZSs2DYKjdmlgRL7P999Ha4eEimL21EBKG8DTEhMiFZ+ P0/0ijklkbi/x4vF1tvrj5OR+GilgKIRD9DoEEksNc/WU0hhpC6lBY+lue4x22FTgPtK Y8gw== 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=dGUXaTCLrp1MSQco0YQ4CmQLctTehbXQyAfHAzI60NE=; b=S93zfop/VgFv91V+edkNAERkxFqWxM7MLjLEQDUgSI8rM/ZuVkhAcJKYS36gJR43bN 61qA+SpZcHyfctBSPk40d5UxqJTEpD45uPTEi5/OIwkK2OxIu5HfIEh8BQhwNtBDwrC1 BbrbRU2JzqYZKmwONfd91UQAsWohM/hBGjcyrRmRSXVIF7yB8hxGQVWQw1oWR3GA6zHH Nmk4oL7aTHfjvtFfsyjN6vktJQx2EVTeWFMOwAII/LdNHouewaU8jPK79lkJ2AoNLj3O rCZkoG8fotl8Gs2UOj1EO5c+rcwbxPdjqyyVfCEbp+AVn5curvFPOKgpJolDop1aIRaF d21A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ENHJVP0p; 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 w13si9136512edx.361.2021.07.15.12.35.04; Thu, 15 Jul 2021 12:35:26 -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=ENHJVP0p; 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 S245447AbhGOTdD (ORCPT + 99 others); Thu, 15 Jul 2021 15:33:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:50134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242029AbhGOTKu (ORCPT ); Thu, 15 Jul 2021 15:10:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 019646127C; Thu, 15 Jul 2021 19:07:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376075; bh=FkJtLNhPA67hVQqGSCjpNdPjZ7Yg83H/cOWLMUtigGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ENHJVP0pIpr/sEsxAG4nqAgUQZPmmRAgiyYgE4rv9G3/UBry8bH/UZdVLarY5M6Er cJvBqQmxI8RUl1+JEbI4qF0ocv6nxVhmXPTfId++QWWm+LcTPqrHkyVI6LHYjVYXHX b50/TSY5x3WgqnGQIDeGPuwGTAfmheghO4LrFw4U= 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.13 114/266] mt76: dma: use ieee80211_tx_status_ext to free packets when tx fails Date: Thu, 15 Jul 2021 20:37:49 +0200 Message-Id: <20210715182634.012188734@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@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 72b1cc0ecfda..e5c324dd24f9 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