Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4231112pxk; Tue, 8 Sep 2020 14:19:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJPgSfouXjOZeCd5aWdCt7T+ogYfsCsLeQjvjmfM3ib+3nFTE9JHljIkk/yhBozIRs5FBX X-Received: by 2002:a17:906:ca4f:: with SMTP id jx15mr417944ejb.454.1599599998776; Tue, 08 Sep 2020 14:19:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599599998; cv=none; d=google.com; s=arc-20160816; b=ttYyd3CXlH3ytUuFNSA/S8NbAESPBp8yeeXmYxUeSnbA20cOPQCB587KfxiQXBUncQ g5ElcjThFoWC7s9Ip6tiQk7tfNnlAA8IekGY6U3OzsMQ7UWqkGY3p88VolgwTUQqWxNN 1lzXS/CfgN43GEK2V7U7X9vpNFv5j8GPXP99xcw9JJP5eQyiq3UnRJt6O/LOAjtih87E wDEyi070Q3Eq0tibKr/4UWcSCzEalmRHfRwjByCjSfeLOICWdqu47EhYOjX41/DUnw8O 0RJcL6+Jbz0yJyLQOFprQf34bACc9YpYCd/fKKuhzGA6YDvgMzwmdCyOAo+yy2OaqEu9 Hs9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=xaPk7cTDqaEwfXS7jkKrLqiO9M5K7qzRC7RSwWrn9mM=; b=WYYhphHovUWOgdikdccu+UcgxuZcF+Uusalk4Feq+90gqGXTZef9SGLqxIcuqzqng3 Q6k9M1kTCAocIKSdTZBrcImanfGORZh6Bt6VQVoNjK9UwyS524mxzxm/MfMF3Wg7bc12 ee658UHz1n9qyUWmDzwL43Str3bXb7tIFN8eQdo5LH4NN3dfVoOEuxQe+JSmcZqIudST Gg7+NWBcAVPGGWuvqeYNCdjwWYdWR4P4LaHq+exd11pIliOkBNNWjj8wP5yKOYjzWVfy 8O8y36Qr3AAtGh9VR09XHFJ7HpoWaCpKl2o/qoW9b6GzBGYJEtrt327arzoMzmgP2T1M f8Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=YCgqQkS6; 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 de17si178862edb.89.2020.09.08.14.19.24; Tue, 08 Sep 2020 14:19:58 -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=YCgqQkS6; 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 S1730181AbgIHVSJ (ORCPT + 99 others); Tue, 8 Sep 2020 17:18:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728631AbgIHVSD (ORCPT ); Tue, 8 Sep 2020 17:18:03 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3819C061573 for ; Tue, 8 Sep 2020 14:18:01 -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=xaPk7cTDqaEwfXS7jkKrLqiO9M5K7qzRC7RSwWrn9mM=; b=YCgqQkS6g/8tsXCUNbnIhku6iv PMw5+u8ptbaq6VORH0lK7NPIwUrsKzU2fCBMrByo3GVbJl3EJJyhZKeAImqkoR6jlIcdslRURfCIk bOI4glaUufCHtmT8YGpKyCbydzVoY0vzL2lPZeIoWo2faTBfki/Mh0SdZeWHNKi/tkAE=; Received: from p4ff13fcb.dip0.t-ipconnect.de ([79.241.63.203] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1kFl02-0002Cx-Hi for linux-wireless@vger.kernel.org; Tue, 08 Sep 2020 23:17:58 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 03/11] mt76: testmode: add a limit for queued tx_frames packets Date: Tue, 8 Sep 2020 23:17:48 +0200 Message-Id: <20200908211756.15998-3-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908211756.15998-1-nbd@nbd.name> References: <20200908211756.15998-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This avoids running out of available tx tokens Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/testmode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/testmode.c b/drivers/net/wireless/mediatek/mt76/testmode.c index f6fd515dfe57..a38abb6868d5 100644 --- a/drivers/net/wireless/mediatek/mt76/testmode.c +++ b/drivers/net/wireless/mediatek/mt76/testmode.c @@ -33,7 +33,8 @@ void mt76_testmode_tx_pending(struct mt76_dev *dev) spin_lock_bh(&q->lock); - while (td->tx_pending > 0 && q->queued < q->ndesc / 2) { + while (td->tx_pending > 0 && td->tx_queued - td->tx_done < 1000 && + q->queued < q->ndesc / 2) { int ret; ret = dev->queue_ops->tx_queue_skb(dev, qid, skb_get(skb), wcid, NULL); -- 2.28.0