Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3034984ybt; Mon, 22 Jun 2020 13:14:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2zBuY3Lb0awAUQKMZwjPUCyoML8OtmU/U3gX9X7lGGviEN5ag/9xjgATTf1f3o762875h X-Received: by 2002:a50:e047:: with SMTP id g7mr4541100edl.290.1592856862695; Mon, 22 Jun 2020 13:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592856862; cv=none; d=google.com; s=arc-20160816; b=0l00qSksU+SvaE7lJc5biqg3rfXrl7hp7XYCFoVe3a2SiaeW5JKMyHy6kZYTWN188w R8LUVlZk8wIAL658Q4BELCIsUnuRFWuzMNfmy8iu/US5AG9TKsbtAyjvYpxJLPJP2+z6 ar1sSa0JVfzAQHkiDOUosIPwVYMBm/T04oIOzNmFr+AtHRj5JLEN57PjaQT5sKpKMhmz SExoAyRllzOcwzn9g57CYZMDMJXBJ6lU+SzBKbodq0FNW1Cc7euCLhbiTlkmYbOG4dMw DKqzohEpcOubd2plu5izp9GKyUWDdS/7ZQCwdSNypjwMVy4zux0pSjYXCSXFGCRZjkj2 DfJg== 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 :message-id:date:subject:to:from:dkim-signature; bh=unpmBz2h+G5i2VYH8BHgbNnK+shxEmXWCisN/Qi7dFA=; b=Q+p9Pk0MSy4vtAhlqFmAVXFpADLi4/vUkYmshteU885IEDSVqNa4dUNM8xyfuAWLCc RXRTzm3t7Zmi+qlynqItELa6WV+buBfN6d/hKfNKvWrY7Ak8L/g38PLhg8UtjzR6fw1X 5QRoXUUdjXA1kc4xi675spI8kqeY8TtZ+HrP4edGpmY7AHTJ7pMZdU4FzSrSgtF++dR9 h2hT8YTqxu6TKP6CDX7ZJbDgBZR6r0r9tVX/ulPXUdLKDLdadGb8qnTRjJddrpZQ6BNx cjCO5kcQz6b0raiDE8yocKTzTasibyJ9VsKUQgAgNn+V1Pe/lRgyqP1WfZLXSXSENzq/ HS2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=dmoRPFhk; 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 z3si8132210ejx.584.2020.06.22.13.13.45; Mon, 22 Jun 2020 13:14:22 -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=dmoRPFhk; 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 S1728735AbgFVUNl (ORCPT + 99 others); Mon, 22 Jun 2020 16:13:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728414AbgFVUNk (ORCPT ); Mon, 22 Jun 2020 16:13:40 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62E91C061795 for ; Mon, 22 Jun 2020 13:13:40 -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=unpmBz2h+G5i2VYH8BHgbNnK+shxEmXWCisN/Qi7dFA=; b=dmoRPFhkvS/kpIPhcqctgt2jNa 6QlMMkbb84kTVwixOZO31Vc5EVgg2xv7AzMVBOnGIRi2BQp0OpMOePJCkYsi0HKkzcVa8mYn+3/gJ fFY/1kx2WV5vurVRUi314FR6xG9K/jw4R/MvAi+ECLHCViof236PVIRlcj4x0Vi0kJxc=; Received: from p54ae948c.dip0.t-ipconnect.de ([84.174.148.140] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1jnSoz-0000qE-Kv for linux-wireless@vger.kernel.org; Mon, 22 Jun 2020 22:13:37 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 1/7] mt76: mt7615: schedule tx tasklet and sta poll on mac tx free Date: Mon, 22 Jun 2020 22:13:21 +0200 Message-Id: <20200622201327.94414-1-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 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 Unlike on earlier chips, DMA completion on MT7615 does not imply actually having sent out any packets. Since AQL will prevent filling the hardware queues and will only allow more packets to be passed to the driver after tx completion, it makes much more sense to schedule the tx tasklet there. This is also needed for scheduling tx in testmode support Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7615/dma.c | 4 ---- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c index e5a965df899a..1231a5ddf9ea 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c @@ -122,10 +122,6 @@ static int mt7615_poll_tx(struct napi_struct *napi, int budget) mt7615_tx_cleanup(dev); - rcu_read_lock(); - mt7615_mac_sta_poll(dev); - rcu_read_unlock(); - tasklet_schedule(&dev->mt76.tx_tasklet); return 0; diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index d150fac50c00..1dc291e8b766 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -1399,6 +1399,12 @@ static void mt7615_mac_tx_free(struct mt7615_dev *dev, struct sk_buff *skb) } dev_kfree_skb(skb); + + rcu_read_lock(); + mt7615_mac_sta_poll(dev); + rcu_read_unlock(); + + tasklet_schedule(&dev->mt76.tx_tasklet); } void mt7615_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q, -- 2.24.0