Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2421122pxj; Mon, 10 May 2021 02:30:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVhuKETxmFykBRUu/QeOm2CH2Wug9uiZmfICXIN8oTjAtinUecIDNqaXK2qCARWrclf9qR X-Received: by 2002:a50:fc02:: with SMTP id i2mr28409281edr.320.1620639051289; Mon, 10 May 2021 02:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620639051; cv=none; d=google.com; s=arc-20160816; b=AMgm27GFKwBGVpi85btNSAxmRKb7NZk+/Wmx/CYvQySZDIUSIQm7+X4QXRkLVg049c UzcYzPJ1W4IcozSUVpi4AlQ206bm4t3wyLchHW/MANcDyjYsWQcB/REY4N+XkuQ60Usj 8B7p6J7cToLBZ2XPWUxSwL1hKuD4ZVghv67+HwSQfFdxGB3f+/QoFvqEJjmoU8z1Z+a6 4UkqUGhwen/zIb1X7AYO65hggjHTxF2mtBH5GfkZ5R/5XvUjq7zu8UWMkvgWRDgV1Xkk 6cTgHgpnRcQFKPMz0jkjo/qb3uKRWzzUX7SjqrD1oibn4dQRjK70L54efBh96r0S6tM1 Yhwg== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=y2kj2lEz21WqQgtTWRcavg+V4sIJfTed4gI+vQUo88o=; b=ozanVz94uK93UPPhG2C3H7PWLqckhUUl2LibI7WoyxawxRDyXw9usoLGGp263mzAG6 rSdySMecYZ2y9yKarM52sJz+cOWBDUuwZEFojR3Dy4u+UNMjjGPdv5pE6ODi13JoP/2b R3elEAdTCbAaqlSBm8YdFj9be1HywgocxSj8hhNH18nP3l0s9lkV22w385DcayefG93p X7zUbt444x3UzTzNSc5yQA8vdqxBPV7zDQouVwLaYKBsYxQWPMfi5blu+RnbpiIKbNAx ecDqikYeSBpHPFeTLwFMjNhxkVasweSMl3zsrfawk90mRma932iAKm6PZTHUX2d5QNCK qecw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=KKfX57Gc; 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 g3si1998559ejf.16.2021.05.10.02.30.27; Mon, 10 May 2021 02:30:51 -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=KKfX57Gc; 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 S230254AbhEJJ2R (ORCPT + 99 others); Mon, 10 May 2021 05:28:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230259AbhEJJ2M (ORCPT ); Mon, 10 May 2021 05:28:12 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D04CC06138C for ; Mon, 10 May 2021 02:27:08 -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:References:In-Reply-To: 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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=y2kj2lEz21WqQgtTWRcavg+V4sIJfTed4gI+vQUo88o=; b=KKfX57Gc6amYEhVfK+fr3diqM1 9eHT16zoE4duZ5DcE5iSI4cMRk80UAXJ0IsCjppXc9YBEQkruYBPtHn7ZV7SWt/t+xY8rIoxkhfyR FRoCXya2yRwuyJx9cHm7NfPGmgbjQmfz/VXnuOFB02K8DhD5tty6HwN/r/JqzO8aaEuc=; Received: from p54ae9ff2.dip0.t-ipconnect.de ([84.174.159.242] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lg2Bu-000572-B4 for linux-wireless@vger.kernel.org; Mon, 10 May 2021 11:27:06 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 7/9] mt76: dma: use ieee80211_tx_status_ext to free packets when tx fails Date: Mon, 10 May 2021 11:27:01 +0200 Message-Id: <20210510092703.90500-7-nbd@nbd.name> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210510092703.90500-1-nbd@nbd.name> References: <20210510092703.90500-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fixes AQL issues on full queues, especially with 802.3 encap offload Signed-off-by: Felix Fietkau --- 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 75c1f54b1fe5..5e1c1506a4c6 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -350,6 +350,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, }; @@ -361,11 +364,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; @@ -428,8 +429,13 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q, } #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.1